qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] Re: [PATCH] virtio-serial: Unplug port if guest reports fai


From: Amit Shah
Subject: [Qemu-devel] Re: [PATCH] virtio-serial: Unplug port if guest reports failure in adding it
Date: Wed, 1 Sep 2010 15:30:58 +0530
User-agent: Mutt/1.5.20 (2009-12-10)

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 <address@hidden>
> ---
>  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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]