|
|
9119d9 |
From 44b0bb2f62a67823d30ec5ae2b3b77883fed5bdc Mon Sep 17 00:00:00 2001
|
|
|
9119d9 |
Message-Id: <44b0bb2f62a67823d30ec5ae2b3b77883fed5bdc@dist-git>
|
|
|
9119d9 |
From: Peter Krempa <pkrempa@redhat.com>
|
|
|
9119d9 |
Date: Wed, 24 Sep 2014 11:01:28 +0200
|
|
|
9119d9 |
Subject: [PATCH] qemu: Sanitize argument names and empty disk check in
|
|
|
9119d9 |
qemuDomainDetermineDiskChain
|
|
|
9119d9 |
|
|
|
9119d9 |
https://bugzilla.redhat.com/show_bug.cgi?id=1138231
|
|
|
9119d9 |
|
|
|
9119d9 |
Reuse virStorageSourceIsEmpty and rename "force" argument to
|
|
|
9119d9 |
"force_probe".
|
|
|
9119d9 |
|
|
|
9119d9 |
(cherry picked from commit 172ca0e748714799bc0abec1144d7896e681728b)
|
|
|
9119d9 |
|
|
|
9119d9 |
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
|
|
|
9119d9 |
---
|
|
|
9119d9 |
src/qemu/qemu_domain.c | 8 +++-----
|
|
|
9119d9 |
src/qemu/qemu_domain.h | 2 +-
|
|
|
9119d9 |
2 files changed, 4 insertions(+), 6 deletions(-)
|
|
|
9119d9 |
|
|
|
9119d9 |
diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c
|
|
|
9119d9 |
index e471af5..3766ceb 100644
|
|
|
9119d9 |
--- a/src/qemu/qemu_domain.c
|
|
|
9119d9 |
+++ b/src/qemu/qemu_domain.c
|
|
|
9119d9 |
@@ -2711,20 +2711,18 @@ int
|
|
|
9119d9 |
qemuDomainDetermineDiskChain(virQEMUDriverPtr driver,
|
|
|
9119d9 |
virDomainObjPtr vm,
|
|
|
9119d9 |
virDomainDiskDefPtr disk,
|
|
|
9119d9 |
- bool force)
|
|
|
9119d9 |
+ bool force_probe)
|
|
|
9119d9 |
{
|
|
|
9119d9 |
virQEMUDriverConfigPtr cfg = virQEMUDriverGetConfig(driver);
|
|
|
9119d9 |
int ret = 0;
|
|
|
9119d9 |
uid_t uid;
|
|
|
9119d9 |
gid_t gid;
|
|
|
9119d9 |
- int type = virStorageSourceGetActualType(disk->src);
|
|
|
9119d9 |
|
|
|
9119d9 |
- if (type != VIR_STORAGE_TYPE_NETWORK &&
|
|
|
9119d9 |
- !disk->src->path)
|
|
|
9119d9 |
+ if (virStorageSourceIsEmpty(disk->src))
|
|
|
9119d9 |
goto cleanup;
|
|
|
9119d9 |
|
|
|
9119d9 |
if (disk->src->backingStore) {
|
|
|
9119d9 |
- if (force)
|
|
|
9119d9 |
+ if (force_probe)
|
|
|
9119d9 |
virStorageSourceBackingStoreClear(disk->src);
|
|
|
9119d9 |
else
|
|
|
9119d9 |
goto cleanup;
|
|
|
9119d9 |
diff --git a/src/qemu/qemu_domain.h b/src/qemu/qemu_domain.h
|
|
|
9119d9 |
index d21acd7..c1d1edf 100644
|
|
|
9119d9 |
--- a/src/qemu/qemu_domain.h
|
|
|
9119d9 |
+++ b/src/qemu/qemu_domain.h
|
|
|
9119d9 |
@@ -370,7 +370,7 @@ int qemuDomainCheckDiskPresence(virQEMUDriverPtr driver,
|
|
|
9119d9 |
int qemuDomainDetermineDiskChain(virQEMUDriverPtr driver,
|
|
|
9119d9 |
virDomainObjPtr vm,
|
|
|
9119d9 |
virDomainDiskDefPtr disk,
|
|
|
9119d9 |
- bool force);
|
|
|
9119d9 |
+ bool force_probe);
|
|
|
9119d9 |
|
|
|
9119d9 |
int qemuDomainStorageFileInit(virQEMUDriverPtr driver,
|
|
|
9119d9 |
virDomainObjPtr vm,
|
|
|
9119d9 |
--
|
|
|
9119d9 |
2.1.1
|
|
|
9119d9 |
|