qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] balloon: Fix device name in error message.
@ 2014-02-23 14:05 Hani Benhabiles
  2014-02-24  9:04 ` Markus Armbruster
  0 siblings, 1 reply; 3+ messages in thread
From: Hani Benhabiles @ 2014-02-23 14:05 UTC (permalink / raw)
  To: qemu-devel; +Cc: qemu-trivial

Also fix trailing whitespace.

Signed-off-by: Hani Benhabiles <hani@linux.com>
---
 balloon.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/balloon.c b/balloon.c
index e321f2c..b66710a 100644
--- a/balloon.c
+++ b/balloon.c
@@ -125,8 +125,8 @@ void qmp_balloon(int64_t value, Error **errp)
         error_set(errp, QERR_INVALID_PARAMETER_VALUE, "target", "a size");
         return;
     }
-    
+
     if (qemu_balloon(value) == 0) {
-        error_set(errp, QERR_DEVICE_NOT_ACTIVE, "balloon");
+        error_set(errp, QERR_DEVICE_NOT_ACTIVE, "virtio-balloon-pci");
     }
 }
-- 
1.8.3.2

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [Qemu-devel] [PATCH] balloon: Fix device name in error message.
  2014-02-23 14:05 [Qemu-devel] [PATCH] balloon: Fix device name in error message Hani Benhabiles
@ 2014-02-24  9:04 ` Markus Armbruster
  2014-02-24 18:59   ` Hani Benhabiles
  0 siblings, 1 reply; 3+ messages in thread
From: Markus Armbruster @ 2014-02-24  9:04 UTC (permalink / raw)
  To: Hani Benhabiles; +Cc: qemu-trivial, qemu-devel, Luiz Capitulino

Hani Benhabiles <kroosec@gmail.com> writes:

> Also fix trailing whitespace.
>
> Signed-off-by: Hani Benhabiles <hani@linux.com>
> ---
>  balloon.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/balloon.c b/balloon.c
> index e321f2c..b66710a 100644
> --- a/balloon.c
> +++ b/balloon.c
> @@ -125,8 +125,8 @@ void qmp_balloon(int64_t value, Error **errp)
>          error_set(errp, QERR_INVALID_PARAMETER_VALUE, "target", "a size");
>          return;
>      }
> -    
> +
>      if (qemu_balloon(value) == 0) {
> -        error_set(errp, QERR_DEVICE_NOT_ACTIVE, "balloon");
> +        error_set(errp, QERR_DEVICE_NOT_ACTIVE, "virtio-balloon-pci");
>      }
>  }

I agree the error message is bad, but I'm afraid your patch makes it
worse :)

qemu_balloon() returns zero when balloon_event_fn has not been set with
qemu_add_balloon_handler().

Right now, the only device that calls qemu_add_balloon_handler() is
virtio-balloon-device.  In theory, there could be others in the future.

virtio-balloon-device is a virtio-bus device.  The bus can be provided
by virtio-balloon-pci or virtio-balloon-ccw.

Your error message is misleading when it's provided by the latter.

Moreover, you missed qmp_query_balloon().

QERR_DEVICE_NOT_ACTIVE is also used with argument "spice", and the
resulting error message is similarly bad.  Perhaps something like this
would do:

#define QERR_DEVICE_NOT_ACTIVE \
    ERROR_CLASS_DEVICE_NOT_ACTIVE, "No %s device has been activated"

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Qemu-devel] [PATCH] balloon: Fix device name in error message.
  2014-02-24  9:04 ` Markus Armbruster
@ 2014-02-24 18:59   ` Hani Benhabiles
  0 siblings, 0 replies; 3+ messages in thread
From: Hani Benhabiles @ 2014-02-24 18:59 UTC (permalink / raw)
  To: Markus Armbruster; +Cc: qemu-trivial, qemu-devel, Luiz Capitulino

On Mon, Feb 24, 2014 at 10:04:05AM +0100, Markus Armbruster wrote:
> I agree the error message is bad, but I'm afraid your patch makes it
> worse :)
> 
> qemu_balloon() returns zero when balloon_event_fn has not been set with
> qemu_add_balloon_handler().
> 
> Right now, the only device that calls qemu_add_balloon_handler() is
> virtio-balloon-device.  In theory, there could be others in the future.
> 
> virtio-balloon-device is a virtio-bus device.  The bus can be provided
> by virtio-balloon-pci or virtio-balloon-ccw.
> 
> Your error message is misleading when it's provided by the latter.
> 

I see. Sorry for not throughly understanding the whole chain yet!

I somehow missed virtio-balloon-ccw, thus my false belief that
virtio-balloon-pci would be the only one to be ever needed/used.

> Moreover, you missed qmp_query_balloon().
> 
> QERR_DEVICE_NOT_ACTIVE is also used with argument "spice", and the
> resulting error message is similarly bad.  Perhaps something like this
> would do:
> 
> #define QERR_DEVICE_NOT_ACTIVE \
>     ERROR_CLASS_DEVICE_NOT_ACTIVE, "No %s device has been activated"

Sounds good to me. Will send a patch shortly.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2014-02-24 18:59 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-02-23 14:05 [Qemu-devel] [PATCH] balloon: Fix device name in error message Hani Benhabiles
2014-02-24  9:04 ` Markus Armbruster
2014-02-24 18:59   ` Hani Benhabiles

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).