qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH 0/2] Fix scsi-generic breakage in upstream qemu-kvm.git
@ 2010-05-15 13:30 Nicholas A. Bellinger
  0 siblings, 0 replies; 5+ messages in thread
From: Nicholas A. Bellinger @ 2010-05-15 13:30 UTC (permalink / raw)
  To: Kevin Wolf, Christoph Hellwig, Gerd Hoffmann, Hannes Reinecke,
	kvm-devel, qemu-devel
  Cc: Nicholas Bellinger

From: Nicholas Bellinger <nab@linux-iscsi.org>

Greetings Kevin and hch,

After pulling from upstream qemu-kvm.git/master into the megasas qemu-kvm.git tree,
I ran into some breakage with scsi-generic devices returning an -ESPIPE exception in
bdrv_open() -> find_image_format() -> bdrv_read(), and then again from
brdv_open_common() -> refresh_total_sectors() -> raw_getlength() -> lseek().

This breakage appears to be fallout from:

commit b6ce07aa83bdee3cfd2610f270a0ce304e78df95
Author: Kevin Wolf <kwolf@redhat.com>
Date:   Mon Apr 12 16:37:13 2010 +0200

    block: Split bdrv_open
    
    bdrv_open contains quite some code that is only useful for opening images (as
    opposed to opening files by a protocol), for example snapshots.
    
    This patch splits the code so that we have bdrv_open_file() for files (uses
    protocols), bdrv_open() for images (uses format drivers) and bdrv_open_common()
    for the code common for opening both images and files.

commit 66f82ceed6781261c09e65fb440ca76842fd0500
Author: Kevin Wolf <kwolf@redhat.com>
Date:   Wed Apr 14 14:17:38 2010 +0200

    block: Open the underlying image file in generic code
    
    Format drivers shouldn't need to bother with things like file names, but rather
    just get an open BlockDriverState for the underlying protocol. This patch
    introduces this behaviour for bdrv_open implementation. For protocols which
    need to access the filename to open their file/device/connection/... a new
    callback bdrv_file_open is introduced which doesn't get an underlying file
    opened.


The following are two patches that where required in order to get hw/scsi-generic.c
working with the latest upstream qemu-kvm.git/master.  They appear to be straight
forward enough, and have been lightly tested with megasas+SG_IO on a v2.6.34-rc7 KVM
host.

Please have a look and apply!

Signed-off-by: Nicholas A. Bellinger <nab@linux-iscsi.org>

Nicholas Bellinger (2):
  [block]: Fix scsi-generic breakage in find_image_format()
  [block]: Skip refresh_total_sectors() for scsi-generic devices

 block.c |   20 ++++++++++++++++----
 1 files changed, 16 insertions(+), 4 deletions(-)

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

* [Qemu-devel] [PATCH 0/2] Fix scsi-generic breakage in upstream qemu-kvm.git
@ 2010-05-17 16:45 Nicholas A. Bellinger
  2010-05-20 13:18 ` Kevin Wolf
  0 siblings, 1 reply; 5+ messages in thread
From: Nicholas A. Bellinger @ 2010-05-17 16:45 UTC (permalink / raw)
  To: Kevin Wolf, Christoph Hellwig, Gerd Hoffmann, Hannes Reinecke,
	kvm-devel, qemu-devel
  Cc: Nicholas Bellinger

From: Nicholas Bellinger <nab@linux-iscsi.org>

Greetings,

Attached are the updated patches following hch's comments to fix scsi-generic
device breakage with find_image_format() and refresh_total_sectors().

These are being resent as the last attachments where in MBOX format from git-format-patch.

Signed-off-by: Nicholas A. Bellinger <nab@linux-iscsi.org>

Nicholas Bellinger (2):
  [block]: Make find_image_format() return 'raw' BlockDriver for SG_IO
    devices
  [block]: Add SG_IO device check in refresh_total_sectors()

 block.c |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)

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

* Re: [Qemu-devel] [PATCH 0/2] Fix scsi-generic breakage in upstream qemu-kvm.git
  2010-05-17 16:45 [Qemu-devel] [PATCH 0/2] Fix scsi-generic breakage in upstream qemu-kvm.git Nicholas A. Bellinger
@ 2010-05-20 13:18 ` Kevin Wolf
  2010-05-27 15:56   ` Nicholas A. Bellinger
  0 siblings, 1 reply; 5+ messages in thread
From: Kevin Wolf @ 2010-05-20 13:18 UTC (permalink / raw)
  To: Nicholas A. Bellinger
  Cc: qemu-devel, Hannes Reinecke, Christoph Hellwig, kvm-devel,
	Gerd Hoffmann

Am 17.05.2010 18:45, schrieb Nicholas A. Bellinger:
> From: Nicholas Bellinger <nab@linux-iscsi.org>
> 
> Greetings,
> 
> Attached are the updated patches following hch's comments to fix scsi-generic
> device breakage with find_image_format() and refresh_total_sectors().
> 
> These are being resent as the last attachments where in MBOX format from git-format-patch.
> 
> Signed-off-by: Nicholas A. Bellinger <nab@linux-iscsi.org>

Thanks, applied all to the block branch, even though I forgot to reply here.

Kevin

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

* Re: [Qemu-devel] [PATCH 0/2] Fix scsi-generic breakage in upstream qemu-kvm.git
  2010-05-20 13:18 ` Kevin Wolf
