[libvirt] [PATCH] check more error info about whether drive_add failed

Eric Blake eblake at redhat.com
Thu Feb 17 21:13:32 UTC 2011


On 02/16/2011 08:32 PM, Wen Congyang wrote:
> When we attach a disk, but we specify a wrong format of disk image,
> qemu monitor command drive_add will fail, but libvirt does not detect
> this error.
> 
> Signed-off-by: Wen Congyang <wency at cn.fujitsu.com>
> 
> ---
>  src/qemu/qemu_monitor_text.c |    6 ++++++
>  1 files changed, 6 insertions(+), 0 deletions(-)
> 
> diff --git a/src/qemu/qemu_monitor_text.c b/src/qemu/qemu_monitor_text.c
> index 6d0ba4c..0fd7546 100644
> --- a/src/qemu/qemu_monitor_text.c
> +++ b/src/qemu/qemu_monitor_text.c
> @@ -2453,6 +2453,12 @@ int qemuMonitorTextAddDrive(qemuMonitorPtr mon,
>          goto cleanup;
>      }
>  
> +    if (strstr(reply, "could not open disk image")) {
> +        qemuReportError(VIR_ERR_OPERATION_FAILED, "%s",
> +                        _("open disk image file failed"));
> +        goto cleanup;
> +    }

ACK and pushed.

-- 
Eric Blake   eblake at redhat.com    +1-801-349-2682
Libvirt virtualization library http://libvirt.org

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 619 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20110217/5f9d1f1b/attachment-0001.sig>


More information about the libvir-list mailing list