qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH 0/2] scsi: Clean up BlockDriverState use
@ 2012-06-05 14:49 Markus Armbruster
  2012-06-05 14:49 ` [Qemu-devel] [PATCH 1/2] block: New bdrv_get_flags() Markus Armbruster
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Markus Armbruster @ 2012-06-05 14:49 UTC (permalink / raw)
  To: qemu-devel; +Cc: kwolf, pbonzini

With this and the related fix for xen applied, block_int.h is finally
gone from hw/.

Markus Armbruster (2):
  block: New bdrv_get_flags()
  scsi-disk: Don't peek behind the BlockDriverState abstraction

 block.c        |    5 +++++
 block.h        |    1 +
 hw/scsi-disk.c |    3 +--
 3 files changed, 7 insertions(+), 2 deletions(-)

-- 
1.7.6.5

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

* [Qemu-devel] [PATCH 1/2] block: New bdrv_get_flags()
  2012-06-05 14:49 [Qemu-devel] [PATCH 0/2] scsi: Clean up BlockDriverState use Markus Armbruster
@ 2012-06-05 14:49 ` Markus Armbruster
  2012-06-05 14:49 ` [Qemu-devel] [PATCH 2/2] scsi-disk: Don't peek behind the BlockDriverState abstraction Markus Armbruster
  2012-06-05 21:32 ` [Qemu-devel] [PATCH 0/2] scsi: Clean up BlockDriverState use Paolo Bonzini
  2 siblings, 0 replies; 5+ messages in thread
From: Markus Armbruster @ 2012-06-05 14:49 UTC (permalink / raw)
  To: qemu-devel; +Cc: kwolf, pbonzini


Signed-off-by: Markus Armbruster <armbru@redhat.com>
---
 block.c |    5 +++++
 block.h |    1 +
 2 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/block.c b/block.c
index 7547051..9a50843 100644
--- a/block.c
+++ b/block.c
@@ -2466,6 +2466,11 @@ const char *bdrv_get_device_name(BlockDriverState *bs)
     return bs->device_name;
 }
 
