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

[PATCH 2/6] qemuSnapshotDiskUpdateSource: Extract 'driver' and 'blockdev' from 'vm'



Reduce the number of arguments by taking them from 'vm'.

Signed-off-by: Peter Krempa <pkrempa redhat com>
---
 src/qemu/qemu_snapshot.c | 15 +++++++--------
 1 file changed, 7 insertions(+), 8 deletions(-)

diff --git a/src/qemu/qemu_snapshot.c b/src/qemu/qemu_snapshot.c
index 0435d4c371..d6e0a75996 100644
--- a/src/qemu/qemu_snapshot.c
+++ b/src/qemu/qemu_snapshot.c
@@ -1103,19 +1103,18 @@ qemuSnapshotDiskUpdateSourceRenumber(virStorageSourcePtr src)

 /**
  * qemuSnapshotDiskUpdateSource:
- * @driver: QEMU driver
  * @vm: domain object
  * @dd: snapshot disk data object
- * @blockdev: -blockdev is in use for the VM
  *
  * Updates disk definition after a successful snapshot.
  */
 static void
-qemuSnapshotDiskUpdateSource(virQEMUDriverPtr driver,
-                             virDomainObjPtr vm,
-                             qemuSnapshotDiskDataPtr dd,
-                             bool blockdev)
+qemuSnapshotDiskUpdateSource(virDomainObjPtr vm,
+                             qemuSnapshotDiskDataPtr dd)
 {
+    qemuDomainObjPrivatePtr priv = vm->privateData;
+    virQEMUDriverPtr driver = priv->driver;
+
     /* storage driver access won'd be needed */
     if (dd->initialized)
         virStorageFileDeinit(dd->src);
@@ -1138,7 +1137,7 @@ qemuSnapshotDiskUpdateSource(virQEMUDriverPtr driver,
     dd->disk->src = g_steal_pointer(&dd->src);

     /* fix numbering of disks */
-    if (!blockdev)
+    if (!virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_BLOCKDEV))
         qemuSnapshotDiskUpdateSourceRenumber(dd->disk->src);

     if (dd->persistdisk) {
@@ -1201,7 +1200,7 @@ qemuSnapshotCreateActiveExternalDisks(virQEMUDriverPtr driver,
         virDomainAuditDisk(vm, dd->disk->src, dd->src, "snapshot", rc >= 0);

         if (rc == 0)
-            qemuSnapshotDiskUpdateSource(driver, vm, dd, blockdev);
+            qemuSnapshotDiskUpdateSource(vm, dd);
     }

     if (rc < 0)
-- 
2.26.2


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