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

[libvirt] [PATCH v3 1/4] QEMU: add -dtb option support



Signed-off-by: Olivia Yin <hong-hua yin freescale com>
---
 src/conf/domain_conf.c  |    4 ++++
 src/conf/domain_conf.h  |    1 +
 src/qemu/qemu_command.c |    6 ++++++
 3 files changed, 11 insertions(+), 0 deletions(-)

diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index 995cf0c..9b71066 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -1785,6 +1785,7 @@ void virDomainDefFree(virDomainDefPtr def)
     VIR_FREE(def->os.kernel);
     VIR_FREE(def->os.initrd);
     VIR_FREE(def->os.cmdline);
+    VIR_FREE(def->os.dtb);
     VIR_FREE(def->os.root);
     VIR_FREE(def->os.loader);
     VIR_FREE(def->os.bootloader);
@@ -10047,6 +10048,7 @@ virDomainDefParseXML(virCapsPtr caps,
         def->os.kernel = virXPathString("string(./os/kernel[1])", ctxt);
         def->os.initrd = virXPathString("string(./os/initrd[1])", ctxt);
         def->os.cmdline = virXPathString("string(./os/cmdline[1])", ctxt);
+        def->os.dtb = virXPathString("string(./os/dtb[1])", ctxt);
         def->os.root = virXPathString("string(./os/root[1])", ctxt);
         def->os.loader = virXPathString("string(./os/loader[1])", ctxt);
     }
@@ -14666,6 +14668,8 @@ virDomainDefFormatInternal(virDomainDefPtr def,
                           def->os.initrd);
     virBufferEscapeString(buf, "    <cmdline>%s</cmdline>\n",
                           def->os.cmdline);
+    virBufferEscapeString(buf, "    <dtb>%s</dtb>\n",
+                          def->os.dtb);
     virBufferEscapeString(buf, "    <root>%s</root>\n",
                           def->os.root);
 
diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h
index 5828ae2..a35f90a 100644
--- a/src/conf/domain_conf.h
+++ b/src/conf/domain_conf.h
@@ -1535,6 +1535,7 @@ struct _virDomainOSDef {
     char *kernel;
     char *initrd;
     char *cmdline;
+    char *dtb;
     char *root;
     char *loader;
     char *bootloader;
diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
index 1c9bfc9..fb74ec5 100644
--- a/src/qemu/qemu_command.c
+++ b/src/qemu/qemu_command.c
@@ -5732,6 +5732,8 @@ qemuBuildCommandLine(virConnectPtr conn,
             virCommandAddArgList(cmd, "-initrd", def->os.initrd, NULL);
         if (def->os.cmdline)
             virCommandAddArgList(cmd, "-append", def->os.cmdline, NULL);
+        if (def->os.dtb)
+            virCommandAddArgList(cmd, "-dtb", def->os.dtb, NULL);
     } else {
         virCommandAddArgList(cmd, "-bootloader", def->os.bootloader, NULL);
     }
@@ -8908,6 +8910,10 @@ virDomainDefPtr qemuParseCommandLine(virCapsPtr qemuCaps,
             WANT_VALUE();
             if (!(def->os.cmdline = strdup(val)))
                 goto no_memory;
+        } else if (STREQ(arg, "-dtb")) {
+            WANT_VALUE();
+            if (!(def->os.dtb = strdup(val)))
+                goto no_memory;
         } else if (STREQ(arg, "-boot")) {
             const char *token = NULL;
             WANT_VALUE();
-- 
1.6.4



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