[libvirt] [PATCH 6/7] virsh: use logical or for boolean values

Ján Tomko posted 7 patches 7 years, 2 months ago
Only 6 patches received!
[libvirt] [PATCH 6/7] virsh: use logical or for boolean values
Posted by Ján Tomko 7 years, 2 months ago
Bitwise or just looks wrong here.
Introduced by <commit 69e0cd3>.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
---
 tools/virsh-domain.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/virsh-domain.c b/tools/virsh-domain.c
index 29bc8e6db..c78cf7f21 100644
--- a/tools/virsh-domain.c
+++ b/tools/virsh-domain.c
@@ -7213,7 +7213,7 @@ cmdGuestvcpus(vshControl *ctl, const vshCmd *cmd)
     if (vshCommandOptStringReq(ctl, cmd, "cpulist", &cpulist))
         return false;
 
-    if (cpulist && !(enable | disable)) {
+    if (cpulist && !(enable || disable)) {
         vshError(ctl, _("One of options --enable or --disable is required by "
                         "option --cpulist"));
         return false;
-- 
2.16.1

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH 6/7] virsh: use logical or for boolean values
Posted by Peter Krempa 7 years, 2 months ago
On Tue, Mar 06, 2018 at 15:01:38 +0100, Ján Tomko wrote:
> Bitwise or just looks wrong here.
> Introduced by <commit 69e0cd3>.
> 
> Signed-off-by: Ján Tomko <jtomko@redhat.com>
> ---

But works correctly.

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