[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v2] Fix parameter type in vhost migration log path
From: |
Laurent Vivier |
Subject: |
Re: [PATCH v2] Fix parameter type in vhost migration log path |
Date: |
Tue, 9 Jun 2020 18:38:00 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.8.0 |
Le 07/05/2020 à 23:37, Raphael Norwitz a écrit :
> The ‘enable’ parameter to the vhost_migraion_log() function is given as
> an int, but "true"/"false" values are passed in wherever it is invoked.
> Inside the function itself it is only ever compared with bool values.
> Therefore the parameter value itself should be changed to bool.
>
> Signed-off-by: Raphael Norwitz <raphael.norwitz@nutanix.com>
> ---
> hw/virtio/vhost.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/hw/virtio/vhost.c b/hw/virtio/vhost.c
> index aff98a0..aa06a36 100644
> --- a/hw/virtio/vhost.c
> +++ b/hw/virtio/vhost.c
> @@ -809,12 +809,12 @@ err_features:
> return r;
> }
>
> -static int vhost_migration_log(MemoryListener *listener, int enable)
> +static int vhost_migration_log(MemoryListener *listener, bool enable)
> {
> struct vhost_dev *dev = container_of(listener, struct vhost_dev,
> memory_listener);
> int r;
> - if (!!enable == dev->log_enabled) {
> + if (enable == dev->log_enabled) {
> return 0;
> }
> if (!dev->started) {
> --
> 1.8.3.1
>
Applied to my trivial-patches branch.
Thanks,
Laurent
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- Re: [PATCH v2] Fix parameter type in vhost migration log path,
Laurent Vivier <=