Re: [libvirt] [PATCH] Make really sure we don't access non-existing vCPUs

2016-07-13 Thread Martin Kletzander
On Tue, Jul 12, 2016 at 06:24:01PM +0200, Peter Krempa wrote: [...] It might hint to readers that the array is indeed sparse. Reading the code again I now think that rather than skipping the loop the check for vcpu should be moved into the if right below it: if (vcpu && vcpu->cpumask)

Re: [libvirt] [PATCH] Make really sure we don't access non-existing vCPUs

2016-07-12 Thread Martin Kletzander
On Tue, Jul 12, 2016 at 06:24:01PM +0200, Peter Krempa wrote: On Tue, Jul 12, 2016 at 17:54:03 +0200, Martin Kletzander wrote: On Tue, Jul 12, 2016 at 03:01:57PM +0200, Peter Krempa wrote: >On Tue, Jul 12, 2016 at 13:44:10 +0200, Martin Kletzander wrote: [...] >> I could've pushed this as a

Re: [libvirt] [PATCH] Make really sure we don't access non-existing vCPUs

2016-07-12 Thread Peter Krempa
On Tue, Jul 12, 2016 at 17:54:03 +0200, Martin Kletzander wrote: > On Tue, Jul 12, 2016 at 03:01:57PM +0200, Peter Krempa wrote: > >On Tue, Jul 12, 2016 at 13:44:10 +0200, Martin Kletzander wrote: [...] > >> I could've pushed this as a build breaker, but I'm not really sure > >> everyone will

Re: [libvirt] [PATCH] Make really sure we don't access non-existing vCPUs

2016-07-12 Thread Martin Kletzander
On Tue, Jul 12, 2016 at 03:01:57PM +0200, Peter Krempa wrote: On Tue, Jul 12, 2016 at 13:44:10 +0200, Martin Kletzander wrote: MinGW complained that we might be dereferencing a NULL pointer. While ^^ Does anybody use that? Well, if nobody uses that, feel free to send a patch removing all

Re: [libvirt] [PATCH] Make really sure we don't access non-existing vCPUs

2016-07-12 Thread Peter Krempa
On Tue, Jul 12, 2016 at 13:44:10 +0200, Martin Kletzander wrote: > MinGW complained that we might be dereferencing a NULL pointer. While ^^ Does anybody use that? > that's most probably not going to be true (now), the logic certainly > allows for that and we might actually do this a lot in the

[libvirt] [PATCH] Make really sure we don't access non-existing vCPUs

2016-07-12 Thread Martin Kletzander
MinGW complained that we might be dereferencing a NULL pointer. While that's most probably not going to be true (now), the logic certainly allows for that and we might actually do this a lot in the future with sparse vcpu mapping. ../../src/conf/domain_conf.c: In function