mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-23 14:15:28 +00:00
qemu: Sanitize argument names and empty disk check in qemuDomainDetermineDiskChain
Reuse virStorageSourceIsEmpty and rename "force" argument to "force_probe".
This commit is contained in:
parent
b8549877a1
commit
172ca0e748
@ -2707,20 +2707,18 @@ int
|
||||
qemuDomainDetermineDiskChain(virQEMUDriverPtr driver,
|
||||
virDomainObjPtr vm,
|
||||
virDomainDiskDefPtr disk,
|
||||
bool force)
|
||||
bool force_probe)
|
||||
{
|
||||
virQEMUDriverConfigPtr cfg = virQEMUDriverGetConfig(driver);
|
||||
int ret = 0;
|
||||
uid_t uid;
|
||||
gid_t gid;
|
||||
int type = virStorageSourceGetActualType(disk->src);
|
||||
|
||||
if (type != VIR_STORAGE_TYPE_NETWORK &&
|
||||
!disk->src->path)
|
||||
if (virStorageSourceIsEmpty(disk->src))
|
||||
goto cleanup;
|
||||
|
||||
if (disk->src->backingStore) {
|
||||
if (force)
|
||||
if (force_probe)
|
||||
virStorageSourceBackingStoreClear(disk->src);
|
||||
else
|
||||
goto cleanup;
|
||||
|
@ -370,7 +370,7 @@ int qemuDomainCheckDiskPresence(virQEMUDriverPtr driver,
|
||||
int qemuDomainDetermineDiskChain(virQEMUDriverPtr driver,
|
||||
virDomainObjPtr vm,
|
||||
virDomainDiskDefPtr disk,
|
||||
bool force);
|
||||
bool force_probe);
|
||||
|
||||
int qemuDomainStorageFileInit(virQEMUDriverPtr driver,
|
||||
virDomainObjPtr vm,
|
||||
|
Loading…
Reference in New Issue
Block a user