Re: [PATCH] fix 1 << -1 at JOB_MASK macro

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sat, Jul 15, 2017 at 14:42:39 +0800, xinhua.Cao wrote:
> From: caoxinhua <caoxinhua@xxxxxxxxxx>
> 
> 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?

Attachment: signature.asc
Description: PGP signature

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

[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]
  Powered by Linux