@ 2010-05-27 15:56   ` Nicholas A. Bellinger
  2010-05-28 11:32     ` Kevin Wolf
  0 siblings, 1 reply; 5+ messages in thread
From: Nicholas A. Bellinger @ 2010-05-27 15:56 UTC (permalink / raw)
  To: Kevin Wolf
  Cc: Chris Krumme, kvm-devel, qemu-devel, Hannes Reinecke,
	Christoph Hellwig, Gerd Hoffmann

On Thu, 2010-05-20 at 15:18 +0200, Kevin Wolf wrote:
> Am 17.05.2010 18:45, schrieb Nicholas A. Bellinger:
> > From: Nicholas Bellinger <nab@linux-iscsi.org>
> > 
> > Greetings,
> > 
> > Attached are the updated patches following hch's comments to fix scsi-generic
> > device breakage with find_image_format() and refresh_total_sectors().
> > 
> > These are being resent as the last attachments where in MBOX format from git-format-patch.
> > 
> > Signed-off-by: Nicholas A. Bellinger <nab@linux-iscsi.org>
> 
> Thanks, applied all to the block branch, even though I forgot to reply here.
> 
> Kevin

Hi Kevin,

Thanks for accepting the series.  There is one more piece of breakage
that Chris Krumme found in block.c:find_image_format() in the original
patch.  Please apply the patch to add the missing bdrv_delete() for the
SG_IO case below.

Thanks for pointing this out Chris!

Best,

--nab

[PATCH] [block]: Add missing bdrv_delete() for SG_IO BlockDriver in find_image_format()

This patch adds a missing bdrv_delete() call in find_image_format() so that a
SG_IO BlockDriver properly releases the temporary BlockDriverState *bs created
from bdrv_file_open()

Signed-off-by: Nicholas A. Bellinger <nab@linux-iscsi.org>
Reported-by: Chris Krumme <chris.krumme@windriver.com>
---
 block.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/block.c b/block.c
index 7a379dc..88dbc00 100644
--- a/block.c
+++ b/block.c
@@ -334,8 +334,10 @@ static BlockDriver *find_image_format(const char *filename)
         return NULL;

     /* Return the raw BlockDriver * to scsi-generic devices */
-    if (bs->sg)
+    if (bs->sg) {
+        bdrv_delete(bs); 
         return bdrv_find_format("raw");
+    }

     ret = bdrv_pread(bs, 0, buf, sizeof(buf));
     bdrv_delete(bs);
-- 
1.5.6.5

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

* Re: [Qemu-devel] [PATCH 0/2] Fix scsi-generic breakage in upstream qemu-kvm.git
  2010-05-27 15:56   ` Nicholas A. Bellinger
@ 2010-05-28 11:32     ` Kevin Wolf
  0 siblings, 0 replies; 5+ messages in thread
From: Kevin Wolf @ 2010-05-28 11:32 UTC (permalink / raw)
  To: Nicholas A. Bellinger
  Cc: Chris Krumme, kvm-devel, qemu-devel, Hannes Reinecke,
	Christoph Hellwig, Gerd Hoffmann

Am 27.05.2010 17:56, schrieb Nicholas A. Bellinger:
> On Thu, 2010-05-20 at 15:18 +0200, Kevin Wolf wrote:
>> Am 17.05.2010 18:45, schrieb Nicholas A. Bellinger:
>>> From: Nicholas Bellinger <nab@linux-iscsi.org>
>>>
>>> Greetings,
>>>
>>> Attached are the updated patches following hch's comments to fix scsi-generic
>>> device breakage with find_image_format() and refresh_total_sectors().
>>>
>>> These are being resent as the last attachments where in MBOX format from git-format-patch.
>>>
>>> Signed-off-by: Nicholas A. Bellinger <nab@linux-iscsi.org>
>>
>> Thanks, applied all to the block branch, even though I forgot to reply here.
>>
>> Kevin
> 
> Hi Kevin,
> 
> Thanks for accepting the series.  There is one more piece of breakage
> that Chris Krumme found in block.c:find_image_format() in the original
> patch.  Please apply the patch to add the missing bdrv_delete() for the
> SG_IO case below.
> 
> Thanks for pointing this out Chris!

Right, thanks for the fix.  I've applied it to the block branch.

Kevin

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

end of thread, other threads:[~2010-05-28 11:32 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-05-17 16:45 [Qemu-devel] [PATCH 0/2] Fix scsi-generic breakage in upstream qemu-kvm.git Nicholas A. Bellinger
2010-05-20 13:18 ` Kevin Wolf
2010-05-27 15:56   ` Nicholas A. Bellinger
2010-05-28 11:32     ` Kevin Wolf
  -- strict thread matches above, loose matches on Subject: below --
2010-05-15 13:30 Nicholas A. Bellinger

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