Re: [PATCH] Query block allocation extent from QEMU monitor

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 05/14/2010 07:10 AM, Daniel P. Berrange wrote:
> The virDomainGetBlockInfo API allows query physical block
> extent and allocated block extent. These are normally the
> same value unless storing a special format like qcow2
> inside a block device. In this scenario we can query QEMU
> to get the actual allocated extent.
> 
> Since last time:
> 
>  - Return fatal error in text monitor

Good, but...

> -    ret = 0;
> +    /* ..but if guest is running & not using raw
> +       disk format and on a block device, then query
> +       highest allocated extent from QEMU */
> +    if (virDomainObjIsActive(vm) &&
> +        disk->type == VIR_DOMAIN_DISK_TYPE_BLOCK &&
> +        meta.format != VIR_STORAGE_FILE_RAW &&
> +        S_ISBLK(sb.st_mode)) {
> +        qemuDomainObjPrivatePtr priv = vm->privateData;
> +        if (qemuDomainObjBeginJob(vm) < 0)
> +            goto cleanup;
> +
> +        qemuDomainObjEnterMonitor(vm);
> +        ret = qemuMonitorGetBlockExtent(priv->mon,
> +                                        disk->info.alias,
> +                                        &info->allocation);

that means you now propagate that fatal error out of the call, rather
than falling back on the default.

-- 
Eric Blake   eblake@xxxxxxxxxx    +1-801-349-2682
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature

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

[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]