[libvirt] [PATCH] virsh: pool-list: introduce --uuid

Chen Hanxiao chen_han_xiao at 126.com
Thu Jan 5 09:43:14 UTC 2017




At 2017-01-05 17:18:14, "Erik Skultety" <eskultet at redhat.com> wrote:
>On Thu, Jan 05, 2017 at 11:56:21AM +0800, Chen Hanxiao wrote:
>> From: Chen Hanxiao <chenhanxiao at gmail.com>
>> 
>> This patch will introduce option [--uuid].
>> If specified, UUID of pools will be printed out.
>> 
>> virsh # pool-list --all
>>  Name                 State      Autostart
>> -------------------------------------------
>>  default              active     yes
>>  root                 active     yes
>> 
>> virsh # pool-list --all --uuid
>>  Name                 State      Autostart  UUID
>> ---------------------------------------------------------------------------------
>>  default              active     yes        45fdb1f3-402d-44c0-b2c0-a7be61fea6c7
>>  root                 active     yes        eb397f25-9a44-459d-80df-330ca8f65ba8
>> 
>
>The whole point of '--uuid' and '--name' options for the existing list commands
>is to improve shell scripting with virsh, i.e. avoid having to parse the format
>of the table in order to extract some info and/or to call
><prefix>uuid command in a loop for every entry in the table. With your proposal
>one would still have to parse the table contents which is in contrast in what
>I've just mentioned. Also, this would introduce some inconsistency with how we
>currently treat those options with other commands. So this patch will have to
>be reworked and while at it, you could also introduce the '--name' option along
>with '--uuid'.
>

As what we did in the other virsh command, such as 'list`,
We could did as:
1) virsh # pool-list --name
default
root

2) virsh # pool-list --all --uuid
45fdb1f3-402d-44c0-b2c0-a7be61fea6c7
eb397f25-9a44-459d-80df-330ca8f65ba8 

3) virsh # pool-list --all --uuid --name
 Name                 State      Autostart  UUID
---------------------------------------------------------------------------------
 default              active     yes        45fdb1f3-402d-44c0-b2c0-a7be61fea6c7
  root                 active     yes        eb397f25-9a44-459d-80df-330ca8f65ba8 

v2 will come soon.

Regards,
- Chen




More information about the libvir-list mailing list