[libvirt] [PATCH] fix 1 << -1 at JOB_MASK macro

Peter Krempa pkrempa at redhat.com
Mon Jul 17 10:15:19 UTC 2017


On Sat, Jul 15, 2017 at 14:42:39 +0800, xinhua.Cao wrote:
> From: caoxinhua <caoxinhua at huawei.com>
> 
> when we start a vm, we call JOB_MASK(QEMU_JOB_NONE), then 1 << -1 will be execute. 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(-)

[....]

> 
> 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
>  
> -# define JOB_MASK(job)                  (1 << (job - 1))
> +# define JOB_MASK(job)                  (job == 0 ? 0 : 1 << (job - 1))


This makes QEMU_JOB_NONE and QEMU_JOB_QUERY to have the same result.
I think you need to fix some other place.

What is the problem you are seeing?
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20170717/cc8edfcf/attachment-0001.sig>


More information about the libvir-list mailing list