qemu: Sanitize argument names and empty disk check in qemuDomainDetermineDiskChain

Reuse virStorageSourceIsEmpty and rename "force" argument to
"force_probe".
This commit is contained in:
Peter Krempa 2014-09-18 11:21:10 +02:00
parent b8549877a1
commit 172ca0e748
2 changed files with 4 additions and 6 deletions

View File

@ -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;

View File

@ -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,