* [Qemu-devel] [PATCH] balloon: improve error msg when adding second device
@ 2015-03-31 17:32 Luiz Capitulino
2015-03-31 18:20 ` Eric Blake
2015-04-25 6:12 ` Michael Tokarev
0 siblings, 2 replies; 4+ messages in thread
From: Luiz Capitulino @ 2015-03-31 17:32 UTC (permalink / raw)
To: qemu-devel; +Cc: qemu-trivial, armbru
A VM supports only one balloon device, but due to several changes
in infrastructure the error message got messed up when trying
to add a second device. Fix it.
Before this fix
Command-line:
qemu-qmp: -device virtio-balloon-pci,id=balloon0: Another balloon device already registered
qemu-qmp: -device virtio-balloon-pci,id=balloon0: Adding balloon handler failed
qemu-qmp: -device virtio-balloon-pci,id=balloon0: Device 'virtio-balloon-pci' could not be initialized
HMP:
Another balloon device already registered
Adding balloon handler failed
Device 'virtio-balloon-pci' could not be initialized
QMP:
{ "execute": "device_add", "arguments": { "driver": "virtio-balloon-pci", "id": "balloon0" } }
{
"error": {
"class": "GenericError",
"desc": "Adding balloon handler failed"
}
}
After this fix
Command-line:
qemu-qmp: -device virtio-balloon-pci,id=balloon0: Only one balloon device is supported
qemu-qmp: -device virtio-balloon-pci,id=balloon0: Device 'virtio-balloon-pci' could not be initialized
HMP:
(qemu) device_add virtio-balloon-pci,id=balloon0
Only one balloon device is supported
Device 'virtio-balloon-pci' could not be initialized
(qemu)
QMP:
{ "execute": "device_add",
"arguments": { "driver": "virtio-balloon-pci", "id": "balloon0" } }
{
"error": {
"class": "GenericError",
"desc": "Only one balloon device is supported"
}
}
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
---
I think this can go through in via -trivial. I also think this
is so simple and useful that it could be merged during freeze.
balloon.c | 1 -
hw/virtio/virtio-balloon.c | 2 +-
2 files changed, 1 insertion(+), 2 deletions(-)
diff --git a/balloon.c b/balloon.c
index 70c00f5..c7033e3 100644
--- a/balloon.c
+++ b/balloon.c
@@ -58,7 +58,6 @@ int qemu_add_balloon_handler(QEMUBalloonEvent *event_func,
/* We're already registered one balloon handler. How many can
* a guest really have?
*/
- error_report("Another balloon device already registered");
return -1;
}
balloon_event_fn = event_func;
diff --git a/hw/virtio/virtio-balloon.c b/hw/virtio/virtio-balloon.c
index 95b0643..484c3c3 100644
--- a/hw/virtio/virtio-balloon.c
+++ b/hw/virtio/virtio-balloon.c
@@ -383,7 +383,7 @@ static void virtio_balloon_device_realize(DeviceState *dev, Error **errp)
virtio_balloon_stat, s);
if (ret < 0) {
- error_setg(errp, "Adding balloon handler failed");
+ error_setg(errp, "Only one balloon device is supported");
virtio_cleanup(vdev);
return;
}
--
1.9.3
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [Qemu-devel] [PATCH] balloon: improve error msg when adding second device
2015-03-31 17:32 [Qemu-devel] [PATCH] balloon: improve error msg when adding second device Luiz Capitulino
@ 2015-03-31 18:20 ` Eric Blake
2015-04-25 6:12 ` Michael Tokarev
1 sibling, 0 replies; 4+ messages in thread
From: Eric Blake @ 2015-03-31 18:20 UTC (permalink / raw)
To: Luiz Capitulino, qemu-devel; +Cc: qemu-trivial, armbru
[-- Attachment #1: Type: text/plain, Size: 794 bytes --]
On 03/31/2015 11:32 AM, Luiz Capitulino wrote:
> A VM supports only one balloon device, but due to several changes
> in infrastructure the error message got messed up when trying
> to add a second device. Fix it.
>
> Before this fix
>
> After this fix
[nice comparison snipped]
>
> Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
> ---
>
> I think this can go through in via -trivial. I also think this
> is so simple and useful that it could be merged during freeze.
>
> balloon.c | 1 -
> hw/virtio/virtio-balloon.c | 2 +-
> 2 files changed, 1 insertion(+), 2 deletions(-)
>
Reviewed-by: Eric Blake <eblake@redhat.com>
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library http://libvirt.org
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 604 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [Qemu-devel] [PATCH] balloon: improve error msg when adding second device
2015-03-31 17:32 [Qemu-devel] [PATCH] balloon: improve error msg when adding second device Luiz Capitulino
2015-03-31 18:20 ` Eric Blake
@ 2015-04-25 6:12 ` Michael Tokarev
2015-04-25 14:30 ` Luiz Capitulino
1 sibling, 1 reply; 4+ messages in thread
From: Michael Tokarev @ 2015-04-25 6:12 UTC (permalink / raw)
To: Luiz Capitulino, qemu-devel; +Cc: qemu-trivial, armbru
31.03.2015 20:32, Luiz Capitulino wrote:
> A VM supports only one balloon device, but due to several changes
> in infrastructure the error message got messed up when trying
> to add a second device. Fix it.
...
Heh. Such a huge commit message ;)
Applied to -trivial now. In the large commit text I missed your
comment about the patch is okay to go during the freeze, so doing
it after :)
Thanks,
/mjt
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [Qemu-devel] [PATCH] balloon: improve error msg when adding second device
2015-04-25 6:12 ` Michael Tokarev
@ 2015-04-25 14:30 ` Luiz Capitulino
0 siblings, 0 replies; 4+ messages in thread
From: Luiz Capitulino @ 2015-04-25 14:30 UTC (permalink / raw)
To: Michael Tokarev; +Cc: qemu-trivial, qemu-devel, armbru
On Sat, 25 Apr 2015 09:12:58 +0300
Michael Tokarev <mjt@tls.msk.ru> wrote:
> 31.03.2015 20:32, Luiz Capitulino wrote:
> > A VM supports only one balloon device, but due to several changes
> > in infrastructure the error message got messed up when trying
> > to add a second device. Fix it.
> ...
> Heh. Such a huge commit message ;)
>
> Applied to -trivial now. In the large commit text I missed your
> comment about the patch is okay to go during the freeze, so doing
> it after :)
I've applied it to my own tree and posted a pull request already.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2015-04-25 14:30 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-03-31 17:32 [Qemu-devel] [PATCH] balloon: improve error msg when adding second device Luiz Capitulino
2015-03-31 18:20 ` Eric Blake
2015-04-25 6:12 ` Michael Tokarev
2015-04-25 14:30 ` Luiz Capitulino
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).