[libvirt] [PATCH v4] virsh: add [--domain DOMAIN] option to domxml-to-native DOMAIN COMMAND

Martin Kletzander mkletzan at redhat.com
Wed Jun 14 14:39:34 UTC 2017


On Wed, Jun 14, 2017 at 10:32:16AM -0400, John Ferlan wrote:
>
>
>On 06/14/2017 09:47 AM, Martin Kletzander wrote:
>> On Wed, Jun 14, 2017 at 08:55:25AM -0400, John Ferlan wrote:
>>>
>>>
>>> On 06/02/2017 11:04 AM, Daniel Liu wrote:
>>>> The option allows someone to run domain-to-native on already existing
>>>> domain without the need of supplying their XML.  It is basically
>>>> wrapper around 'virsh dumpxml  | virsh domxml-to-native /dev/stdin'.
>>>>
>>>> Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=835476
>>>> Signed-off-by: Daniel Liu <srwx4096 at gmail.com>
>>>> ---
>>>>  tools/virsh-domain.c | 51
>>>> ++++++++++++++++++++++++++++++++++++++-------------
>>>>  tools/virsh.pod      |  7 ++++---
>>>>  2 files changed, 42 insertions(+), 16 deletions(-)
>>>>
>>>> diff --git a/tools/virsh-domain.c b/tools/virsh-domain.c
>>>> index ccb514ef9..3496359c5 100644
>>>> --- a/tools/virsh-domain.c
>>>> +++ b/tools/virsh-domain.c
>>>> @@ -9848,9 +9848,13 @@ static const vshCmdOptDef
>>>> opts_domxmltonative[] = {
>>>>       .flags = VSH_OFLAG_REQ,
>>>>       .help = N_("target config data type format")
>>>>      },
>>>> +    {.name = "domain",
>>>> +     .type = VSH_OT_DATA,
>>>> +     .flags = VSH_OFLAG_REQ_OPT,
>>>> +     .help = N_("domain name, id or uuid")
>>>> +    },
>>>>      {.name = "xml",
>>>>       .type = VSH_OT_DATA,
>>>> -     .flags = VSH_OFLAG_REQ,
>>>>       .help = N_("xml data file to export from")
>>>>      },
>>>>      {.name = NULL}
>>>> @@ -9859,30 +9863,51 @@ static const vshCmdOptDef
>>>> opts_domxmltonative[] = {
>>>>  static bool
>>>>  cmdDomXMLToNative(vshControl *ctl, const vshCmd *cmd)
>>>>  {
>>>> -    bool ret = true;
>>>> +    bool ret = false;
>>>>      const char *format = NULL;
>>>> -    const char *xmlFile = NULL;
>>>> -    char *configData;
>>>> -    char *xmlData;
>>>> +    const char *xml = NULL;
>>>
>>> nit: no need to change from xmlFile to xml... The less differences the
>>> better ;-)
>>>
>>
>> There was no change, it is an additional variable, the original one is
>> below.  The number of differences would be the same, I believe.
>>
>
>If edit the file and change "xml" to "xmlFile" and change the 3 changed
>xml variable references things work... Like I said, nit, IDC if it's
>changed or not...
>

My bad, I misread that, you're right.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: Digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20170614/62c8936f/attachment-0001.sig>


More information about the libvir-list mailing list