[PATCH 08/11] qemuBuildCommandLine: Remove 'driver' argument

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

 



We pass 'vm' which already contains it.

Signed-off-by: Peter Krempa <pkrempa@xxxxxxxxxx>
---
 src/qemu/qemu_command.c  |  6 +++---
 src/qemu/qemu_command.h  | 17 ++++++++---------
 src/qemu/qemu_driver.c   |  2 +-
 src/qemu/qemu_process.c  |  9 +++------
 src/qemu/qemu_process.h  |  3 +--
 tests/qemuxml2argvtest.c |  2 +-
 6 files changed, 17 insertions(+), 22 deletions(-)

diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
index 35ed8ac0ed..c48575f78c 100644
--- a/src/qemu/qemu_command.c
+++ b/src/qemu/qemu_command.c
@@ -10413,8 +10413,7 @@ qemuBuildCompatDeprecatedCommandLine(virCommand *cmd,
  * for a given virtual machine.
  */
 virCommand *
-qemuBuildCommandLine(virQEMUDriver *driver,
-                     virDomainObj *vm,
+qemuBuildCommandLine(virDomainObj *vm,
                      const char *migrateURI,
                      virDomainMomentObj *snapshot,
                      virNetDevVPortProfileOp vmop,
@@ -10426,8 +10425,9 @@ qemuBuildCommandLine(virQEMUDriver *driver,
     size_t i;
     char uuid[VIR_UUID_STRING_BUFLEN];
     g_autoptr(virCommand) cmd = NULL;
-    g_autoptr(virQEMUDriverConfig) cfg = virQEMUDriverGetConfig(driver);
     qemuDomainObjPrivate *priv = vm->privateData;
+    virQEMUDriver *driver = priv->driver;
+    g_autoptr(virQEMUDriverConfig) cfg = virQEMUDriverGetConfig(driver);
     virDomainDef *def = vm->def;
     virQEMUCaps *qemuCaps = priv->qemuCaps;

diff --git a/src/qemu/qemu_command.h b/src/qemu/qemu_command.h
index df46e80067..db5b532cb8 100644
--- a/src/qemu/qemu_command.h
+++ b/src/qemu/qemu_command.h
@@ -47,15 +47,14 @@ typedef enum {
     QEMU_BUILD_COMMAND_LINE_CPUS_RUNNING = 1 << 0,
 } qemuBuildCommandLineFlags;

-virCommand *qemuBuildCommandLine(virQEMUDriver *driver,
-                                   virDomainObj *vm,
-                                   const char *migrateURI,
-                                   virDomainMomentObj *snapshot,
-                                   virNetDevVPortProfileOp vmop,
-                                   bool enableFips,
-                                   size_t *nnicindexes,
-                                   int **nicindexes,
-                                   unsigned int flags);
+virCommand *qemuBuildCommandLine(virDomainObj *vm,
+                                 const char *migrateURI,
+                                 virDomainMomentObj *snapshot,
+                                 virNetDevVPortProfileOp vmop,
+                                 bool enableFips,
+                                 size_t *nnicindexes,
+                                 int **nicindexes,
+                                 unsigned int flags);

 /* Generate the object properties for pr-manager */
 virJSONValue *qemuBuildPRManagerInfoProps(virStorageSource *src);
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index b862208327..8097dcf144 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -6391,7 +6391,7 @@ static char *qemuConnectDomainXMLToNative(virConnectPtr conn,
     if (qemuConnectDomainXMLToNativePrepareHost(vm) < 0)
         return NULL;

-    if (!(cmd = qemuProcessCreatePretendCmdBuild(driver, vm, NULL,
+    if (!(cmd = qemuProcessCreatePretendCmdBuild(vm, NULL,
                                                  qemuCheckFips(vm),
                                                  commandlineflags)))
         return NULL;
diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c
index 1098c3bf93..fbad1254a0 100644
--- a/src/qemu/qemu_process.c
+++ b/src/qemu/qemu_process.c
@@ -7445,8 +7445,7 @@ qemuProcessLaunch(virConnectPtr conn,
     if (qemuExtDevicesStart(driver, vm, incoming != NULL) < 0)
         goto cleanup;

-    if (!(cmd = qemuBuildCommandLine(driver,
-                                     vm,
+    if (!(cmd = qemuBuildCommandLine(vm,
                                      incoming ? "defer" : NULL,
                                      snapshot, vmop,
                                      qemuCheckFips(vm),
@@ -7946,14 +7945,12 @@ qemuProcessCreatePretendCmdPrepare(virQEMUDriver *driver,


 virCommand *
-qemuProcessCreatePretendCmdBuild(virQEMUDriver *driver,
-                                 virDomainObj *vm,
+qemuProcessCreatePretendCmdBuild(virDomainObj *vm,
                                  const char *migrateURI,
                                  bool enableFips,
                                  unsigned int flags)
 {
-    return qemuBuildCommandLine(driver,
-                                vm,
+    return qemuBuildCommandLine(vm,
                                 migrateURI,
                                 NULL,
                                 VIR_NETDEV_VPORT_PROFILE_OP_NO_OP,
diff --git a/src/qemu/qemu_process.h b/src/qemu/qemu_process.h
index fa3634c64f..9856da3bb5 100644
--- a/src/qemu/qemu_process.h
+++ b/src/qemu/qemu_process.h
@@ -97,8 +97,7 @@ int qemuProcessCreatePretendCmdPrepare(virQEMUDriver *driver,
                                        const char *migrateURI,
                                        unsigned int flags);

-virCommand *qemuProcessCreatePretendCmdBuild(virQEMUDriver *driver,
-                                             virDomainObj *vm,
+virCommand *qemuProcessCreatePretendCmdBuild(virDomainObj *vm,
                                              const char *migrateURI,
                                              bool enableFips,
                                              unsigned int flags);
diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c
index 385448b57a..2385fa1209 100644
--- a/tests/qemuxml2argvtest.c
+++ b/tests/qemuxml2argvtest.c
@@ -490,7 +490,7 @@ testCompareXMLToArgvCreateArgs(virQEMUDriver *drv,
     if (!virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_ENABLE_FIPS))
         enableFips = false;

-    return qemuProcessCreatePretendCmdBuild(drv, vm, migrateURI,
+    return qemuProcessCreatePretendCmdBuild(vm, migrateURI,
                                             enableFips, 0);
 }

-- 
2.35.3




[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