qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] m25p80: add missing blk_attach_dev_nofail
@ 2015-04-14 15:29 Paolo Bonzini
  2015-04-20 16:21 ` Peter Crosthwaite
  2015-04-21 13:17 ` Stefan Hajnoczi
  0 siblings, 2 replies; 3+ messages in thread
From: Paolo Bonzini @ 2015-04-14 15:29 UTC (permalink / raw)
  To: qemu-devel; +Cc: Kevin Wolf, Peter Crosthwaite, armbru, Stefan Hajnoczi

Of the block devices that poked into -drive options via drive_get_next,
m25p80 was the only one who also did not attach itself to the BlockBackend.

Since sd does it, and all other devices go through a "drive" property,
with this change all block backends attached to the guest will have a
non-NULL result for blk_get_attached_dev().

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 hw/block/m25p80.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/hw/block/m25p80.c b/hw/block/m25p80.c
index afe243b..728e384 100644
--- a/hw/block/m25p80.c
+++ b/hw/block/m25p80.c
@@ -629,6 +629,7 @@ static int m25p80_init(SSISlave *ss)
     if (dinfo) {
         DB_PRINT_L(0, "Binding to IF_MTD drive\n");
         s->blk = blk_by_legacy_dinfo(dinfo);
+        blk_attach_dev_nofail(s->blk, s);
 
         /* FIXME: Move to late init */
         if (blk_read(s->blk, 0, s->storage,
-- 
2.3.5

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

* Re: [Qemu-devel] [PATCH] m25p80: add missing blk_attach_dev_nofail
  2015-04-14 15:29 [Qemu-devel] [PATCH] m25p80: add missing blk_attach_dev_nofail Paolo Bonzini
@ 2015-04-20 16:21 ` Peter Crosthwaite
  2015-04-21 13:17 ` Stefan Hajnoczi
  1 sibling, 0 replies; 3+ messages in thread
From: Peter Crosthwaite @ 2015-04-20 16:21 UTC (permalink / raw)
  To: Paolo Bonzini
  Cc: Kevin Wolf, qemu-devel@nongnu.org Developers, Stefan Hajnoczi,
	Markus Armbruster

On Tue, Apr 14, 2015 at 8:29 AM, Paolo Bonzini <pbonzini@redhat.com> wrote:
> Of the block devices that poked into -drive options via drive_get_next,
> m25p80 was the only one who also did not attach itself to the BlockBackend.
>
> Since sd does it, and all other devices go through a "drive" property,
> with this change all block backends attached to the guest will have a
> non-NULL result for blk_get_attached_dev().
>
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>

Reviewed-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com>

> ---
>  hw/block/m25p80.c | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/hw/block/m25p80.c b/hw/block/m25p80.c
> index afe243b..728e384 100644
> --- a/hw/block/m25p80.c
> +++ b/hw/block/m25p80.c
> @@ -629,6 +629,7 @@ static int m25p80_init(SSISlave *ss)
>      if (dinfo) {
>          DB_PRINT_L(0, "Binding to IF_MTD drive\n");
>          s->blk = blk_by_legacy_dinfo(dinfo);
> +        blk_attach_dev_nofail(s->blk, s);
>
>          /* FIXME: Move to late init */
>          if (blk_read(s->blk, 0, s->storage,
> --
> 2.3.5
>
>

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

* Re: [Qemu-devel] [PATCH] m25p80: add missing blk_attach_dev_nofail
  2015-04-14 15:29 [Qemu-devel] [PATCH] m25p80: add missing blk_attach_dev_nofail Paolo Bonzini
  2015-04-20 16:21 ` Peter Crosthwaite
@ 2015-04-21 13:17 ` Stefan Hajnoczi
  1 sibling, 0 replies; 3+ messages in thread
From: Stefan Hajnoczi @ 2015-04-21 13:17 UTC (permalink / raw)
  To: Paolo Bonzini
  Cc: Kevin Wolf, Peter Crosthwaite, qemu-devel, Stefan Hajnoczi,
	armbru

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

On Tue, Apr 14, 2015 at 05:29:47PM +0200, Paolo Bonzini wrote:
> Of the block devices that poked into -drive options via drive_get_next,
> m25p80 was the only one who also did not attach itself to the BlockBackend.
> 
> Since sd does it, and all other devices go through a "drive" property,
> with this change all block backends attached to the guest will have a
> non-NULL result for blk_get_attached_dev().
> 
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
> ---
>  hw/block/m25p80.c | 1 +
>  1 file changed, 1 insertion(+)

Thanks, applied to my block-next tree:
https://github.com/stefanha/qemu/commits/block-next

Stefan

[-- Attachment #2: Type: application/pgp-signature, Size: 473 bytes --]

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

end of thread, other threads:[~2015-04-21 13:17 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-04-14 15:29 [Qemu-devel] [PATCH] m25p80: add missing blk_attach_dev_nofail Paolo Bonzini
2015-04-20 16:21 ` Peter Crosthwaite
2015-04-21 13:17 ` Stefan Hajnoczi

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