mirror of
https://github.com/libvirt/libvirt.git
synced 2025-02-25 18:55:26 -06:00
conf: Fix build with picky GCC
../../src/conf/domain_conf.c:4425:21: error: potential null pointer dereference [-Werror=null-dereference]
switch (vcpu->hotpluggable) {
~~~~^~~~~~~~~~~~~~
This commit is contained in:
@@ -4422,6 +4422,10 @@ virDomainVcpuDefPostParse(virDomainDefPtr def)
|
||||
for (i = 0; i < maxvcpus; i++) {
|
||||
vcpu = virDomainDefGetVcpu(def, i);
|
||||
|
||||
/* impossible but some compilers don't like it */
|
||||
if (!vcpu)
|
||||
continue;
|
||||
|
||||
switch (vcpu->hotpluggable) {
|
||||
case VIR_TRISTATE_BOOL_ABSENT:
|
||||
if (vcpu->online)
|
||||
|
||||
Reference in New Issue
Block a user