qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] spapr_rng: disable hotpluggability
@ 2016-02-25 11:08 Greg Kurz
  2016-02-25 11:27 ` Thomas Huth
  0 siblings, 1 reply; 3+ messages in thread
From: Greg Kurz @ 2016-02-25 11:08 UTC (permalink / raw)
  To: David Gibson; +Cc: Thomas Huth, qemu-ppc, qemu-devel

It is currently possible to hotplug a spapr_rng device but QEMU crashes
when we try to hot unplug:

ERROR:hw/core/qdev.c:295:qdev_unplug: assertion failed: (hotplug_ctrl)
Aborted

This happens because spapr_rng isn't plugged to any bus and sPAPR does
not provide hotplug support for it: qdev_get_hotplug_handler() hence
return NULL and we hit the assertion.

And anyway, it doesn't make much sense to unplug this device since hcalls
cannot be unregistered. Even the idea of hotplugging a RNG device instead
of declaring it on the QEMU command line looks weird.

This patch simply disables hotpluggability for the spapr-rng class.

Signed-off-by: Greg Kurz <gkurz@linux.vnet.ibm.com>
---
 hw/ppc/spapr_rng.c |    1 +
 1 file changed, 1 insertion(+)

diff --git a/hw/ppc/spapr_rng.c b/hw/ppc/spapr_rng.c
index 8484fcf54774..a39d472b66fd 100644
--- a/hw/ppc/spapr_rng.c
+++ b/hw/ppc/spapr_rng.c
@@ -170,6 +170,7 @@ static void spapr_rng_class_init(ObjectClass *oc, void *data)
     dc->realize = spapr_rng_realize;
     set_bit(DEVICE_CATEGORY_MISC, dc->categories);
     dc->props = spapr_rng_properties;
+    dc->hotpluggable = false;
 }
 
 static const TypeInfo spapr_rng_info = {

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

* Re: [Qemu-devel] [PATCH] spapr_rng: disable hotpluggability
  2016-02-25 11:08 [Qemu-devel] [PATCH] spapr_rng: disable hotpluggability Greg Kurz
@ 2016-02-25 11:27 ` Thomas Huth
  2016-02-25 11:49   ` David Gibson
  0 siblings, 1 reply; 3+ messages in thread
From: Thomas Huth @ 2016-02-25 11:27 UTC (permalink / raw)
  To: Greg Kurz, David Gibson; +Cc: qemu-ppc, qemu-devel

On 25.02.2016 12:08, Greg Kurz wrote:
> It is currently possible to hotplug a spapr_rng device but QEMU crashes
> when we try to hot unplug:
> 
> ERROR:hw/core/qdev.c:295:qdev_unplug: assertion failed: (hotplug_ctrl)
> Aborted
> 
> This happens because spapr_rng isn't plugged to any bus and sPAPR does
> not provide hotplug support for it: qdev_get_hotplug_handler() hence
> return NULL and we hit the assertion.
> 
> And anyway, it doesn't make much sense to unplug this device since hcalls
> cannot be unregistered. Even the idea of hotplugging a RNG device instead
> of declaring it on the QEMU command line looks weird.
> 
> This patch simply disables hotpluggability for the spapr-rng class.
> 
> Signed-off-by: Greg Kurz <gkurz@linux.vnet.ibm.com>
> ---
>  hw/ppc/spapr_rng.c |    1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/hw/ppc/spapr_rng.c b/hw/ppc/spapr_rng.c
> index 8484fcf54774..a39d472b66fd 100644
> --- a/hw/ppc/spapr_rng.c
> +++ b/hw/ppc/spapr_rng.c
> @@ -170,6 +170,7 @@ static void spapr_rng_class_init(ObjectClass *oc, void *data)
>      dc->realize = spapr_rng_realize;
>      set_bit(DEVICE_CATEGORY_MISC, dc->categories);
>      dc->props = spapr_rng_properties;
> +    dc->hotpluggable = false;
>  }

That makes sense!

Reviewed-by: Thomas Huth <thuth@redhat.com>

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

* Re: [Qemu-devel] [PATCH] spapr_rng: disable hotpluggability
  2016-02-25 11:27 ` Thomas Huth
@ 2016-02-25 11:49   ` David Gibson
  0 siblings, 0 replies; 3+ messages in thread
From: David Gibson @ 2016-02-25 11:49 UTC (permalink / raw)
  To: Thomas Huth; +Cc: qemu-ppc, qemu-devel, Greg Kurz

[-- Attachment #1: Type: text/plain, Size: 1710 bytes --]

On Thu, Feb 25, 2016 at 12:27:48PM +0100, Thomas Huth wrote:
> On 25.02.2016 12:08, Greg Kurz wrote:
> > It is currently possible to hotplug a spapr_rng device but QEMU crashes
> > when we try to hot unplug:
> > 
> > ERROR:hw/core/qdev.c:295:qdev_unplug: assertion failed: (hotplug_ctrl)
> > Aborted
> > 
> > This happens because spapr_rng isn't plugged to any bus and sPAPR does
> > not provide hotplug support for it: qdev_get_hotplug_handler() hence
> > return NULL and we hit the assertion.
> > 
> > And anyway, it doesn't make much sense to unplug this device since hcalls
> > cannot be unregistered. Even the idea of hotplugging a RNG device instead
> > of declaring it on the QEMU command line looks weird.
> > 
> > This patch simply disables hotpluggability for the spapr-rng class.
> > 
> > Signed-off-by: Greg Kurz <gkurz@linux.vnet.ibm.com>
> > ---
> >  hw/ppc/spapr_rng.c |    1 +
> >  1 file changed, 1 insertion(+)
> > 
> > diff --git a/hw/ppc/spapr_rng.c b/hw/ppc/spapr_rng.c
> > index 8484fcf54774..a39d472b66fd 100644
> > --- a/hw/ppc/spapr_rng.c
> > +++ b/hw/ppc/spapr_rng.c
> > @@ -170,6 +170,7 @@ static void spapr_rng_class_init(ObjectClass *oc, void *data)
> >      dc->realize = spapr_rng_realize;
> >      set_bit(DEVICE_CATEGORY_MISC, dc->categories);
> >      dc->props = spapr_rng_properties;
> > +    dc->hotpluggable = false;
> >  }
> 
> That makes sense!
> 
> Reviewed-by: Thomas Huth <thuth@redhat.com>

Indeed.  Merged to ppc-for-2.6, thanks.

-- 
David Gibson			| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you.  NOT _the_ _other_
				| _way_ _around_!
http://www.ozlabs.org/~dgibson

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

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

end of thread, other threads:[~2016-02-25 11:48 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-02-25 11:08 [Qemu-devel] [PATCH] spapr_rng: disable hotpluggability Greg Kurz
2016-02-25 11:27 ` Thomas Huth
2016-02-25 11:49   ` David Gibson

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