mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-08-28 19:41:16 +00:00
qemu: vcpu: Clear vcpu order information rather than making it invalid
Certain operations may make the vcpu order information invalid. Since the order is primarily used to ensure migration compatibility and has basically no other user benefits, clear the order prior to certain operations and document that it may be cleared. All the operations that would clear the order can still be properly executed by defining a new domain configuration rather than using the helper APIs. Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1370357
This commit is contained in:
parent
80ea1cf6be
commit
a88c65e490
@ -569,7 +569,8 @@
|
|||||||
the order may be be duplicated accross all vcpus that need to be
|
the order may be be duplicated accross all vcpus that need to be
|
||||||
enabled at once. Specifying order is not necessary, vcpus are then
|
enabled at once. Specifying order is not necessary, vcpus are then
|
||||||
added in an arbitrary order. If order info is used, it must be used for
|
added in an arbitrary order. If order info is used, it must be used for
|
||||||
all online vcpus.
|
all online vcpus. Hypervisors may clear or update ordering information
|
||||||
|
during certain operations to assure valid configuration.
|
||||||
|
|
||||||
Note that hypervisors may create hotpluggable vcpus differently from
|
Note that hypervisors may create hotpluggable vcpus differently from
|
||||||
boot vcpus thus special initialization may be necessary.
|
boot vcpus thus special initialization may be necessary.
|
||||||
|
@ -25566,3 +25566,13 @@ virDomainGetBlkioParametersAssignFromDef(virDomainDefPtr def,
|
|||||||
virBufferFreeAndReset(&buf);
|
virBufferFreeAndReset(&buf);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void
|
||||||
|
virDomainDefVcpuOrderClear(virDomainDefPtr def)
|
||||||
|
{
|
||||||
|
size_t i;
|
||||||
|
|
||||||
|
for (i = 0; i < def->maxvcpus; i++)
|
||||||
|
def->vcpus[i]->order = 0;
|
||||||
|
}
|
||||||
|
@ -2487,6 +2487,7 @@ unsigned int virDomainDefGetVcpus(const virDomainDef *def);
|
|||||||
virBitmapPtr virDomainDefGetOnlineVcpumap(const virDomainDef *def);
|
virBitmapPtr virDomainDefGetOnlineVcpumap(const virDomainDef *def);
|
||||||
virDomainVcpuDefPtr virDomainDefGetVcpu(virDomainDefPtr def, unsigned int vcpu)
|
virDomainVcpuDefPtr virDomainDefGetVcpu(virDomainDefPtr def, unsigned int vcpu)
|
||||||
ATTRIBUTE_RETURN_CHECK;
|
ATTRIBUTE_RETURN_CHECK;
|
||||||
|
void virDomainDefVcpuOrderClear(virDomainDefPtr def);
|
||||||
|
|
||||||
virDomainObjPtr virDomainObjNew(virDomainXMLOptionPtr caps)
|
virDomainObjPtr virDomainObjNew(virDomainXMLOptionPtr caps)
|
||||||
ATTRIBUTE_NONNULL(1);
|
ATTRIBUTE_NONNULL(1);
|
||||||
|
@ -264,6 +264,7 @@ virDomainDefSetMemoryTotal;
|
|||||||
virDomainDefSetVcpus;
|
virDomainDefSetVcpus;
|
||||||
virDomainDefSetVcpusMax;
|
virDomainDefSetVcpusMax;
|
||||||
virDomainDefValidate;
|
virDomainDefValidate;
|
||||||
|
virDomainDefVcpuOrderClear;
|
||||||
virDomainDeleteConfig;
|
virDomainDeleteConfig;
|
||||||
virDomainDeviceAddressIsValid;
|
virDomainDeviceAddressIsValid;
|
||||||
virDomainDeviceAddressTypeToString;
|
virDomainDeviceAddressTypeToString;
|
||||||
|
@ -4745,6 +4745,9 @@ qemuDomainSetVcpusMax(virQEMUDriverPtr driver,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* ordering information may become invalid, thus clear it */
|
||||||
|
virDomainDefVcpuOrderClear(persistentDef);
|
||||||
|
|
||||||
if (virDomainDefSetVcpusMax(persistentDef, nvcpus, driver->xmlopt) < 0)
|
if (virDomainDefSetVcpusMax(persistentDef, nvcpus, driver->xmlopt) < 0)
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
|
||||||
@ -4919,6 +4922,8 @@ qemuDomainSetVcpusConfig(virDomainDefPtr def,
|
|||||||
size_t maxvcpus = virDomainDefGetVcpusMax(def);
|
size_t maxvcpus = virDomainDefGetVcpusMax(def);
|
||||||
size_t i;
|
size_t i;
|
||||||
|
|
||||||
|
/* ordering information may become invalid, thus clear it */
|
||||||
|
virDomainDefVcpuOrderClear(def);
|
||||||
|
|
||||||
if (curvcpus == nvcpus)
|
if (curvcpus == nvcpus)
|
||||||
return;
|
return;
|
||||||
|
Loading…
Reference in New Issue
Block a user