[Qemu-block] [PATCH v5 5/5] raw-posix: Introduce hdev_is_sg()

2015-06-23 Thread Dimitris Aragiorgis
) by ensuring that all of the following holds: - The specified file name corresponds to a character device - The device supports the SG_GET_VERSION_NUM ioctl - The device supports the SG_GET_SCSI_ID ioctl Signed-off-by: Dimitris Aragiorgis dim...@arrikto.com --- block/raw-posix.c | 39

[Qemu-block] [PATCH v5 1/5] block: Use bdrv_is_sg() everywhere

2015-06-23 Thread Dimitris Aragiorgis
Instead of checking bs-sg use bdrv_is_sg() consistently throughout the code. Signed-off-by: Dimitris Aragiorgis dim...@arrikto.com Reviewed-by: Paolo Bonzini pbonz...@redhat.com Reviewed-by: Stefan Hajnoczi stefa...@redhat.com --- block.c |6 +++--- block/iscsi.c |2

[Qemu-block] [PATCH v5 3/5] raw-posix: DPRINTF instead of DEBUG_BLOCK_PRINT

2015-06-23 Thread Dimitris Aragiorgis
Building the QEMU tools fails if we #define DEBUG_BLOCK inside block/raw-posix.c. Here instead of adding qemu-log.o in block-obj-y so that DEBUG_BLOCK_PRINT can be used, we substitute the latter with a simple DPRINTF() (that does not cause bit-rot). Signed-off-by: Dimitris Aragiorgis dim

[Qemu-block] [PATCH v5 2/5] Fix migration in case of scsi-generic

2015-06-23 Thread Dimitris Aragiorgis
-off-by: Dimitris Aragiorgis dim...@arrikto.com Reviewed-by: Stefan Hajnoczi stefa...@redhat.com --- block/io.c|3 ++- block/iscsi.c |4 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/block/io.c b/block/io.c index bb4f787..f45a3ad 100644 --- a/block/io.c +++ b/block

[Qemu-block] [PATCH v5 4/5] raw-posix: Use DPRINTF for DEBUG_FLOPPY

2015-06-23 Thread Dimitris Aragiorgis
Get rid of several #ifdef DEBUG_FLOPPY and substitute them with DPRINTF. Signed-off-by: Dimitris Aragiorgis dim...@arrikto.com Reviewed-by: Eric Blake ebl...@redhat.com Reviewed-by: Stefan Hajnoczi stefa...@redhat.com --- block/raw-posix.c | 22 +- 1 file changed, 5

[Qemu-block] [PATCH v5 0/5] Some fixes related to scsi-generic

2015-06-23 Thread Dimitris Aragiorgis
the bs-sg flag (and is not an actual driver function). If you insist I'll change it in v3. Dimitris Aragiorgis (5): block: Use bdrv_is_sg() everywhere Fix migration in case of scsi-generic raw-posix: DPRINTF instead of DEBUG_BLOCK_PRINT raw-posix: Use DPRINTF for DEBUG_FLOPPY raw-posix

Re: [Qemu-block] [Qemu-devel] [PATCH v4 5/5] raw-posix: Introduce hdev_is_sg()

2015-06-22 Thread Dimitris Aragiorgis
it is a character device node, and then it issues the SG_GET_VERSION_NUM and SG_GET_SCSI_ID ioctl()s. Thanks, dimara * Stefan Hajnoczi stefa...@redhat.com [2015-06-19 13:33:02 +0100]: On Wed, May 20, 2015 at 12:57:39PM +0300, Dimitris Aragiorgis wrote: This is very fragile, e.g. it fails with symlinks

Re: [Qemu-block] [Qemu-devel] [PATCH v4 0/5] Some fixes related to scsi-generic

2015-06-18 Thread Dimitris Aragiorgis
Hi, did you have the time to take a look at this? Is there anything pending from my side? Thanks, dimara * Dimitris Aragiorgis dim...@arrikto.com [2015-05-29 08:15:34 +0300]: Hi, * Dimitris Aragiorgis dim...@arrikto.com [2015-05-20 12:57:34 +0300]: Hi all, These four patches make

[Qemu-block] [PATCH v4 5/5] raw-posix: Introduce hdev_is_sg()

2015-05-20 Thread Dimitris Aragiorgis
for an SG device (e.g. /dev/sg0) by ensuring that all of the following holds: - The device supports the SG_GET_VERSION_NUM ioctl - The device supports the SG_GET_SCSI_ID ioctl - The specified file name corresponds to a character device Signed-off-by: Dimitris Aragiorgis dim...@arrikto.com

[Qemu-block] [PATCH v4 3/5] raw-posix: DPRINTF instead of DEBUG_BLOCK_PRINT

