[libvirt] [PATCH 5/8] conf: Add disk iothread bus check in device post parse

John Ferlan jferlan at redhat.com
Fri Apr 22 12:08:29 UTC 2016



On 04/22/2016 03:04 AM, Peter Krempa wrote:
> On Thu, Apr 21, 2016 at 19:24:13 -0400, John Ferlan wrote:
>> Add a check in the device post processing for any disk using iothread to be
>> using the proper bus (which happens to be only virtio for now).
>>
>> This check could have been added in device parse, except that if a domain
>> was running with such a configuration (albeit doing nothing), then it
>> would disappear. Found while working through code to add iothreads for
>> virtio-scsi-{pci,ccw}.
> 
> This is still called when parsing and makes the domain disappear.
> 
>>
>> Signed-off-by: John Ferlan <jferlan at redhat.com>
>> ---
>>  src/conf/domain_conf.c | 7 +++++++
>>  1 file changed, 7 insertions(+)
>>
>> diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
>> index a3c50f1..fd7579a 100644
>> --- a/src/conf/domain_conf.c
>> +++ b/src/conf/domain_conf.c
>> @@ -4187,6 +4187,13 @@ virDomainDeviceDefPostParseInternal(virDomainDeviceDefPtr dev,
>>              return -1;
>>          }
>>  
>> +        if (disk->iothread && disk->bus != VIR_DOMAIN_DISK_BUS_VIRTIO) {
>> +            virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
>> +                           _("disk '%s' improperly configured, iothread "
>> +                             "only supported on virtio bus"), disk->dst);
>> +            return -1;
>> +        }
>> +
>>          if (disk->info.type == VIR_DOMAIN_DEVICE_ADDRESS_TYPE_NONE &&
>>              virDomainDiskDefAssignAddress(xmlopt, disk, def) < 0)
>>              return -1;
> 
> NACK to this placement, you need to put it into qemuProcess..
> 

oh right...

In the long run this probably doesn't matter if patch7 is accepted.
That'll make the check later and only affects "new" starts. Although in
thinking about it, I don't believe any domain could be running with
iothreads and bus != virtio at this point since the code being replaced
in patch7 would inhibit that.  I was just thinking, check earlier, but
not too early, but I didn't check late enough...   parse, postparse, and
missed-in-parse-and-postparse (eg. in qemu startup).

John




More information about the libvir-list mailing list