]> xenbits.xensource.com Git - libvirt.git/commitdiff
cmdVcpuPin: Remove dead code
authorMichal Privoznik <mprivozn@redhat.com>
Tue, 14 Jul 2015 14:23:26 +0000 (16:23 +0200)
committerMichal Privoznik <mprivozn@redhat.com>
Wed, 15 Jul 2015 09:40:41 +0000 (11:40 +0200)
There's this condition:

flags & VIR_DOMAIN_AFFECT_CURRENT && virDomainIsActive(dom)

which can never be true since VIR_DOMAIN_AFFECT_CURRENT has hardcoded
value of zero. Therefore virDomainIsActive() is a dead code. However,
the condition could make sense if it is rewritten as the following:

!(flags & VIR_DOMAIN_AFFECT_CONFIG) && virDomainIsActive(dom)

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
tools/virsh-domain.c

index ac04dedfcb1b8e6c525446e4366227374b8a653b..f7edeebc710b2734cdc253cf452b2599095ac8b8 100644 (file)
@@ -6499,7 +6499,7 @@ cmdVcpuPin(vshControl *ctl, const vshCmd *cmd)
 
         if (got_vcpu && vcpu >= ncpus) {
             if (flags & VIR_DOMAIN_AFFECT_LIVE ||
-                (flags & VIR_DOMAIN_AFFECT_CURRENT &&
+                (!(flags & VIR_DOMAIN_AFFECT_CONFIG) &&
                  virDomainIsActive(dom) == 1))
                 vshError(ctl,
                          _("vcpu %d is out of range of live cpu count %d"),