[libvirt] [PATCH v6 5/6] virsh: Expose new virDomainFSFreeze and virDomainFSThaw API

Tomoki Sekiyama tomoki.sekiyama at hds.com
Wed Apr 30 16:52:36 UTC 2014


On 4/30/14 11:30 , "Daniel P. Berrange" <berrange at redhat.com> wrote:

>On Tue, Apr 29, 2014 at 08:04:24PM -0400, Tomoki Sekiyama wrote:
>> These are exposed under domfsfreeze command and domfsthaw command.
>> 
>> Signed-off-by: Tomoki Sekiyama <tomoki.sekiyama at hds.com>
>> ---
>>  tools/virsh-domain.c |  130
>>++++++++++++++++++++++++++++++++++++++++++++++++++
>>  tools/virsh.pod      |   23 +++++++++
>>  2 files changed, 153 insertions(+)
>
>> +static const vshCmdOptDef opts_domfsfreeze[] = {
>> +    {.name = "domain",
>> +     .type = VSH_OT_DATA,
>> +     .flags = VSH_OFLAG_REQ,
>> +     .help = N_("domain name, id or uuid")
>> +    },
>> +    {.name = "mountpoints",
>> +     .type = VSH_OT_DATA,
>> +     .help = N_("comma separated list of mountpoints to be frozen")
>> +    },
>
>By using a command separated list, you prevent freezing of mount
>points whose directoy name contains a comma.

Virsh parser treats ",," as an escaped character for a comma, so you can
specify '/path,to/mnt' by '--mountpoints /path,,to/mnt'.
And ...

>I'd think it'd be better to just allow multiple instances of
>the arg eg
>
>  virsh fsfreeze  --mount <path1> --mount <path2>   <guest>

the virsh option parser rejects repeated options by

  error: option --mount already seen

so I chose comma separated list, which is also used in the
"undefine --storage" option that takes a list of targets or source paths.

Do we need to extend the parser to enable the repeated options?

Regards,
Tomoki Sekiyama





More information about the libvir-list mailing list