render / rpms / libvirt

Forked from rpms/libvirt 9 months ago
Clone
7a3408
From aa35a16bdc42e64f646b5fa09cdf5809b98e507f Mon Sep 17 00:00:00 2001
7a3408
Message-Id: <aa35a16bdc42e64f646b5fa09cdf5809b98e507f@dist-git>
7a3408
From: Luyao Huang <lhuang@redhat.com>
7a3408
Date: Fri, 10 Jul 2015 09:27:56 +0200
7a3408
Subject: [PATCH] qemu: report error for non-existing disk in blockjobinfo
7a3408
7a3408
Before:
7a3408
7a3408
 # virsh blockjob r7 vdc
7a3408
 error: An error occurred, but the cause is unknown
7a3408
7a3408
After:
7a3408
7a3408
 # virsh blockjob r7 vdc
7a3408
 error: Disk 'vdc' not found in the domain
7a3408
7a3408
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1241355
7a3408
7a3408
Signed-off-by: Luyao Huang <lhuang@redhat.com>
7a3408
(cherry picked from commit b5c2245b0cddbb605fece8d8f3c7075d269e3302)
7a3408
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
7a3408
---
7a3408
 src/qemu/qemu_driver.c | 5 ++++-
7a3408
 1 file changed, 4 insertions(+), 1 deletion(-)
7a3408
7a3408
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
7a3408
index b3e9e63..063bedb 100644
7a3408
--- a/src/qemu/qemu_driver.c
7a3408
+++ b/src/qemu/qemu_driver.c
7a3408
@@ -16515,8 +16515,11 @@ qemuDomainGetBlockJobInfo(virDomainPtr dom,
7a3408
     if (qemuDomainSupportsBlockJobs(vm, NULL) < 0)
7a3408
         goto endjob;
7a3408
 
7a3408
-    if (!(disk = virDomainDiskByName(vm->def, path, true)))
7a3408
+    if (!(disk = virDomainDiskByName(vm->def, path, true))) {
7a3408
+        virReportError(VIR_ERR_INVALID_ARG,
7a3408
+                       _("disk %s not found in the domain"), path);
7a3408
         goto endjob;
7a3408
+    }
7a3408
 
7a3408
     qemuDomainObjEnterMonitor(driver, vm);
7a3408
     ret = qemuMonitorGetBlockJobInfo(qemuDomainGetMonitor(vm),
7a3408
-- 
7a3408
2.4.5
7a3408