+int bdrv_get_flags(BlockDriverState *bs)
+{
+    return bs->open_flags;
+}
+
 void bdrv_flush_all(void)
 {
     BlockDriverState *bs;
diff --git a/block.h b/block.h
index 7408acc..d42dfb3 100644
--- a/block.h
+++ b/block.h
@@ -296,6 +296,7 @@ int bdrv_query_missing_keys(void);
 void bdrv_iterate_format(void (*it)(void *opaque, const char *name),
                          void *opaque);
 const char *bdrv_get_device_name(BlockDriverState *bs);
+int bdrv_get_flags(BlockDriverState *bs);
 int bdrv_write_compressed(BlockDriverState *bs, int64_t sector_num,
                           const uint8_t *buf, int nb_sectors);
 int bdrv_get_info(BlockDriverState *bs, BlockDriverInfo *bdi);
-- 
1.7.6.5

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

* [Qemu-devel] [PATCH 2/2] scsi-disk: Don't peek behind the BlockDriverState abstraction
  2012-06-05 14:49 [Qemu-devel] [PATCH 0/2] scsi: Clean up BlockDriverState use Markus Armbruster
  2012-06-05 14:49 ` [Qemu-devel] [PATCH 1/2] block: New bdrv_get_flags() Markus Armbruster
@ 2012-06-05 14:49 ` Markus Armbruster
  2012-06-05 21:32 ` [Qemu-devel] [PATCH 0/2] scsi: Clean up BlockDriverState use Paolo Bonzini
  2 siblings, 0 replies; 5+ messages in thread
From: Markus Armbruster @ 2012-06-05 14:49 UTC (permalink / raw)
  To: qemu-devel; +Cc: kwolf, pbonzini

Use the appropriate interface instead.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
---
 hw/scsi-disk.c |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)

diff --git a/hw/scsi-disk.c b/hw/scsi-disk.c
index 045c764..1bfefb2 100644
--- a/hw/scsi-disk.c
+++ b/hw/scsi-disk.c
@@ -34,7 +34,6 @@ do { printf("scsi-disk: " fmt , ## __VA_ARGS__); } while (0)
 #include "scsi-defs.h"
 #include "sysemu.h"
 #include "blockdev.h"
-#include "block_int.h"
 #include "dma.h"
 
 #ifdef __linux
@@ -1877,7 +1876,7 @@ static SCSIRequest *scsi_block_new_request(SCSIDevice *d, uint32_t tag,
 	 * ones (such as WRITE SAME or EXTENDED COPY, etc.).  So, without
 	 * O_DIRECT everything must go through SG_IO.
          */
-        if (!(s->qdev.conf.bs->open_flags & BDRV_O_NOCACHE)) {
+        if (bdrv_get_flags(s->qdev.conf.bs) & BDRV_O_NOCACHE) {
             break;
         }
 
-- 
1.7.6.5

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

* Re: [Qemu-devel] [PATCH 0/2] scsi: Clean up BlockDriverState use
  2012-06-05 14:49 [Qemu-devel] [PATCH 0/2] scsi: Clean up BlockDriverState use Markus Armbruster
  2012-06-05 14:49 ` [Qemu-devel] [PATCH 1/2] block: New bdrv_get_flags() Markus Armbruster
  2012-06-05 14:49 ` [Qemu-devel] [PATCH 2/2] scsi-disk: Don't peek behind the BlockDriverState abstraction Markus Armbruster
@ 2012-06-05 21:32 ` Paolo Bonzini
  2012-06-06 10:52   ` Kevin Wolf
  2 siblings, 1 reply; 5+ messages in thread
From: Paolo Bonzini @ 2012-06-05 21:32 UTC (permalink / raw)
  To: Markus Armbruster; +Cc: kwolf, qemu-devel

Il 05/06/2012 16:49, Markus Armbruster ha scritto:
> With this and the related fix for xen applied, block_int.h is finally
> gone from hw/.
> 
> Markus Armbruster (2):
>   block: New bdrv_get_flags()
>   scsi-disk: Don't peek behind the BlockDriverState abstraction
> 
>  block.c        |    5 +++++
>  block.h        |    1 +
>  hw/scsi-disk.c |    3 +--
>  3 files changed, 7 insertions(+), 2 deletions(-)
> 

Acked-by: Paolo Bonzini <pbonzini@redhat.com>

Paolo

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

* Re: [Qemu-devel] [PATCH 0/2] scsi: Clean up BlockDriverState use
  2012-06-05 21:32 ` [Qemu-devel] [PATCH 0/2] scsi: Clean up BlockDriverState use Paolo Bonzini
@ 2012-06-06 10:52   ` Kevin Wolf
  0 siblings, 0 replies; 5+ messages in thread
From: Kevin Wolf @ 2012-06-06 10:52 UTC (permalink / raw)
  To: Paolo Bonzini; +Cc: Markus Armbruster, qemu-devel

Am 05.06.2012 23:32, schrieb Paolo Bonzini:
> Il 05/06/2012 16:49, Markus Armbruster ha scritto:
>> With this and the related fix for xen applied, block_int.h is finally
>> gone from hw/.
>>
>> Markus Armbruster (2):
>>   block: New bdrv_get_flags()
>>   scsi-disk: Don't peek behind the BlockDriverState abstraction
>>
>>  block.c        |    5 +++++
>>  block.h        |    1 +
>>  hw/scsi-disk.c |    3 +--
>>  3 files changed, 7 insertions(+), 2 deletions(-)
>>
> 
> Acked-by: Paolo Bonzini <pbonzini@redhat.com>

Thanks, applied to the block branch.

Kevin

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

end of thread, other threads:[~2012-06-06 10:52 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-06-05 14:49 [Qemu-devel] [PATCH 0/2] scsi: Clean up BlockDriverState use Markus Armbruster
2012-06-05 14:49 ` [Qemu-devel] [PATCH 1/2] block: New bdrv_get_flags() Markus Armbruster
2012-06-05 14:49 ` [Qemu-devel] [PATCH 2/2] scsi-disk: Don't peek behind the BlockDriverState abstraction Markus Armbruster
2012-06-05 21:32 ` [Qemu-devel] [PATCH 0/2] scsi: Clean up BlockDriverState use Paolo Bonzini
2012-06-06 10:52   ` Kevin Wolf

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