* [PATCH v2] Fix parameter type in vhost migration log path
@ 2020-05-07 21:37 Raphael Norwitz
2020-05-07 22:00 ` Eric Blake
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Raphael Norwitz @ 2020-05-07 21:37 UTC (permalink / raw)
To: eblake, mst; +Cc: qemu-trivial, qemu-devel
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
^ permalink raw reply related [flat|nested] 4+ messages in thread* Re: [PATCH v2] Fix parameter type in vhost migration log path
2020-05-07 21:37 [PATCH v2] Fix parameter type in vhost migration log path Raphael Norwitz
@ 2020-05-07 22:00 ` Eric Blake
2020-05-07 22:01 ` Eric Blake
2020-06-09 16:38 ` Laurent Vivier
2 siblings, 0 replies; 4+ messages in thread
From: Eric Blake @ 2020-05-07 22:00 UTC (permalink / raw)
To: Raphael Norwitz, mst; +Cc: qemu-trivial, qemu-devel
On 5/7/20 4:37 PM, Raphael Norwitz wrote:
> 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(-)
>
Reviewed-by: Eric Blake <eblake@redhat.com>
> 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
>
--
Eric Blake, Principal Software Engineer
Red Hat, Inc. +1-919-301-3226
Virtualization: qemu.org | libvirt.org
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: [PATCH v2] Fix parameter type in vhost migration log path
2020-05-07 21:37 [PATCH v2] Fix parameter type in vhost migration log path Raphael Norwitz
2020-05-07 22:00 ` Eric Blake
@ 2020-05-07 22:01 ` Eric Blake
2020-06-09 16:38 ` Laurent Vivier
2 siblings, 0 replies; 4+ messages in thread
From: Eric Blake @ 2020-05-07 22:01 UTC (permalink / raw)
To: Raphael Norwitz, mst; +Cc: qemu-trivial, qemu-devel
On 5/7/20 4:37 PM, Raphael Norwitz wrote:
> The ‘enable’ parameter to the vhost_migraion_log() function is given as
typo: migration
Presumably, the maintainer can fix this rather than needing you to send
a v3...
> 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(-)
--
Eric Blake, Principal Software Engineer
Red Hat, Inc. +1-919-301-3226
Virtualization: qemu.org | libvirt.org
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH v2] Fix parameter type in vhost migration log path
2020-05-07 21:37 [PATCH v2] Fix parameter type in vhost migration log path Raphael Norwitz
2020-05-07 22:00 ` Eric Blake
2020-05-07 22:01 ` Eric Blake
@ 2020-06-09 16:38 ` Laurent Vivier
2 siblings, 0 replies; 4+ messages in thread
From: Laurent Vivier @ 2020-06-09 16:38 UTC (permalink / raw)
To: Raphael Norwitz, eblake, mst; +Cc: qemu-trivial, qemu-devel
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
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2020-06-09 16:43 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-05-07 21:37 [PATCH v2] Fix parameter type in vhost migration log path Raphael Norwitz
2020-05-07 22:00 ` Eric Blake
2020-05-07 22:01 ` Eric Blake
2020-06-09 16:38 ` Laurent Vivier
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).