[libvirt] [PATCH 7/8 v8] qemu: Set unpriv_sgio when attaching disk

Eric Blake eblake at redhat.com
Fri Dec 14 22:05:09 UTC 2012


On 12/14/2012 08:45 AM, Osier Yang wrote:
> Just like for domain starting, this sets the disk's unpriv_sgio
> if cdbfilter is specified when attaching disk.
> ---
>  src/qemu/qemu_driver.c |   23 +++++++++++++++++------
>  1 files changed, 17 insertions(+), 6 deletions(-)

> +
> +        /* Set sysfs unpriv_sgio if cdbfilter is specified. */
> +        if (disk->cdbfilter) {
> +            if (virSetDeviceUnprivSGIO(disk->src, NULL,
> +                                       (disk->cdbfilter ==
> +                                       VIR_DOMAIN_DISK_CDB_FILTER_NO)
> +                                       ? 1 : 0) < 0) {
> +                VIR_WARN("Failed to set unpriv_sgio of disk '%s'", disk->src);
> +                goto end;
> +            }
> +        }

Again, does this do the right thing if some other domain already had
cdbfilter='no' (aka kernel allows SG_IO) but this domain omitted the
cdbfilter attribute (which defaults to cdbfilter='yes' but does not
satisfy the if(disk->cdbfilter) condition)?  I suspect that will be
worked out when you rework things to use a tri-state rawio.

-- 
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: 619 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20121214/b94fe938/attachment-0001.sig>


More information about the libvir-list mailing list