Re: [Qemu-devel] [PATCH 1/4] Introduce a new hotplug state: Force eject.

2012-05-16 Thread Michael S. Tsirkin
On Wed, May 16, 2012 at 05:52:17PM +0200, Paolo Bonzini wrote: > Il 16/05/2012 15:20, Michael S. Tsirkin ha scritto: > >>> Because it's missing the object_unparent done by qdev_unplug. Does > >>> object_unparent+qdev_free work? (I believe object_unparent should be > >>> done by qdev_free rather t

Re: [Qemu-devel] [PATCH 1/4] Introduce a new hotplug state: Force eject.

2012-05-16 Thread Michael S. Tsirkin
On Wed, May 16, 2012 at 11:02:30AM -0500, Anthony Liguori wrote: > On 05/16/2012 06:23 AM, Paolo Bonzini wrote: > >Il 16/05/2012 13:15, Anthony PERARD ha scritto: > qdev_unplug(&(d->qdev), NULL); > +qdev_free(&(d->qdev)); > } > } > > > Anthony,

Re: [Qemu-devel] [PATCH 1/4] Introduce a new hotplug state: Force eject.

2012-05-16 Thread Anthony Liguori
On 05/16/2012 06:23 AM, Paolo Bonzini wrote: Il 16/05/2012 13:15, Anthony PERARD ha scritto: qdev_unplug(&(d->qdev), NULL); +qdev_free(&(d->qdev)); } } Anthony, can you confirm that this solves the problem for you? This work until I try to hotplug a new device to the g

Re: [Qemu-devel] [PATCH 1/4] Introduce a new hotplug state: Force eject.

2012-05-16 Thread Paolo Bonzini
Il 16/05/2012 15:20, Michael S. Tsirkin ha scritto: >>> Because it's missing the object_unparent done by qdev_unplug. Does >>> object_unparent+qdev_free work? (I believe object_unparent should be >>> done by qdev_free rather than qdev_unplug, but that's something for 1.2). >> >> Cool, this seems

Re: [Qemu-devel] [PATCH 1/4] Introduce a new hotplug state: Force eject.

2012-05-16 Thread Michael S. Tsirkin
On Wed, May 16, 2012 at 12:37:54PM +0100, Anthony PERARD wrote: > On Wed, May 16, 2012 at 12:23 PM, Paolo Bonzini wrote: > > Il 16/05/2012 13:15, Anthony PERARD ha scritto: > >>> >         qdev_unplug(&(d->qdev), NULL); > >>> > +        qdev_free(&(d->qdev)); > >>> >     } > >>> >  } > >>> > > >>>

Re: [Qemu-devel] [PATCH 1/4] Introduce a new hotplug state: Force eject.

2012-05-16 Thread Anthony PERARD
On Wed, May 16, 2012 at 12:23 PM, Paolo Bonzini wrote: > Il 16/05/2012 13:15, Anthony PERARD ha scritto: >>> >         qdev_unplug(&(d->qdev), NULL); >>> > +        qdev_free(&(d->qdev)); >>> >     } >>> >  } >>> > >>> > >>> > Anthony, can you confirm that this solves the problem for you? >> This

Re: [Qemu-devel] [PATCH 1/4] Introduce a new hotplug state: Force eject.

2012-05-16 Thread Paolo Bonzini
Il 16/05/2012 13:15, Anthony PERARD ha scritto: >> > qdev_unplug(&(d->qdev), NULL); >> > +qdev_free(&(d->qdev)); >> > } >> > } >> > >> > >> > Anthony, can you confirm that this solves the problem for you? > This work until I try to hotplug a new device to the guest at wish > po

Re: [Qemu-devel] [PATCH 1/4] Introduce a new hotplug state: Force eject.

2012-05-16 Thread Anthony PERARD
On Wed, May 16, 2012 at 11:32 AM, Stefano Stabellini wrote: > On Tue, 15 May 2012, Michael S. Tsirkin wrote: >> On Tue, May 15, 2012 at 04:26:36PM +0100, Anthony PERARD wrote: >> > This hotplug state will be used to remove a device without the guest >> > cooperation. >> > >> > Signed-off-by: Antho

Re: [Qemu-devel] [PATCH 1/4] Introduce a new hotplug state: Force eject.

2012-05-16 Thread Stefano Stabellini
On Tue, 15 May 2012, Michael S. Tsirkin wrote: > On Tue, May 15, 2012 at 04:26:36PM +0100, Anthony PERARD wrote: > > This hotplug state will be used to remove a device without the guest > > cooperation. > > > > Signed-off-by: Anthony PERARD > > This can crash guest, can't it? If you are fine wit

Re: [Qemu-devel] [PATCH 1/4] Introduce a new hotplug state: Force eject.

2012-05-15 Thread Michael S. Tsirkin
On Tue, May 15, 2012 at 04:26:36PM +0100, Anthony PERARD wrote: > This hotplug state will be used to remove a device without the guest > cooperation. > > Signed-off-by: Anthony PERARD This can crash guest, can't it? If you are fine with crashing guest, we already let you do this: - delete device

Re: [Qemu-devel] [PATCH 1/4] Introduce a new hotplug state: Force eject.

2012-05-15 Thread Anthony PERARD
On Tue, May 15, 2012 at 7:19 PM, Stefano Stabellini wrote: > > Given that it is supposed to be a state rather than an action, it should > be called PCI_FORCE_DISABLED or something like that. Ok, I will change to that. Thanks, -- Anthony PERARD

Re: [Qemu-devel] [PATCH 1/4] Introduce a new hotplug state: Force eject.

2012-05-15 Thread Stefano Stabellini
On Tue, 15 May 2012, Anthony PERARD wrote: > This hotplug state will be used to remove a device without the guest > cooperation. > > Signed-off-by: Anthony PERARD > --- > hw/acpi_piix4.c |5 + > hw/pci.h|1 + > 2 files changed, 6 insertions(+), 0 deletions(-) > > diff --git

[Qemu-devel] [PATCH 1/4] Introduce a new hotplug state: Force eject.

2012-05-15 Thread Anthony PERARD
This hotplug state will be used to remove a device without the guest cooperation. Signed-off-by: Anthony PERARD --- hw/acpi_piix4.c |5 + hw/pci.h|1 + 2 files changed, 6 insertions(+), 0 deletions(-) diff --git a/hw/acpi_piix4.c b/hw/acpi_piix4.c index 585da4e..dfd5a9d 1006