[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 2/4] qdev: Introduce qdev_force_unplug.
From: |
Stefano Stabellini |
Subject: |
Re: [Qemu-devel] [PATCH 2/4] qdev: Introduce qdev_force_unplug. |
Date: |
Tue, 15 May 2012 19:15:16 +0100 |
User-agent: |
Alpine 2.00 (DEB 1167 2008-08-23) |
On Tue, 15 May 2012, Anthony PERARD wrote:
> This function will be use to force a device to be ejected without the guest
> cooperation.
>
> Signed-off-by: Anthony PERARD <address@hidden>
> ---
> hw/qdev.c | 23 ++++++++++++++++++++---
> hw/qdev.h | 3 +++
> 2 files changed, 23 insertions(+), 3 deletions(-)
>
> diff --git a/hw/qdev.c b/hw/qdev.c
> index 6a8f6bd..c95d4c2 100644
> --- a/hw/qdev.c
> +++ b/hw/qdev.c
> @@ -184,24 +184,41 @@ void qdev_set_legacy_instance_id(DeviceState *dev, int
> alias_id,
> dev->alias_required_for_version = required_for_version;
> }
>
> -void qdev_unplug(DeviceState *dev, Error **errp)
> +static void qdev_unplug_common(DeviceState *dev, Error **errp, bool force)
> {
> DeviceClass *dc = DEVICE_GET_CLASS(dev);
> + qdev_event unplug;
>
> if (!dev->parent_bus->allow_hotplug) {
> error_set(errp, QERR_BUS_NO_HOTPLUG, dev->parent_bus->name);
> return;
> }
> - assert(dc->unplug != NULL);
> +
> + if (force) {
> + unplug = dc->force_unplug;
> + } else {
> + unplug = dc->unplug;
> + }
> + assert(unplug != NULL);
unplug needs to be initialized to NULL above
- [Qemu-devel] [PATCH 1.1 0/4] Xen: Fix PV-on-HVM, Anthony PERARD, 2012/05/15
- [Qemu-devel] [PATCH 2/4] qdev: Introduce qdev_force_unplug., Anthony PERARD, 2012/05/15
- Re: [Qemu-devel] [PATCH 2/4] qdev: Introduce qdev_force_unplug.,
Stefano Stabellini <=
- [Qemu-devel] [PATCH 4/4] xen: Fix PV-on-HVM, Anthony PERARD, 2012/05/15
- Re: [Qemu-devel] [PATCH 4/4] xen: Fix PV-on-HVM, Michael S. Tsirkin, 2012/05/15
- Re: [Qemu-devel] [PATCH 4/4] xen: Fix PV-on-HVM, Paolo Bonzini, 2012/05/16
- Re: [Qemu-devel] [PATCH 4/4] xen: Fix PV-on-HVM, Michael S. Tsirkin, 2012/05/16
- Re: [Qemu-devel] [PATCH 4/4] xen: Fix PV-on-HVM, Paolo Bonzini, 2012/05/16
- Re: [Qemu-devel] [PATCH 4/4] xen: Fix PV-on-HVM, Stefano Stabellini, 2012/05/16
- Re: [Qemu-devel] [PATCH 4/4] xen: Fix PV-on-HVM, Michael S. Tsirkin, 2012/05/16
- Re: [Qemu-devel] [PATCH 4/4] xen: Fix PV-on-HVM, Stefano Stabellini, 2012/05/16
- Re: [Qemu-devel] [PATCH 4/4] xen: Fix PV-on-HVM, Michael S. Tsirkin, 2012/05/16