Re: [PATCH v2] xenconfig: xm: Fix checking for extra in parser

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

 



On 05/12/2018 09:45 AM, Filip Alac wrote:
Parser assumed extra was always present when root was specified.
Fixed by handling root and extra separately.

Signed-off-by: Filip Alac <filipalac@xxxxxxxxx>

Reviewed-by: Jim Fehlig <jfehlig@xxxxxxxx>

and pushed. Thanks!

Regards,
Jim

---
  src/xenconfig/xen_xm.c | 7 +++++--
  1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/src/xenconfig/xen_xm.c b/src/xenconfig/xen_xm.c
index 8ef68bbc..4becb40b 100644
--- a/src/xenconfig/xen_xm.c
+++ b/src/xenconfig/xen_xm.c
@@ -91,10 +91,13 @@ xenParseXMOS(virConfPtr conf, virDomainDefPtr def)
          if (xenConfigGetString(conf, "root", &root, NULL) < 0)
              return -1;
- if (root) {
+        if (root && extra) {
              if (virAsprintf(&def->os.cmdline, "root=%s %s", root, extra) < 0)
                  return -1;
-        } else {
+        } else if (root) {
+            if (virAsprintf(&def->os.cmdline, "root=%s", root) < 0)
+                return -1;
+        } else if (extra) {
              if (VIR_STRDUP(def->os.cmdline, extra) < 0)
                  return -1;
          }


--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list



[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux