[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Xen-devel] [Qemu-devel] [PATCH 2/4] qdev: Introduce qdev_force_unplug.
On Tue, May 15, 2012 at 7:15 PM, Stefano Stabellini <stefano.stabellini@xxxxxxxxxxxxx> wrote: > 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 <anthony.perard@xxxxxxxxxx> >> --- >> Â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 Why? unplug is not used before to be set. But I can do that for the next version if there is one. -- Anthony PERARD _______________________________________________ Xen-devel mailing list Xen-devel@xxxxxxxxxxxxx http://lists.xen.org/xen-devel
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |