qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] hw/s390x: Mark the "sclpquiesce" device with user_creatable = false
@ 2017-10-05  8:45 Thomas Huth
  2017-10-05  9:00 ` Halil Pasic
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Thomas Huth @ 2017-10-05  8:45 UTC (permalink / raw)
  To: qemu-devel, Cornelia Huck, Christian Borntraeger
  Cc: David Hildenbrand, Claudio Imbrenda, Dong Jia Shi, Eric Farman,
	Farhan Ali, Fei Li, Halil Pasic, Janosch Frank, Jason J Herne,
	Jing Liu, Pierre Morel, QingFeng Hao, Xiao Feng Ren, Yang Chen,
	Yi Min Zhao

The "sclpquiesce" device is just an internal device that should not be
created by the user directly. Though it currently does not seem to cause
any obvious trouble when the user instantiates an additional device, let's
better mark it with user_creatable = false to avoid unexpected behavior,
e.g. because the quiesce notifier gets registered multiple times.

Signed-off-by: Thomas Huth <thuth@redhat.com>
---
 hw/s390x/sclpquiesce.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/hw/s390x/sclpquiesce.c b/hw/s390x/sclpquiesce.c
index 762cb18..0241643 100644
--- a/hw/s390x/sclpquiesce.c
+++ b/hw/s390x/sclpquiesce.c
@@ -118,8 +118,13 @@ static void quiesce_class_init(ObjectClass *klass, void *data)
     dc->reset = quiesce_reset;
     dc->vmsd = &vmstate_sclpquiesce;
     set_bit(DEVICE_CATEGORY_MISC, dc->categories);
-    k->init = quiesce_init;
+    /*
+     * Reason: This is just an internal device - the notifier should
+     * not be registered multiple times in quiesce_init()
+     */
+    dc->user_creatable = false;
 
+    k->init = quiesce_init;
     k->get_send_mask = send_mask;
     k->get_receive_mask = receive_mask;
     k->can_handle_event = can_handle_event;
-- 
1.8.3.1

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

* Re: [Qemu-devel] [PATCH] hw/s390x: Mark the "sclpquiesce" device with user_creatable = false
  2017-10-05  8:45 [Qemu-devel] [PATCH] hw/s390x: Mark the "sclpquiesce" device with user_creatable = false Thomas Huth
@ 2017-10-05  9:00 ` Halil Pasic
  2017-10-05 10:26 ` Claudio Imbrenda
  2017-10-05 12:54 ` Cornelia Huck
  2 siblings, 0 replies; 4+ messages in thread
From: Halil Pasic @ 2017-10-05  9:00 UTC (permalink / raw)
  To: Thomas Huth, qemu-devel, Cornelia Huck, Christian Borntraeger
  Cc: Eric Farman, Janosch Frank, Yi Min Zhao, Jason J Herne,
	David Hildenbrand, Pierre Morel, Farhan Ali, Jing Liu,
	Claudio Imbrenda, QingFeng Hao, Xiao Feng Ren, Fei Li,
	Dong Jia Shi, Yang Chen



On 10/05/2017 10:45 AM, Thomas Huth wrote:
> The "sclpquiesce" device is just an internal device that should not be
> created by the user directly. Though it currently does not seem to cause
> any obvious trouble when the user instantiates an additional device, let's
> better mark it with user_creatable = false to avoid unexpected behavior,
> e.g. because the quiesce notifier gets registered multiple times.
> 
> Signed-off-by: Thomas Huth <thuth@redhat.com>

Reviewed-by: Halil Pasic <pasic@linux.vnet.ibm.com>

> ---
>  hw/s390x/sclpquiesce.c | 7 ++++++-
>  1 file changed, 6 insertions(+), 1 deletion(-)
> 
> diff --git a/hw/s390x/sclpquiesce.c b/hw/s390x/sclpquiesce.c
> index 762cb18..0241643 100644
> --- a/hw/s390x/sclpquiesce.c
> +++ b/hw/s390x/sclpquiesce.c
> @@ -118,8 +118,13 @@ static void quiesce_class_init(ObjectClass *klass, void *data)
>      dc->reset = quiesce_reset;
>      dc->vmsd = &vmstate_sclpquiesce;
>      set_bit(DEVICE_CATEGORY_MISC, dc->categories);
> -    k->init = quiesce_init;
> +    /*
> +     * Reason: This is just an internal device - the notifier should
> +     * not be registered multiple times in quiesce_init()
> +     */
> +    dc->user_creatable = false;
> 
> +    k->init = quiesce_init;
>      k->get_send_mask = send_mask;
>      k->get_receive_mask = receive_mask;
>      k->can_handle_event = can_handle_event;
> 

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

