提交 416d0e94 编写于 作者: M Michal Privoznik

cmdVcpuPin: Remove dead code

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: NMichal Privoznik <mprivozn@redhat.com>
上级 cd043390
......@@ -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"),
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册