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,
|
qemuDomainDetermineDiskChain(virQEMUDriverPtr driver,
|
||||||
virDomainObjPtr vm,
|
virDomainObjPtr vm,
|
||||||
virDomainDiskDefPtr disk,
|
virDomainDiskDefPtr disk,
|
||||||
bool force)
|
bool force_probe)
|
||||||
{
|
{
|
||||||
virQEMUDriverConfigPtr cfg = virQEMUDriverGetConfig(driver);
|
virQEMUDriverConfigPtr cfg = virQEMUDriverGetConfig(driver);
|
||||||
int ret = 0;
|
int ret = 0;
|
||||||
uid_t uid;
|
uid_t uid;
|
||||||
gid_t gid;
|
gid_t gid;
|
||||||
int type = virStorageSourceGetActualType(disk->src);
|
|
||||||
|
|
||||||
if (type != VIR_STORAGE_TYPE_NETWORK &&
|
if (virStorageSourceIsEmpty(disk->src))
|
||||||
!disk->src->path)
|
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
|
||||||
if (disk->src->backingStore) {
|
if (disk->src->backingStore) {
|
||||||
if (force)
|
if (force_probe)
|
||||||
virStorageSourceBackingStoreClear(disk->src);
|
virStorageSourceBackingStoreClear(disk->src);
|
||||||
else
|
else
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
@ -370,7 +370,7 @@ int qemuDomainCheckDiskPresence(virQEMUDriverPtr driver,
|
|||||||
int qemuDomainDetermineDiskChain(virQEMUDriverPtr driver,
|
int qemuDomainDetermineDiskChain(virQEMUDriverPtr driver,
|
||||||
virDomainObjPtr vm,
|
virDomainObjPtr vm,
|
||||||
virDomainDiskDefPtr disk,
|
virDomainDiskDefPtr disk,
|
||||||
bool force);
|
bool force_probe);
|
||||||
|
|
||||||
int qemuDomainStorageFileInit(virQEMUDriverPtr driver,
|
int qemuDomainStorageFileInit(virQEMUDriverPtr driver,
|
||||||
virDomainObjPtr vm,
|
virDomainObjPtr vm,
|
||||||
|
Loading…
Reference in New Issue
Block a user