2015-05-20 Thread Dimitris Aragiorgis
Building the QEMU tools fails if we #define DEBUG_BLOCK inside block/raw-posix.c. Here instead of adding qemu-log.o in block-obj-y so that DEBUG_BLOCK_PRINT can be used, we substitute the latter with a simple DPRINTF() (that does not cause bit-rot). Signed-off-by: Dimitris Aragiorgis dim

[Qemu-block] [PATCH v4 0/5] Some fixes related to scsi-generic

2015-05-20 Thread Dimitris Aragiorgis
make sense to add a tracepoint for bdrv_is_sg() (just like most bdrv_* commands) but this is too much for now since it just returns the bs-sg flag (and is not an actual driver function). If you insist I'll change it in v3. Dimitris Aragiorgis (5): block: Use bdrv_is_sg() everywhere Fix

[Qemu-block] [PATCH v4 1/5] block: Use bdrv_is_sg() everywhere

2015-05-20 Thread Dimitris Aragiorgis
Instead of checking bs-sg use bdrv_is_sg() consistently throughout the code. Signed-off-by: Dimitris Aragiorgis dim...@arrikto.com Reviewed-by: Paolo Bonzini pbonz...@redhat.com --- block.c |6 +++--- block/iscsi.c |2 +- block/raw-posix.c |4 ++-- 3 files changed, 6

[Qemu-block] [PATCH v4 2/5] Fix migration in case of scsi-generic

2015-05-20 Thread Dimitris Aragiorgis
-off-by: Dimitris Aragiorgis dim...@arrikto.com --- block/io.c|3 ++- block/iscsi.c |4 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/block/io.c b/block/io.c index 1ce62c4..922dc07 100644 --- a/block/io.c +++ b/block/io.c @@ -2231,7 +2231,8 @@ int coroutine_fn

[Qemu-block] [PATCH v4 4/5] raw-posix: Use DPRINTF for DEBUG_FLOPPY

2015-05-20 Thread Dimitris Aragiorgis
Get rid of several #ifdef DEBUG_FLOPPY and substitute them with DPRINTF. Signed-off-by: Dimitris Aragiorgis dim...@arrikto.com --- block/raw-posix.c | 22 +- 1 file changed, 5 insertions(+), 17 deletions(-) diff --git a/block/raw-posix.c b/block/raw-posix.c index 438bf0b

[Qemu-block] [PATCH v3 0/5] Some fixes related to scsi-generic

2015-05-14 Thread Dimitris Aragiorgis
driver function). If you insist I'll change it in v3. Dimitris Aragiorgis (5): block: Use bdrv_is_sg() everywhere Fix migration in case of scsi-generic raw-posix: DPRINTF instead of DEBUG_BLOCK_PRINT raw-posix: Use DPRINTF for DEBUG_FLOPPY raw-posix: Introduce hdev_is_sg() block.c

[Qemu-block] [PATCH v3 5/5] raw-posix: Introduce hdev_is_sg()

2015-05-14 Thread Dimitris Aragiorgis
for an SG device (e.g. /dev/sg0) by ensuring that all of the following holds: - The device supports the SG_GET_VERSION_NUM ioctl - The device supports the SG_GET_SCSI_ID ioctl - The specified file name corresponds to a character device Signed-off-by: Dimitris Aragiorgis dim...@arrikto.com

[Qemu-block] [PATCH v3 3/5] raw-posix: DPRINTF instead of DEBUG_BLOCK_PRINT

2015-05-14 Thread Dimitris Aragiorgis
Building the QEMU tools fails if we #define DEBUG_BLOCK inside block/raw-posix.c. Here instead of adding qemu-log.o in block-obj-y so that DEBUG_BLOCK_PRINT can be used, we substitute the latter with a simple DPRINTF() (that does not cause bit-rot). Signed-off-by: Dimitris Aragiorgis dim

[Qemu-block] [PATCH v3 2/5] Fix migration in case of scsi-generic

2015-05-14 Thread Dimitris Aragiorgis
-off-by: Dimitris Aragiorgis dim...@arrikto.com --- block/io.c|3 ++- block/iscsi.c |4 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/block/io.c b/block/io.c index 1ce62c4..922dc07 100644 --- a/block/io.c +++ b/block/io.c @@ -2231,7 +2231,8 @@ int coroutine_fn

[Qemu-block] [PATCH v3 4/5] raw-posix: Use DPRINTF for DEBUG_FLOPPY

2015-05-14 Thread Dimitris Aragiorgis
Get rid of several #ifdef DEBUG_FLOPPY and substitute them with DPRINTF. Signed-off-by: Dimitris Aragiorgis dim...@arrikto.com --- block/raw-posix.c | 22 +- 1 file changed, 5 insertions(+), 17 deletions(-) diff --git a/block/raw-posix.c b/block/raw-posix.c index ff7dc4d

