[libvirt] [PATCH 4/4] qemu: Call virDomainDefPostParse via CONFIG hotplug

Cole Robinson crobinso at redhat.com
Wed May 18 18:37:00 UTC 2016


On 05/17/2016 01:20 PM, Andrea Bolognani wrote:
> On Sat, 2016-05-14 at 16:00 -0400, Cole Robinson wrote:
>> hotplug APIs with the AFFECT_CONFIG flag are essentially replicating
>> 'insert <device> into XML document, and redefine XML'. Thinking of
>> it this way, it's natural that we call virDomainDefPostParse after
>> manually editing the XML here.
>>  
>> Not only does doing so allow us to drop a bunch of open coded calls
>> to qemuDomainAssignAddresses, but it also means we are going through
>> the standard channels for XML validation and potentially catching
>> errors in user submitted XML.
>> ---
>>   src/qemu/qemu_driver.c | 71 ++++++++++++++++++++++++++------------------------
>>   1 file changed, 37 insertions(+), 34 deletions(-)
>>  
>> diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
>> index f47c620..c5fc069 100644
>> --- a/src/qemu/qemu_driver.c
>> +++ b/src/qemu/qemu_driver.c
>> @@ -7775,10 +7775,12 @@ qemuDomainUpdateDeviceLive(virConnectPtr conn,
>>   }
>>   
>>   static int
>> -qemuDomainAttachDeviceConfig(virQEMUCapsPtr qemuCaps,
>> -                             virDomainDefPtr vmdef,
>> +qemuDomainAttachDeviceConfig(virDomainDefPtr vmdef,
>>                                virDomainDeviceDefPtr dev,
>> -                             virConnectPtr conn)
>> +                             virConnectPtr conn,
>> +                             virCapsPtr caps,
>> +                             unsigned int parse_flags,
> 
> s/parse_flags/parseFlags/g

Actually everywhere else in this file uses parse_flags, including other
hotplug routines, so I kept it this way

Thanks,
Cole




More information about the libvir-list mailing list