[libvirt] [PATCH v4 5/8] screenshot: Expose the new API in virsh

Eric Blake eblake at redhat.com
Fri May 13 23:18:27 UTC 2011


On 05/13/2011 03:16 AM, Daniel P. Berrange wrote:
> On Thu, May 12, 2011 at 06:29:12PM +0200, Michal Privoznik wrote:
>> +static const vshCmdOptDef opts_screenshot[] = {
>> +    {"domain", VSH_OT_DATA, VSH_OFLAG_REQ, N_("domain name, id or uuid")},
>> +    {"file", VSH_OT_DATA, VSH_OFLAG_REQ, N_("where to store the screenshot")},
>> +    {"screen", VSH_OT_INT, 0, N_("ID of a screen to take screenshot of")},
>> +    {NULL, 0, 0, NULL}
>> +};
>> +

> I think it would be better if 'screenID' was a flag instead of a
> positional parameter, eg
> 
>       screenshot --screen 1 myguest imagefile.png

But virsh _already_ handles all named arguments in any order.  That is,

screenshot --screen 1 myguest imagefile.png
screenshot myguest imagefile.png 1

are identical, at least with the above opts_screenshot (thanks to commit
b9973f5).

> 
> That would then allow us to make the filename optional too. eg
> 
>    screenshot --screen 1 myguest

Optional filename, however, _does_ make sense, which is not covered in
the above opts_screenshot.

-- 
Eric Blake   eblake at redhat.com    +1-801-349-2682
Libvirt virtualization library http://libvirt.org

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 619 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20110513/2eb53ff2/attachment-0001.sig>


More information about the libvir-list mailing list