scsi: Clean up BlockDriverState use
cover scsi: Clean up BlockDriverState use
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(-)
Signature · 1 line
1.7.6.5
PATCH 1/2 block: New bdrv_get_flags()
--- block.c | 5 +++++ block.h | 1 + 2 files changed, 6 insertions(+), 0 deletions(-)
block.c +5 -0
@@ -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;
block.h +1 -0
@@ -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);
Signature · 1 line
1.7.6.5
PATCH 2/2 scsi-disk: Don't peek behind the BlockDriverState abstraction
In reply to Markus ArmbrusterUse the appropriate interface instead.
--- hw/scsi-disk.c | 3 +-- 1 files changed, 1 insertions(+), 2 deletions(-)
hw/scsi-disk.c +1 -2
@@ -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 ; }
Signature · 1 line
1.7.6.5
Il 05/06/2012 16:49, Markus Armbruster ha scritto:
Quoted 12 lines
With this and the related fix for xen applied,
block_int.his finally gone from hw/.Markus Armbruster (2):
block: Newbdrv_get_flags()
scsi-disk: Don't peek behind the BlockDriverState abstractionblock.c | 5 +++++ block.h | 1 + hw/scsi-disk.c | 3 +-- 3 files changed, 7 insertions(+), 2 deletions(-)
Paolo
Kevin Wolf
AppliedAm 05.06.2012 23:32, schrieb Paolo Bonzini:
Quoted 8 lines
Il 05/06/2012 16:49, Markus Armbruster ha scritto:
Quoted 7 lines
With this and the related fix for xen applied,
block_int.his finally gone from hw/.Markus Armbruster (2):
block: Newbdrv_get_flags()
scsi-disk: Don't peek behind the BlockDriverState abstraction
Quoted 7 lines
Quoted 5 lines
block.c | 5 +++++ block.h | 1 + hw/scsi-disk.c | 3 +-- 3 files changed, 7 insertions(+), 2 deletions(-)Acked-by Paolo Bonzini <[email protected]>
Thanks, applied to the block branch.
Kevin