[libvirt] [PATCH] qemuMonitorTextAddDrive: Fail on unrecognized disk format

Michal Privoznik posted 1 patch 6 years, 9 months ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/libvirt tags/patchew/ae287802e5a05635a60ce66789e1d71348c0d030.1498038106.git.mprivozn@redhat.com
src/qemu/qemu_monitor_text.c | 6 ++++++
1 file changed, 6 insertions(+)
[libvirt] [PATCH] qemuMonitorTextAddDrive: Fail on unrecognized disk format
Posted by Michal Privoznik 6 years, 9 months ago
Since qemu commit 3ef6c40ad0b it can fail if trying to hotplug a
disk that is not qcow2 despite us saying it is. We need to error
out in that case.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
---
 src/qemu/qemu_monitor_text.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/src/qemu/qemu_monitor_text.c b/src/qemu/qemu_monitor_text.c
index 66c94fbcd..737e8389b 100644
--- a/src/qemu/qemu_monitor_text.c
+++ b/src/qemu/qemu_monitor_text.c
@@ -1963,6 +1963,12 @@ int qemuMonitorTextAddDrive(qemuMonitorPtr mon,
         goto cleanup;
     }
 
+    if (strstr(reply, "Image is not in")) {
+        virReportError(VIR_ERR_OPERATION_FAILED, "%s",
+                       _("Incorrect disk format"));
+        goto cleanup;
+    }
+
     ret = 0;
 
  cleanup:
-- 
2.13.0

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH] qemuMonitorTextAddDrive: Fail on unrecognized disk format
Posted by John Ferlan 6 years, 9 months ago

On 06/21/2017 05:44 AM, Michal Privoznik wrote:
> Since qemu commit 3ef6c40ad0b it can fail if trying to hotplug a
> disk that is not qcow2 despite us saying it is. We need to error
> out in that case.
> 
> Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
> ---
>  src/qemu/qemu_monitor_text.c | 6 ++++++
>  1 file changed, 6 insertions(+)
> 

Reviewed-by: John Ferlan <jferlan@redhat.com>

John

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list