qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] virtio-serial: Unplug port if guest reports failure in adding it
@ 2010-08-31  8:22 Amit Shah
  2010-09-01 10:00 ` [Qemu-devel] " Amit Shah
  0 siblings, 1 reply; 2+ messages in thread
From: Amit Shah @ 2010-08-31  8:22 UTC (permalink / raw)
  To: qemu list; +Cc: Amit Shah, Juan Quintela

If a guest reports failure in adding a port, we shouldn't keep it lying
around.

Signed-off-by: Amit Shah <amit.shah@redhat.com>
---
 hw/virtio-serial-bus.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/hw/virtio-serial-bus.c b/hw/virtio-serial-bus.c
index 74ba5ec..86c2364 100644
--- a/hw/virtio-serial-bus.c
+++ b/hw/virtio-serial-bus.c
@@ -303,6 +303,7 @@ static void handle_control_message(VirtIOSerial *vser, void *buf, size_t len)
         if (!cpkt.value) {
             error_report("virtio-serial-bus: Guest failure in adding port %u for device %s\n",
                          port->id, vser->bus->qbus.name);
+            qdev_unplug(&port->dev);
             break;
         }
         /*
-- 
1.7.2.2

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

* [Qemu-devel] Re: [PATCH] virtio-serial: Unplug port if guest reports failure in adding it
  2010-08-31  8:22 [Qemu-devel] [PATCH] virtio-serial: Unplug port if guest reports failure in adding it Amit Shah
@ 2010-09-01 10:00 ` Amit Shah
  0 siblings, 0 replies; 2+ messages in thread
From: Amit Shah @ 2010-09-01 10:00 UTC (permalink / raw)
  To: qemu list; +Cc: Juan Quintela

On (Tue) Aug 31 2010 [13:52:22], Amit Shah wrote:
> If a guest reports failure in adding a port, we shouldn't keep it lying
> around.
> 
> Signed-off-by: Amit Shah <amit.shah@redhat.com>
> ---
>  hw/virtio-serial-bus.c |    1 +
>  1 files changed, 1 insertions(+), 0 deletions(-)
> 
> diff --git a/hw/virtio-serial-bus.c b/hw/virtio-serial-bus.c
> index 74ba5ec..86c2364 100644
> --- a/hw/virtio-serial-bus.c
> +++ b/hw/virtio-serial-bus.c
> @@ -303,6 +303,7 @@ static void handle_control_message(VirtIOSerial *vser, void *buf, size_t len)
>          if (!cpkt.value) {
>              error_report("virtio-serial-bus: Guest failure in adding port %u for device %s\n",
>                           port->id, vser->bus->qbus.name);
> +            qdev_unplug(&port->dev);
>              break;
>          }
>          /*

OK, ignore this patch.

My original thinking was that if the device got added successfully in
qemu and failed to be added by the guest (can happen for a variety of
reasons), we should keep the device lying around and tell the user about
it. If the user doesn't want the device any more, it can be unplugged.

I briefly thought that shouldn't be the case: if a guest can't use a
device, it's no good to let it lie around in qemu.

Just had a brief chat with Dan and he supported the original idea, so
we'll let the device exist in qemu and let libvirt / the user yank it
away if that's needed.

(Of course, users of the device itself should check if the guest
addition was successful by using virtio_serial_guest_ready(port))

		Amit

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

end of thread, other threads:[~2010-09-01 10:01 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-08-31  8:22 [Qemu-devel] [PATCH] virtio-serial: Unplug port if guest reports failure in adding it Amit Shah
2010-09-01 10:00 ` [Qemu-devel] " Amit Shah

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