[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

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



[...]

>>>>
>>>
>>> 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.

In order to "close" on this, if a squash the attach patch does that work
for everyone?

John
>From a37d80c22f2ac1f89e45d3178f16ec964de9f960 Mon Sep 17 00:00:00 2001
From: John Ferlan <jferlan redhat com>
Date: Thu, 22 Jun 2017 18:20:37 -0400
Subject: [PATCH] merge?

Signed-off-by: John Ferlan <jferlan redhat com>
---
 tools/virsh-domain.c | 10 +++++-----
 tools/virsh.pod      | 17 +++++++++++------
 2 files changed, 16 insertions(+), 11 deletions(-)

diff --git a/tools/virsh-domain.c b/tools/virsh-domain.c
index 7b46987..5311a57 100644
--- a/tools/virsh-domain.c
+++ b/tools/virsh-domain.c
@@ -9873,15 +9873,15 @@ cmdDomXMLToNative(vshControl *ctl, const vshCmd *cmd)
 {
     bool ret = false;
     const char *format = NULL;
-    const char *xml = NULL;
-    char *xmlData = NULL;
+    const char *xmlFile = NULL;
     char *configData = NULL;
+    char *xmlData = NULL;
     unsigned int flags = 0;
     virshControlPtr priv = ctl->privData;
     virDomainPtr dom = NULL;
 
     if (vshCommandOptStringReq(ctl, cmd, "format", &format) < 0 ||
-        vshCommandOptStringReq(ctl, cmd, "xml", &xml) < 0)
+        vshCommandOptStringReq(ctl, cmd, "xml", &xmlFile) < 0)
         return false;
 
     VSH_EXCLUSIVE_OPTIONS("domain", "xml");
@@ -9892,8 +9892,8 @@ cmdDomXMLToNative(vshControl *ctl, const vshCmd *cmd)
 
     if (dom) {
         xmlData = virDomainGetXMLDesc(dom, flags);
-    } else if (xml) {
-        if (virFileReadAll(xml, VSH_MAX_XML_FILE, &xmlData) < 0)
+    } else if (xmlFile) {
+        if (virFileReadAll(xmlFile, VSH_MAX_XML_FILE, &xmlData) < 0)
             goto cleanup;
     } else {
         vshError(ctl, "%s", _("need either domain or domain XML"));
diff --git a/tools/virsh.pod b/tools/virsh.pod
index d77b336..43d6f0c 100644
--- a/tools/virsh.pod
+++ b/tools/virsh.pod
@@ -1441,13 +1441,18 @@ I<format> argument may be B<xen-xm>, B<xen-xl>, or B<xen-sxpr>. For
 LXC hypervisor, the I<format> argument must be B<lxc-tools>.
 
 =item B<domxml-to-native> I<format>
-{ I<--domain> I<domain-name-or-id-or-uuid> | [I<--xml>] I<xml> }
+{ [I<--xml>] I<xml> | I<--domain> I<domain-name-or-id-or-uuid> }
 
-Convert the file I<xml> in domain XML format or existing domain to the
-native guest configuration format named by I<format>. For QEMU/KVM hypervisor,
-the I<format> argument must be B<qemu-argv>. For Xen hypervisor, the
-I<format> argument may be B<xen-xm>, B<xen-xl>, or B<xen-sxpr>. For
-LXC hypervisor, the I<format> argument must be B<lxc-tools>.
+Convert the file I<xml> into domain XML format or convert an existing
+I<--domain> to the native guest configuration format named by I<format>.
+The I<xml> and I<--domain> arguments are mutually exclusive.
+
+For the QEMU/KVM hypervisor, the I<format> argument must be B<qemu-argv>.
+
+For the Xen hypervisor, the I<format> argument may be B<xen-xm>, B<xen-xl>,
+or B<xen-sxpr>.
+
+For the LXC hypervisor, the I<format> argument must be B<lxc-tools>.
 
 =item B<dump> I<domain> I<corefilepath> [I<--bypass-cache>]
 { [I<--live>] | [I<--crash>] | [I<--reset>] } [I<--verbose>] [I<--memory-only>]
-- 
2.9.4


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]