[PATCH 4/7] qemuDomainHotplugAddVcpu: Remove legacy hotplug branch

Ján Tomko jtomko at redhat.com
Fri Oct 29 13:44:15 UTC 2021


On a Friday in 2021, Peter Krempa wrote:
>Report an error if the new hotplug is not supported and remove the
>alternate code paths.
>
>The modern cpu-hotplug code was introduced in qemu-2.7. We keep the
>capability so that proper errors are reported in case a platform doesn't
>support hotplug.
>
>Signed-off-by: Peter Krempa <pkrempa at redhat.com>
>---
> src/qemu/qemu_hotplug.c | 22 ++++++++++------------
> 1 file changed, 10 insertions(+), 12 deletions(-)
>
>diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c
>index a7b432b6f5..51c5b517b4 100644
>--- a/src/qemu/qemu_hotplug.c
>+++ b/src/qemu/qemu_hotplug.c
>@@ -6488,25 +6488,24 @@ qemuDomainHotplugAddVcpu(virQEMUDriver *driver,
>     virDomainVcpuDef *vcpuinfo = virDomainDefGetVcpu(vm->def, vcpu);
>     qemuDomainVcpuPrivate *vcpupriv = QEMU_DOMAIN_VCPU_PRIVATE(vcpuinfo);
>     unsigned int nvcpus = vcpupriv->vcpus;
>-    bool newhotplug = qemuDomainSupportsNewVcpuHotplug(vm);
>     int rc;
>     int oldvcpus = virDomainDefGetVcpus(vm->def);
>     size_t i;
>
>-    if (newhotplug) {
>-        vcpupriv->alias = g_strdup_printf("vcpu%u", vcpu);
>-
>-        if (!(vcpuprops = qemuBuildHotpluggableCPUProps(vcpuinfo)))
>+    if (!qemuDomainSupportsNewVcpuHotplug(vm)) {
>+        virReportError(VIR_ERR_OPERATION_UNSUPPORTED, "%s",
>+                       _("cpu hotplug is not supported"));
>             return -1;

Request: reindent return
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20211029/418582ed/attachment-0001.sig>


More information about the libvir-list mailing list