* Re: [Qemu-devel] [PATCH] hw/s390x: Mark the "sclpquiesce" device with user_creatable = false
  2017-10-05  8:45 [Qemu-devel] [PATCH] hw/s390x: Mark the "sclpquiesce" device with user_creatable = false Thomas Huth
  2017-10-05  9:00 ` Halil Pasic
@ 2017-10-05 10:26 ` Claudio Imbrenda
  2017-10-05 12:54 ` Cornelia Huck
  2 siblings, 0 replies; 4+ messages in thread
From: Claudio Imbrenda @ 2017-10-05 10:26 UTC (permalink / raw)
  To: Thomas Huth
  Cc: qemu-devel, Cornelia Huck, Christian Borntraeger,
	David Hildenbrand, Dong Jia Shi, Eric Farman, Farhan Ali, Fei Li,
	Halil Pasic, Janosch Frank, Jason J Herne, Jing Liu, Pierre Morel,
	QingFeng Hao, Xiao Feng Ren, Yang Chen, Yi Min Zhao

On Thu,  5 Oct 2017 10:45:05 +0200
Thomas Huth <thuth@redhat.com> wrote:

> The "sclpquiesce" device is just an internal device that should not be
> created by the user directly. Though it currently does not seem to
> cause any obvious trouble when the user instantiates an additional
> device, let's better mark it with user_creatable = false to avoid
> unexpected behavior, e.g. because the quiesce notifier gets
> registered multiple times.
> 
> Signed-off-by: Thomas Huth <thuth@redhat.com>


Reviewed-by: Claudio Imbrenda <imbrenda@linux.vnet.ibm.com>

> ---
>  hw/s390x/sclpquiesce.c | 7 ++++++-
>  1 file changed, 6 insertions(+), 1 deletion(-)
> 
> diff --git a/hw/s390x/sclpquiesce.c b/hw/s390x/sclpquiesce.c
> index 762cb18..0241643 100644
> --- a/hw/s390x/sclpquiesce.c
> +++ b/hw/s390x/sclpquiesce.c
> @@ -118,8 +118,13 @@ static void quiesce_class_init(ObjectClass
> *klass, void *data) dc->reset = quiesce_reset;
>      dc->vmsd = &vmstate_sclpquiesce;
>      set_bit(DEVICE_CATEGORY_MISC, dc->categories);
> -    k->init = quiesce_init;
> +    /*
> +     * Reason: This is just an internal device - the notifier should
> +     * not be registered multiple times in quiesce_init()
> +     */
> +    dc->user_creatable = false;
> 
> +    k->init = quiesce_init;
>      k->get_send_mask = send_mask;
>      k->get_receive_mask = receive_mask;
>      k->can_handle_event = can_handle_event;

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

* Re: [Qemu-devel] [PATCH] hw/s390x: Mark the "sclpquiesce" device with user_creatable = false
  2017-10-05  8:45 [Qemu-devel] [PATCH] hw/s390x: Mark the "sclpquiesce" device with user_creatable = false Thomas Huth
  2017-10-05  9:00 ` Halil Pasic
  2017-10-05 10:26 ` Claudio Imbrenda
@ 2017-10-05 12:54 ` Cornelia Huck
  2 siblings, 0 replies; 4+ messages in thread
From: Cornelia Huck @ 2017-10-05 12:54 UTC (permalink / raw)
  To: Thomas Huth
  Cc: qemu-devel, Christian Borntraeger, David Hildenbrand,
	Claudio Imbrenda, Dong Jia Shi, Eric Farman, Farhan Ali, Fei Li,
	Halil Pasic, Janosch Frank, Jason J Herne, Jing Liu, Pierre Morel,
	QingFeng Hao, Xiao Feng Ren, Yang Chen, Yi Min Zhao

On Thu,  5 Oct 2017 10:45:05 +0200
Thomas Huth <thuth@redhat.com> wrote:

> The "sclpquiesce" device is just an internal device that should not be
> created by the user directly. Though it currently does not seem to cause
> any obvious trouble when the user instantiates an additional device, let's
> better mark it with user_creatable = false to avoid unexpected behavior,
> e.g. because the quiesce notifier gets registered multiple times.
> 
> Signed-off-by: Thomas Huth <thuth@redhat.com>
> ---
>  hw/s390x/sclpquiesce.c | 7 ++++++-
>  1 file changed, 6 insertions(+), 1 deletion(-)

Thanks, applied.

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

end of thread, other threads:[~2017-10-05 12:55 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-10-05  8:45 [Qemu-devel] [PATCH] hw/s390x: Mark the "sclpquiesce" device with user_creatable = false Thomas Huth
2017-10-05  9:00 ` Halil Pasic
2017-10-05 10:26 ` Claudio Imbrenda
2017-10-05 12:54 ` Cornelia Huck

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