From: "Dominic Jäger" <d.jaeger@proxmox.com>
To: pve-devel@lists.proxmox.com
Subject: Re: [pve-devel] [PATCH qemu-server 3/3] Move importdisk from qm to API
Date: Thu, 30 Jul 2020 12:38:33 +0200 [thread overview]
Message-ID: <20200730103833.GB511631@mala.proxmox.com> (raw)
In-Reply-To: <863926e1-a312-93fb-9183-1c753667af34@proxmox.com>
On Wed, Jul 29, 2020 at 03:00:41PM +0200, Aaron Lauterer wrote:
> Some small nits inline, mainly regarding the wording of descriptions and messages.
>
> One thing I noticed is with multi line strings.
> The concat `.` should probably be at the end of the previous line if you split it up
I intially placed it in front because the Perl style guide has && in front in a
multi-line example. However, most of this file has dots in the end and the
guide forbids mixing only, so I changed it.
> but I would prefer to have long lines instead of it being split. Long lines
> make it easier to search for a certain (log) message in the code with grep.
Fabian G. just told me that 80 character line length limit also holds for comments.
> > + properties => {
> > + node => get_standard_option('pve-node'),
> > + vmid => get_standard_option('pve-vmid',
> > + {completion => \&PVE::QemuServer::complete_vmid}),
> > + source => {
> > + description => 'Path of the disk image that should be imported',
>
> What about: "Path to the disk image to import".
>
> > + type => 'string',
> > + },
> > + device => {
> > + type => 'string',
> > + description => "What device the imported image should be "
>
> "Bus/Device type of the new disk"
>
> > + ."(e.g. 'ide0', 'scsi2'). Will add the image as unused disk "
> > + ."if omitted.",
> > + enum => [PVE::QemuServer::Drive::valid_drive_names()],
> > + optional => 1,
> > + },
> > + device_options => {
> > + type => 'string',
> > + format => 'drive_options',
> > + description => "What options to set for the device "
>
> "Options to set for the new disk"
>
> > + ."(e.g. 'discard=on,backup=0')",
> > + optional => 1,
> > + },
> > + storage => get_standard_option('pve-storage-id', {
> > + description => 'Which storage to use for the imported image.',
>
> "The storage to which the image will be imported to."
Fits the rest of the descriptions better => Changed all of them. Thank you :)
>
> > + my $worker = sub {
> > + my $message = $device ? "to $device on" : 'as unused disk to';
>
> wouldn't it make more sense to phrase it "to $device for" and 'as unused disk for'?
Didn't include this (yet) because I actually don't think so.
The idea was
1) Import sth to sth => "Importing disk 'myfile.qcow2' to VM100."
How are we importing it? as unused disk
"Importing disk 'myfile.qcow2' as unused disk to VM100."
2) Import sth to sth => "Importing disk 'myfile.qcow2' to scsi0."
Where is scsi0? on VM100
"Importing disk 'myfile.qcow2' to scsi0 on VM100."
> It will result in something like "importing disk 'myfile.qcow' as unused disk for VM XXX"
I think there should be a "to" somewhere.
Would for 2) "Importing disk 'myfile.qcow2' to VM100 as scsi0" make sense, maybe?
>
> > +my %optional_file_drivdesc_base = %drivedesc_base;
>
> s/drivdesc/drivedesc/ or maybe even to drive_desc
>
> > +$optional_file_drivdesc_base{file}{optional} = 1; # TODO verify
> > +my $drive_options_fmt = {
> > + %optional_file_drivdesc_base, # first bad thing here is the missing file stuff
> > + %iothread_fmt,
> > + %model_fmt,
> > + %queues_fmt,
> > + %scsiblock_fmt,
> > + %ssd_fmt,
> > + %wwn_fmt,
> > +};
> > +PVE::JSONSchema::register_format('drive_options', $drive_options_fmt);
> > +
Thank you, changed it to drivedesc :) It's drivedesc in the rest of the file, without underscore.
prev parent reply other threads:[~2020-07-30 10:38 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-07-07 10:04 [pve-devel] [PATCH widget-toolkit 0/1] Add GUI for importdisk Dominic Jäger
2020-07-07 10:04 ` [pve-devel] [PATCH widget-toolkit 1/3] EditWindow: Change url to 'importdisk' for import Dominic Jäger
2020-07-07 10:04 ` [pve-devel] [PATCH manager 2/3] Hardware View: Add GUI for importdisk Dominic Jäger
2020-07-29 13:25 ` Aaron Lauterer
2020-07-30 10:20 ` Dominic Jäger
2020-07-07 10:04 ` [pve-devel] [PATCH qemu-server 3/3] Move importdisk from qm to API Dominic Jäger
2020-07-29 13:00 ` Aaron Lauterer
2020-07-30 10:38 ` Dominic Jäger [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200730103833.GB511631@mala.proxmox.com \
--to=d.jaeger@proxmox.com \
--cc=pve-devel@lists.proxmox.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.