mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-25 10:03:49 +03:00
qemuDomainUpdateDeviceFlags: Parse device as live if needed
When updating device it's worth parsing live info too as users might want to update it as well. Signed-off-by: Michal Privoznik <mprivozn@redhat.com> Reviewed-by: John Ferlan <jferlan@redhat.com>
This commit is contained in:
parent
36e92adc7e
commit
84de7fbfdb
@ -8606,7 +8606,7 @@ static int qemuDomainUpdateDeviceFlags(virDomainPtr dom,
|
||||
int ret = -1;
|
||||
virQEMUDriverConfigPtr cfg = NULL;
|
||||
virCapsPtr caps = NULL;
|
||||
unsigned int parse_flags = VIR_DOMAIN_DEF_PARSE_INACTIVE;
|
||||
unsigned int parse_flags = 0;
|
||||
|
||||
virCheckFlags(VIR_DOMAIN_AFFECT_LIVE |
|
||||
VIR_DOMAIN_AFFECT_CONFIG |
|
||||
@ -8628,15 +8628,19 @@ static int qemuDomainUpdateDeviceFlags(virDomainPtr dom,
|
||||
if (qemuDomainObjBeginJob(driver, vm, QEMU_JOB_MODIFY) < 0)
|
||||
goto cleanup;
|
||||
|
||||
if (virDomainObjUpdateModificationImpact(vm, &flags) < 0)
|
||||
goto endjob;
|
||||
|
||||
if ((flags & VIR_DOMAIN_AFFECT_CONFIG) &&
|
||||
!(flags & VIR_DOMAIN_AFFECT_LIVE))
|
||||
parse_flags |= VIR_DOMAIN_DEF_PARSE_INACTIVE;
|
||||
|
||||
dev = dev_copy = virDomainDeviceDefParse(xml, vm->def,
|
||||
caps, driver->xmlopt,
|
||||
parse_flags);
|
||||
if (dev == NULL)
|
||||
goto endjob;
|
||||
|
||||
if (virDomainObjUpdateModificationImpact(vm, &flags) < 0)
|
||||
goto endjob;
|
||||
|
||||
if (flags & VIR_DOMAIN_AFFECT_CONFIG &&
|
||||
flags & VIR_DOMAIN_AFFECT_LIVE) {
|
||||
/* If we are affecting both CONFIG and LIVE
|
||||
|
Loading…
x
Reference in New Issue
Block a user