From nobody Mon Apr 29 07:08:11 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1500101363783673.5292466935227; Fri, 14 Jul 2017 23:49:23 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 301594E4C4; Sat, 15 Jul 2017 06:49:22 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 04AFE6FEFD; Sat, 15 Jul 2017 06:49:22 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 9F7841853E30; Sat, 15 Jul 2017 06:49:21 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id v6F6nJt1021875 for ; Sat, 15 Jul 2017 02:49:19 -0400 Received: by smtp.corp.redhat.com (Postfix) id 8EFEB64426; Sat, 15 Jul 2017 06:49:19 +0000 (UTC) Received: from mx1.redhat.com (ext-mx05.extmail.prod.ext.phx2.redhat.com [10.5.110.29]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 986B263F9F; Sat, 15 Jul 2017 06:49:17 +0000 (UTC) Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) (using TLSv1 with cipher RC4-SHA (112/128 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 519CC19D387; Sat, 15 Jul 2017 06:49:13 +0000 (UTC) Received: from 172.30.72.53 (EHLO DGGEML402-HUB.china.huawei.com) ([172.30.72.53]) by dggrg02-dlp.huawei.com (MOS 4.4.6-GA FastPath queued) with ESMTP id ARB39262; Sat, 15 Jul 2017 14:42:54 +0800 (CST) Received: from localhost (10.177.25.200) by DGGEML402-HUB.china.huawei.com (10.3.17.38) with Microsoft SMTP Server id 14.3.301.0; Sat, 15 Jul 2017 14:42:46 +0800 DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 301594E4C4 Authentication-Results: ext-mx09.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=huawei.com Authentication-Results: ext-mx09.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=libvir-list-bounces@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 301594E4C4 DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 519CC19D387 Authentication-Results: ext-mx05.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=huawei.com Authentication-Results: ext-mx05.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=caoxinhua@huawei.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 519CC19D387 From: "xinhua.Cao" To: , Date: Sat, 15 Jul 2017 14:42:39 +0800 Message-ID: <20170715064239.15204-1-caoxinhua@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.177.25.200] X-CFilter-Loop: Reflected X-Mirapoint-Virus-RAPID-Raw: score=unknown(0), refid=str=0001.0A020202.5969B96E.005C, ss=1, re=0.000, recu=0.000, reip=0.000, cl=1, cld=1, fgs=0, ip=0.0.0.0, so=2014-11-16 11:51:01, dmn=2013-03-21 17:37:32 X-Mirapoint-Loop-Id: 6d1505b16b2038509a880fc36c468be4 X-Greylist: Delayed for 00:06:12 by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Sat, 15 Jul 2017 06:49:16 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Sat, 15 Jul 2017 06:49:16 +0000 (UTC) for IP:'45.249.212.188' DOMAIN:'szxga02-in.huawei.com' HELO:'szxga02-in.huawei.com' FROM:'caoxinhua@huawei.com' RCPT:'' X-RedHat-Spam-Score: 0.398 (BAYES_50, DCC_REPUT_00_12, RP_MATCHES_RCVD, SPF_PASS) 45.249.212.188 szxga02-in.huawei.com 45.249.212.188 szxga02-in.huawei.com X-Scanned-By: MIMEDefang 2.78 on 10.5.110.29 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-loop: libvir-list@redhat.com Cc: caoxinhua , yanqiangjun@huawei.com, weidong.huang@huawei.com, weifuqiang@huawei.com Subject: [libvirt] [PATCH] fix 1 << -1 at JOB_MASK macro X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Sat, 15 Jul 2017 06:49:22 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" From: caoxinhua when we start a vm, we call JOB_MASK(QEMU_JOB_NONE), then 1 << -1 will be e= xecute. we fix it as return 0 --- src/libxl/libxl_domain.h | 2 +- src/qemu/qemu_domain.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/libxl/libxl_domain.h b/src/libxl/libxl_domain.h index 3a3890b..dc40139 100644 --- a/src/libxl/libxl_domain.h +++ b/src/libxl/libxl_domain.h @@ -30,7 +30,7 @@ # include "libxl_conf.h" # include "virchrdev.h" =20 -# define JOB_MASK(job) (1 << (job - 1)) +# define JOB_MASK(job) (job =3D=3D 0 ? 0 : 1 << (job - 1)) # define DEFAULT_JOB_MASK \ (JOB_MASK(LIBXL_JOB_DESTROY) | \ JOB_MASK(LIBXL_JOB_ABORT)) diff --git a/src/qemu/qemu_domain.h b/src/qemu/qemu_domain.h index 365b23c..6750215 100644 --- a/src/qemu/qemu_domain.h +++ b/src/qemu/qemu_domain.h @@ -51,7 +51,7 @@ # define QEMU_DOMAIN_MIG_BANDWIDTH_MAX (INT64_MAX / (1024 * 1024)) # endif =20 -# define JOB_MASK(job) (1 << (job - 1)) +# define JOB_MASK(job) (job =3D=3D 0 ? 0 : 1 << (job - 1)) # define QEMU_JOB_DEFAULT_MASK \ (JOB_MASK(QEMU_JOB_QUERY) | \ JOB_MASK(QEMU_JOB_DESTROY) | \ --=20 2.8.3 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list