Re: [libvirt] [PATCH 3/7] qemu: process: Enforce 'vcpu' order range to <1, maxvcpus>

2016-09-29 Thread Pavel Hrdina
On Wed, Sep 21, 2016 at 01:49:55PM +0200, Peter Krempa wrote:
> The current code that validates duplicate vcpu order would not work
> properly if the order would exceed def->maxvcpus. Limit the order to the
> interval described.
> ---
>  src/qemu/qemu_process.c | 8 ++--
>  1 file changed, 6 insertions(+), 2 deletions(-)

ACK and safe for freeze.

Pavel


signature.asc
Description: Digital signature
--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

[libvirt] [PATCH 3/7] qemu: process: Enforce 'vcpu' order range to <1, maxvcpus>

2016-09-21 Thread Peter Krempa
The current code that validates duplicate vcpu order would not work
properly if the order would exceed def->maxvcpus. Limit the order to the
interval described.
---
 src/qemu/qemu_process.c | 8 ++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c
index b40daee..7007fd9 100644
--- a/src/qemu/qemu_process.c
+++ b/src/qemu/qemu_process.c
@@ -4795,10 +4795,14 @@ qemuProcessValidateHotpluggableVcpus(virDomainDefPtr 
def)
 goto cleanup;
 }

-ignore_value(virBitmapSetBit(ordermap, vcpu->order));
+if (virBitmapSetBit(ordermap, vcpu->order)) {
+virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
+   _("vcpu order '%u' exceeds vcpu count"),
+   vcpu->order);
+goto cleanup;
+}
 }

-
 for (j = i + 1; j < (i + vcpupriv->vcpus); j++) {
 subvcpu = virDomainDefGetVcpu(def, j);
 if (subvcpu->hotpluggable != vcpu->hotpluggable ||
-- 
2.10.0

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list