[libvirt] [PATCH 05/12] qemu: Manage disk's unpriv_sgio in domain lifecyle

Osier Yang jyang at redhat.com
Thu Dec 13 03:23:53 UTC 2012


On 2012年12月13日 01:13, Daniel P. Berrange wrote:
> On Tue, Dec 11, 2012 at 09:37:22PM +0800, Osier Yang wrote:
>> Here lifecyle only means starting and shutdown.
>>
>> To record the original "unpriv_sgio" value for non-shared disk,
>> this introduces "orig_cdbfilter" for disk def. On domain starting,
>> the disk's "unpriv_sgio" is set with regards to the config in domain
>> XML.  And on domain shutdown, it's restored to the original value
>> ("orig_cdbfilter"). Later patch will prevent restoring if other
>> domain is still using the shared disk.
>> ---
>>   src/conf/domain_conf.h  |    1 +
>>   src/qemu/qemu_process.c |   34 +++++++++++++++++++++++++++++++++-
>>   2 files changed, 34 insertions(+), 1 deletions(-)
>>
>> diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h
>> index 9586f75..256bea2 100644
>> --- a/src/conf/domain_conf.h
>> +++ b/src/conf/domain_conf.h
>> @@ -629,6 +629,7 @@ struct _virDomainDiskDef {
>>       bool rawio_specified;
>>       int rawio; /* no = 0, yes = 1 */
>>       int cdbfilter;
>> +    int orig_cdbfilter;
>
> Huh, why did you go to the bother of saving the original value
> in the hash table, if you're saving it here too. THis just seems
> bogus to me, and won't survive a restart of libvirtd in any
> case.
>

I should explain more in the commit message.

The orig_cdbfilter in qemu driver is for shared disks, and this is
for non-shared disks.

As the orig_cdbfilter can be changed when starting domains share
disks. E.g.

% virsh start one
% virsh start two

the orig_cdbfilter in domain two's disk def will be not the exact
original value.

Regards,
Osier





More information about the libvir-list mailing list