[libvirt] [PATCH 6/6] qemu: Support only raw volumes in qemuDomainBlockPeek

John Ferlan jferlan at redhat.com
Sat Jul 1 14:45:09 UTC 2017



On 06/23/2017 09:33 AM, Peter Krempa wrote:
> The API documents that it peeks into the VM disk. We can't do that
> currently for non raw images so report an error.
> ---
>  src/qemu/qemu_driver.c | 6 ++++++
>  1 file changed, 6 insertions(+)
> 
> diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
> index 115368d1d..53655749b 100644
> --- a/src/qemu/qemu_driver.c
> +++ b/src/qemu/qemu_driver.c
> @@ -11328,6 +11328,12 @@ qemuDomainBlockPeek(virDomainPtr dom,
>          goto cleanup;
>      }
> 
> +    if (disk->src->format != VIR_STORAGE_FILE_RAW) {
> +        virReportError(VIR_ERR_OPERATION_UNSUPPORTED, "%s",
> +                       _("peeking is supported only for RAW disks"));
> +        goto cleanup;

Just noting that cleanup will call virStorageFileDeinit. Although
virStorageFileInitAs wouldn't be called since tis won't call
qemuDomainStorageFileInit, but it shouldn't matter since
virStorageFileDeinit does check if virStorageFileIsInitialized - just a
concern that some how some "future" change to Deinit does something that
assumes Init was run. I would hope not, but just pointing it out...

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

John
> +    }
> +
>      if (qemuDomainStorageFileInit(driver, vm, disk->src) < 0)
>          goto cleanup;
> 




More information about the libvir-list mailing list