mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-24 14:45:24 +00:00
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> Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
parent
8eacbeac74
commit
eb4aa7b109
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user