[PATCH v2 1/3] qemu: XMLToNative: Don't show -S

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

 



-S causes qemu to start in the paused state. Since XML2Native is intended
to generate something that users can run directly, this will trip them up.
---

v2:
    s/forXMLToArgv/standalone/g

 src/qemu/qemu_command.c  | 8 ++++++--
 src/qemu/qemu_command.h  | 3 ++-
 src/qemu/qemu_driver.c   | 6 ++++--
 src/qemu/qemu_process.c  | 2 +-
 tests/qemuxml2argvtest.c | 2 +-
 tests/qemuxmlnstest.c    | 2 +-
 6 files changed, 15 insertions(+), 8 deletions(-)

diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
index aa1a3db..3e6a172 100644
--- a/src/qemu/qemu_command.c
+++ b/src/qemu/qemu_command.c
@@ -7711,7 +7711,8 @@ qemuBuildCommandLine(virConnectPtr conn,
                      int migrateFd,
                      virDomainSnapshotObjPtr snapshot,
                      enum virNetDevVPortProfileOp vmop,
-                     qemuBuildCommandLineCallbacksPtr callbacks)
+                     qemuBuildCommandLineCallbacksPtr callbacks,
+                     bool standalone)
 {
     virErrorPtr originalError = NULL;
     size_t i, j;
@@ -7820,7 +7821,10 @@ qemuBuildCommandLine(virConnectPtr conn,
             virCommandAddArg(cmd, def->name);
         }
     }
-    virCommandAddArg(cmd, "-S"); /* freeze CPU */
+
+    if (!standalone)
+        virCommandAddArg(cmd, "-S"); /* freeze CPU */
+
     if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_ENABLE_FIPS))
         virCommandAddArg(cmd, "-enable-fips");
 
diff --git a/src/qemu/qemu_command.h b/src/qemu/qemu_command.h
index ebb0b1d..50dc4a0 100644
--- a/src/qemu/qemu_command.h
+++ b/src/qemu/qemu_command.h
@@ -76,7 +76,8 @@ virCommandPtr qemuBuildCommandLine(virConnectPtr conn,
                                    int migrateFd,
                                    virDomainSnapshotObjPtr current_snapshot,
                                    enum virNetDevVPortProfileOp vmop,
-                                   qemuBuildCommandLineCallbacksPtr callbacks)
+                                   qemuBuildCommandLineCallbacksPtr callbacks,
+                                   bool forXMLToArgv)
     ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(11);
 
 /* Generate '-device' string for chardev device */
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index ba470a1..a01739c 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -5956,8 +5956,10 @@ static char *qemuConnectDomainXMLToNative(virConnectPtr conn,
 
     if (!(cmd = qemuBuildCommandLine(conn, driver, def,
                                      &monConfig, monitor_json, qemuCaps,
-                                     NULL, -1, NULL, VIR_NETDEV_VPORT_PROFILE_OP_NO_OP,
-                                     &buildCommandLineCallbacks)))
+                                     NULL, -1, NULL,
+                                     VIR_NETDEV_VPORT_PROFILE_OP_NO_OP,
+                                     &buildCommandLineCallbacks,
+                                     true)))
         goto cleanup;
 
     ret = virCommandToString(cmd);
diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c
index 809ab37..35ad62a 100644
--- a/src/qemu/qemu_process.c
+++ b/src/qemu/qemu_process.c
@@ -3856,7 +3856,7 @@ int qemuProcessStart(virConnectPtr conn,
     if (!(cmd = qemuBuildCommandLine(conn, driver, vm->def, priv->monConfig,
                                      priv->monJSON, priv->qemuCaps,
                                      migrateFrom, stdin_fd, snapshot, vmop,
-                                     &buildCommandLineCallbacks)))
+                                     &buildCommandLineCallbacks, false)))
         goto cleanup;
 
     /* now that we know it is about to start call the hook if present */
diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c
index 5d6a64b..8d7d9e5 100644
--- a/tests/qemuxml2argvtest.c
+++ b/tests/qemuxml2argvtest.c
@@ -357,7 +357,7 @@ static int testCompareXMLToArgvFiles(const char *xml,
                                      (flags & FLAG_JSON), extraFlags,
                                      migrateFrom, migrateFd, NULL,
                                      VIR_NETDEV_VPORT_PROFILE_OP_NO_OP,
-                                     &testCallbacks))) {
+                                     &testCallbacks, false))) {
         if (!virtTestOOMActive() &&
             (flags & FLAG_EXPECT_FAILURE)) {
             ret = 0;
diff --git a/tests/qemuxmlnstest.c b/tests/qemuxmlnstest.c
index 20a5ccd..81d496e 100644
--- a/tests/qemuxmlnstest.c
+++ b/tests/qemuxmlnstest.c
@@ -119,7 +119,7 @@ static int testCompareXMLToArgvFiles(const char *xml,
                                      vmdef, &monitor_chr, json, extraFlags,
                                      migrateFrom, migrateFd, NULL,
                                      VIR_NETDEV_VPORT_PROFILE_OP_NO_OP,
-                                     &testCallbacks)))
+                                     &testCallbacks, false)))
         goto fail;
 
     if (!virtTestOOMActive()) {
-- 
1.8.5.3

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