Re: [Qemu-block] [Qemu-devel] [PATCH v2 2/5] Fix migration in case of scsi-generic

2015-05-14 Thread Dimitris Aragiorgis
Hello Kevin, * Kevin Wolf kw...@redhat.com [2015-05-11 12:12:23 +0200]: Am 08.05.2015 um 19:47 hat Dimitris Aragiorgis geschrieben: During migration, QEMU uses fsync()/fdatasync() on the open file descriptor for read-write block devices to flush data just before stopping the VM

[Qemu-block] [PATCH v2 5/5] raw-posix: Introduce hdev_is_sg()

2015-05-08 Thread Dimitris Aragiorgis
for an SG device (e.g. /dev/sg0) by ensuring that all of the following holds: - The device supports the SG_GET_VERSION_NUM ioctl - The device supports the SG_GET_SCSI_ID ioctl - The specified file name corresponds to a character device Signed-off-by: Dimitris Aragiorgis dim...@arrikto.com

[Qemu-block] [PATCH v2 1/5] block: Use bdrv_is_sg() everywhere

2015-05-08 Thread Dimitris Aragiorgis
Instead of checking bs-sg use bdrv_is_sg() consistently throughout the code. Signed-off-by: Dimitris Aragiorgis dim...@arrikto.com Reviewed-by: Paolo Bonzini pbonz...@redhat.com --- block.c |6 +++--- block/iscsi.c |2 +- block/raw-posix.c |4 ++-- 3 files changed, 6

[Qemu-block] [PATCH v2 4/5] raw-posix: Use DPRINTF for DEBUG_FLOPPY

2015-05-08 Thread Dimitris Aragiorgis
Get rid of several #ifdef DEBUG_FLOPPY and substitute them with DPRINTF. Signed-off-by: Dimitris Aragiorgis dim...@arrikto.com --- block/raw-posix.c | 20 +--- 1 file changed, 5 insertions(+), 15 deletions(-) diff --git a/block/raw-posix.c b/block/raw-posix.c index fbccca8

[Qemu-block] [PATCH v2 2/5] Fix migration in case of scsi-generic

2015-05-08 Thread Dimitris Aragiorgis
never reach). Signed-off-by: Dimitris Aragiorgis dim...@arrikto.com --- block/io.c|2 +- block/iscsi.c |4 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/block/io.c b/block/io.c index 1ce62c4..d248a4d 100644 --- a/block/io.c +++ b/block/io.c @@ -2231,7 +2231,7 @@ int

[Qemu-block] [PATCH v2 3/5] raw-posix: DPRINTF instead of DEBUG_BLOCK_PRINT

2015-05-08 Thread Dimitris Aragiorgis
Building the QEMU tools fails if we #define DEBUG_BLOCK inside block/raw-posix.c. Here instead of adding qemu-log.o in block-obj-y so that DEBUG_BLOCK_PRINT can be used, we substitute the latter with a simple DPRINTF(). Signed-off-by: Dimitris Aragiorgis dim...@arrikto.com --- block/raw-posix.c

[Qemu-block] [PATCH 4/4] block: Include qemu-log.o in block-obj-y

2015-05-08 Thread Dimitris Aragiorgis
Building the QEMU tools fails if we #define DEBUG_BLOCK inside block/raw-posix.c. This happens because qemu-log.o is missing from block-obj-y, which causes the link to fail. Fix this. Signed-off-by: Dimitris Aragiorgis dim...@arrikto.com --- Makefile.objs |2 +- 1 file changed, 1 insertion

[Qemu-block] [PATCH 0/4] Some fixes related to scsi-generic

2015-05-08 Thread Dimitris Aragiorgis
Hi all, These four patches make slight changes to the way QEMU handles SCSI generic devices to fix a number of small problems. I am sending them against the master branch, since I don't know if they can be considered bugfixes. Thanks, dimara Dimitris Aragiorgis (4): Fix migration in case

[Qemu-block] [PATCH 3/4] raw-posix: Introduce hdev_is_sg()

2015-05-08 Thread Dimitris Aragiorgis
for an SG device (e.g. /dev/sg0) by ensuring that all of the following holds: - The device supports the SG_GET_VERSION_NUM ioctl - The device supports the SG_GET_SCSI_ID ioctl - The specified file name corresponds to a character device Signed-off-by: Dimitris Aragiorgis dim...@arrikto.com

[Qemu-block] [PATCH 1/4] Fix migration in case of scsi-generic

2015-05-08 Thread Dimitris Aragiorgis
, since submitting SCSI commands directly via an SG character device (e.g. /dev/sg0) bypasses the page cache completely, anyway. Signed-off-by: Dimitris Aragiorgis dim...@arrikto.com --- block/io.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/block/io.c b/block/io.c index