[libvirt] [PATCH 8/8] qemu: Support sgio setting for volume type disk

Osier Yang jyang at redhat.com
Mon Apr 8 11:11:47 UTC 2013


On 06/04/13 08:44, John Ferlan wrote:
> On 04/04/2013 03:38 PM, Osier Yang wrote:
>> ---
>>   src/qemu/qemu_process.c | 7 +++++--
>>   1 file changed, 5 insertions(+), 2 deletions(-)
>>
> Perhaps a MACRO would be better to describe:
>
> "!(disk->type == VIR_DOMAIN_DISK_TYPE_VOLUME &&
>> +           disk->srcpool &&
>> +           disk->srcpool->voltype == VIR_STORAGE_VOL_BLOCK)

Sounds good, I will consider to create it in later patches.

> "
>
> Squeeze that into 7/8 and use it here.
>
> Just a thought as the whole construct is tough to read.
>
> ACK, in any case.
>
> John
>> diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c
>> index 3ac0c70..757f8b8 100644
>> --- a/src/qemu/qemu_process.c
>> +++ b/src/qemu/qemu_process.c
>> @@ -3235,9 +3235,12 @@ qemuSetUnprivSGIO(virDomainDiskDefPtr disk)
>>       /* "sgio" is only valid for block disk; cdrom
>>        * and floopy disk can have empty source.
>>        */
>> -    if (disk->type != VIR_DOMAIN_DISK_TYPE_BLOCK ||
>> +    if (!disk->src ||
>>           disk->device != VIR_DOMAIN_DISK_DEVICE_LUN ||
>> -        !disk->src)
>> +        (disk->type != VIR_DOMAIN_DISK_TYPE_BLOCK &&
>> +         !(disk->type == VIR_DOMAIN_DISK_TYPE_VOLUME &&
>> +           disk->srcpool &&
>> +           disk->srcpool->voltype == VIR_STORAGE_VOL_BLOCK)))
>>           return 0;
>>   
>>       sysfs_path = virGetUnprivSGIOSysfsPath(disk->src, NULL);
>>
> --
> libvir-list mailing list
> libvir-list at redhat.com
> https://www.redhat.com/mailman/listinfo/libvir-list




More information about the libvir-list mailing list