ab145e
From a62075772680bd30ced25d7177048ab26db8ea09 Mon Sep 17 00:00:00 2001
ab145e
Message-Id: <a62075772680bd30ced25d7177048ab26db8ea09@dist-git>
ab145e
From: Pavel Hrdina <phrdina@redhat.com>
ab145e
Date: Fri, 21 May 2021 14:16:06 +0200
ab145e
Subject: [PATCH] conf: introduce virDomainDefParseBootKernelOptions
ab145e
ab145e
Extract the code to it's own function.
ab145e
ab145e
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
ab145e
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
ab145e
(cherry picked from commit bf9b3f8e573092cc98ea647f25cf116e22bbfe3c)
ab145e
ab145e
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1929357
ab145e
ab145e
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
ab145e
Message-Id: <936428a5fa6d4104361ac8080639a55111c14965.1621599207.git.phrdina@redhat.com>
ab145e
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
ab145e
---
ab145e
 src/conf/domain_conf.c | 18 +++++++++++++-----
ab145e
 1 file changed, 13 insertions(+), 5 deletions(-)
ab145e
ab145e
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
ab145e
index 9eb418c7c0..432ad938f9 100644
ab145e
--- a/src/conf/domain_conf.c
ab145e
+++ b/src/conf/domain_conf.c
ab145e
@@ -19365,6 +19365,18 @@ virDomainDefParseBootInitOptions(virDomainDefPtr def,
ab145e
 }
ab145e
 
ab145e
 
ab145e
+static void
ab145e
+virDomainDefParseBootKernelOptions(virDomainDefPtr def,
ab145e
+                                   xmlXPathContextPtr ctxt)
ab145e
+{
ab145e
+    def->os.kernel = virXPathString("string(./os/kernel[1])", ctxt);
ab145e
+    def->os.initrd = virXPathString("string(./os/initrd[1])", ctxt);
ab145e
+    def->os.cmdline = virXPathString("string(./os/cmdline[1])", ctxt);
ab145e
+    def->os.dtb = virXPathString("string(./os/dtb[1])", ctxt);
ab145e
+    def->os.root = virXPathString("string(./os/root[1])", ctxt);
ab145e
+}
ab145e
+
ab145e
+
ab145e
 static int
ab145e
 virDomainDefParseBootOptions(virDomainDefPtr def,
ab145e
                              xmlXPathContextPtr ctxt)
ab145e
@@ -19394,11 +19406,7 @@ virDomainDefParseBootOptions(virDomainDefPtr def,
ab145e
         g_autofree char *firmware = NULL;
ab145e
         xmlNodePtr loader_node;
ab145e
 
ab145e
-        def->os.kernel = virXPathString("string(./os/kernel[1])", ctxt);
ab145e
-        def->os.initrd = virXPathString("string(./os/initrd[1])", ctxt);
ab145e
-        def->os.cmdline = virXPathString("string(./os/cmdline[1])", ctxt);
ab145e
-        def->os.dtb = virXPathString("string(./os/dtb[1])", ctxt);
ab145e
-        def->os.root = virXPathString("string(./os/root[1])", ctxt);
ab145e
+        virDomainDefParseBootKernelOptions(def, ctxt);
ab145e
 
ab145e
         if (def->os.type == VIR_DOMAIN_OSTYPE_HVM &&
ab145e
             (firmware = virXPathString("string(./os/@firmware)", ctxt))) {
ab145e
-- 
ab145e
2.31.1
ab145e