[libvirt] [PATCH v3] qemu: don't check for backing chains for formats w/o snapshot support

Eric Blake eblake at redhat.com
Thu Apr 24 14:36:30 UTC 2014


On 04/24/2014 07:41 AM, Martin Kletzander wrote:
> Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1019926
> Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=868673
> 
> Signed-off-by: Martin Kletzander <mkletzan at redhat.com>
> ---
> 

> +++ b/src/qemu/qemu_domain.c
> @@ -2268,8 +2268,18 @@ qemuDomainCheckDiskPresence(virQEMUDriverPtr driver,
>      VIR_DEBUG("Checking for disk presence");
>      for (i = vm->def->ndisks; i > 0; i--) {
>          disk = vm->def->disks[i - 1];
> +        const char *path = virDomainDiskGetSource(disk);
> +        enum virStorageFileFormat format = virDomainDiskGetFormat(disk);
> 
> -        if (!virDomainDiskGetSource(disk))
> +        if (!path)
> +            continue;
> +
> +        /* There is no need to check the backing chain for disks
> +         * without backing support, the fact that the file exists is
> +         * more than enough */
> +        if (format >= VIR_STORAGE_FILE_NONE &&
> +            format < VIR_STORAGE_FILE_BACKING &&
> +            virFileExists(path))

Peter may have to further tweak this with his work on gluster patches
(we should not be calling virFileExists() if virStorageIsFile(path)
returns fals); but for now this is a strict improvement.

ACK.

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

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


More information about the libvir-list mailing list