qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH v2] ssi-sd: Make devices picking up backends unavailable with -device
@ 2018-10-09  6:08 Markus Armbruster
  2018-10-09  6:10 ` Thomas Huth
  2018-10-18  7:50 ` Markus Armbruster
  0 siblings, 2 replies; 4+ messages in thread
From: Markus Armbruster @ 2018-10-09  6:08 UTC (permalink / raw)
  To: qemu-devel; +Cc: peter.maydell, thuth, philmd

Device models aren't supposed to go on fishing expeditions for
backends.  They should expose suitable properties for the user to set.
For onboard devices, board code sets them.

Device ssi-sd picks up its block backend in its init() method with
drive_get_next() instead.  This mistake is already marked FIXME since
commit af9e40a.

Unset user_creatable to remove the mistake from our external
interface.  Since the SSI bus doesn't support hotplug, only -device
can be affected.  Only certain ARM machines have ssi-sd and provide an
SSI bus for it; this patch breaks -device ssi-sd for these machines.
No actual use of -device ssi-sd is known.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Acked-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
---
v2:
* Rebase to master
* Improve commit message

 hw/sd/ssi-sd.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/hw/sd/ssi-sd.c b/hw/sd/ssi-sd.c
index 95a143bfba..623d0333e8 100644
--- a/hw/sd/ssi-sd.c
+++ b/hw/sd/ssi-sd.c
@@ -284,6 +284,8 @@ static void ssi_sd_class_init(ObjectClass *klass, void *data)
     k->cs_polarity = SSI_CS_LOW;
     dc->vmsd = &vmstate_ssi_sd;
     dc->reset = ssi_sd_reset;
+    /* Reason: init() method uses drive_get_next() */
+    dc->user_creatable = false;
 }
 
 static const TypeInfo ssi_sd_info = {
-- 
2.17.1

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

* Re: [Qemu-devel] [PATCH v2] ssi-sd: Make devices picking up backends unavailable with -device
  2018-10-09  6:08 [Qemu-devel] [PATCH v2] ssi-sd: Make devices picking up backends unavailable with -device Markus Armbruster
@ 2018-10-09  6:10 ` Thomas Huth
  2018-10-18  7:50 ` Markus Armbruster
  1 sibling, 0 replies; 4+ messages in thread
From: Thomas Huth @ 2018-10-09  6:10 UTC (permalink / raw)
  To: Markus Armbruster, qemu-devel; +Cc: peter.maydell, philmd

On 2018-10-09 08:08, Markus Armbruster wrote:
> Device models aren't supposed to go on fishing expeditions for
> backends.  They should expose suitable properties for the user to set.
> For onboard devices, board code sets them.
> 
> Device ssi-sd picks up its block backend in its init() method with
> drive_get_next() instead.  This mistake is already marked FIXME since
> commit af9e40a.
> 
> Unset user_creatable to remove the mistake from our external
> interface.  Since the SSI bus doesn't support hotplug, only -device
> can be affected.  Only certain ARM machines have ssi-sd and provide an
> SSI bus for it; this patch breaks -device ssi-sd for these machines.
> No actual use of -device ssi-sd is known.
> 
> Signed-off-by: Markus Armbruster <armbru@redhat.com>
> Acked-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
> ---
> v2:
> * Rebase to master
> * Improve commit message
> 
>  hw/sd/ssi-sd.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/hw/sd/ssi-sd.c b/hw/sd/ssi-sd.c
> index 95a143bfba..623d0333e8 100644
> --- a/hw/sd/ssi-sd.c
> +++ b/hw/sd/ssi-sd.c
> @@ -284,6 +284,8 @@ static void ssi_sd_class_init(ObjectClass *klass, void *data)
>      k->cs_polarity = SSI_CS_LOW;
>      dc->vmsd = &vmstate_ssi_sd;
>      dc->reset = ssi_sd_reset;
> +    /* Reason: init() method uses drive_get_next() */
> +    dc->user_creatable = false;
>  }
>  
>  static const TypeInfo ssi_sd_info = {
> 

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

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

* Re: [Qemu-devel] [PATCH v2] ssi-sd: Make devices picking up backends unavailable with -device
  2018-10-09  6:08 [Qemu-devel] [PATCH v2] ssi-sd: Make devices picking up backends unavailable with -device Markus Armbruster
  2018-10-09  6:10 ` Thomas Huth
@ 2018-10-18  7:50 ` Markus Armbruster
  2018-10-18 16:26   ` Peter Maydell
  1 sibling, 1 reply; 4+ messages in thread
From: Markus Armbruster @ 2018-10-18  7:50 UTC (permalink / raw)
  To: peter.maydell; +Cc: qemu-devel, thuth, philmd

Peter, would you be willing to take this through your ARM tree?

Markus Armbruster <armbru@redhat.com> writes:

> Device models aren't supposed to go on fishing expeditions for
> backends.  They should expose suitable properties for the user to set.
> For onboard devices, board code sets them.
>
> Device ssi-sd picks up its block backend in its init() method with
> drive_get_next() instead.  This mistake is already marked FIXME since
> commit af9e40a.
>
> Unset user_creatable to remove the mistake from our external
> interface.  Since the SSI bus doesn't support hotplug, only -device
> can be affected.  Only certain ARM machines have ssi-sd and provide an
> SSI bus for it; this patch breaks -device ssi-sd for these machines.
> No actual use of -device ssi-sd is known.
>
> Signed-off-by: Markus Armbruster <armbru@redhat.com>
> Acked-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
> ---
> v2:
> * Rebase to master
> * Improve commit message
>
>  hw/sd/ssi-sd.c | 2 ++
>  1 file changed, 2 insertions(+)
>
> diff --git a/hw/sd/ssi-sd.c b/hw/sd/ssi-sd.c
> index 95a143bfba..623d0333e8 100644
> --- a/hw/sd/ssi-sd.c
> +++ b/hw/sd/ssi-sd.c
> @@ -284,6 +284,8 @@ static void ssi_sd_class_init(ObjectClass *klass, void *data)
>      k->cs_polarity = SSI_CS_LOW;
>      dc->vmsd = &vmstate_ssi_sd;
>      dc->reset = ssi_sd_reset;
> +    /* Reason: init() method uses drive_get_next() */
> +    dc->user_creatable = false;
>  }
>  
>  static const TypeInfo ssi_sd_info = {

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

* Re: [Qemu-devel] [PATCH v2] ssi-sd: Make devices picking up backends unavailable with -device
  2018-10-18  7:50 ` Markus Armbruster
@ 2018-10-18 16:26   ` Peter Maydell
  0 siblings, 0 replies; 4+ messages in thread
From: Peter Maydell @ 2018-10-18 16:26 UTC (permalink / raw)
  To: Markus Armbruster
  Cc: QEMU Developers, Thomas Huth, Philippe Mathieu-Daudé

On 18 October 2018 at 08:50, Markus Armbruster <armbru@redhat.com> wrote:
> Peter, would you be willing to take this through your ARM tree?

Sure; applied to target-arm.next.

thanks
-- PMM

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

end of thread, other threads:[~2018-10-18 16:26 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-10-09  6:08 [Qemu-devel] [PATCH v2] ssi-sd: Make devices picking up backends unavailable with -device Markus Armbruster
2018-10-09  6:10 ` Thomas Huth
2018-10-18  7:50 ` Markus Armbruster
2018-10-18 16:26   ` Peter Maydell

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