All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [PULL 00/19] Block patches
@ 2014-12-19 16:34 Kevin Wolf
  2014-12-19 16:34 ` [Qemu-devel] [PULL 01/19] qemu-iotests: Remove 091 from quick group Kevin Wolf
                   ` (20 more replies)
  0 siblings, 21 replies; 36+ messages in thread
From: Kevin Wolf @ 2014-12-19 16:34 UTC (permalink / raw)
  To: qemu-devel; +Cc: kwolf

The following changes since commit dfa9c2a0f4d0a0c8b2c1449ecdbb1297427e1560:

  Merge remote-tracking branch 'remotes/bonzini/tags/for-upstream' into staging (2014-12-15 16:43:42 +0000)

are available in the git repository at:


  git://repo.or.cz/qemu/kevin.git tags/for-upstream

for you to fetch changes up to 55873077d9e00c4da12ba1068bd9566fc6c32388:

  iotests: Filter out "I/O thread spun..." warning (2014-12-19 17:17:47 +0100)

----------------------------------------------------------------
Block patches for 2.3

----------------------------------------------------------------
Fam Zheng (8):
      qemu-iotests: Remove 091 from quick group
      qemu-iotests: Speed up make check-block
      tests/Makefile: Add check-block to make check
      qapi: Fix document for BlockStats.node-name
      qapi: Comment version info in TransactionAction
      qmp: Add command 'blockdev-backup'
      block: Add blockdev-backup to transaction
      qemu-iotests: Test blockdev-backup in 055

Kevin Wolf (1):
      Merge remote-tracking branch 'mreitz/block' into queue-block

Max Reitz (7):
      checkpatch: Brace handling on multi-line condition
      block: Get full backing filename from string
      block: JSON filenames and relative backing files
      block: Relative backing file for image creation
      block/vmdk: Relative backing file for creation
      iotests: Add test for relative backing file names
      iotests: Filter out "I/O thread spun..." warning

Paolo Bonzini (3):
      block: mark AioContext as recursive
      block: do not allocate an iovec per read of a growable/zero_after_eof BDS
      block: replace g_new0 with g_new for bottom half allocation.

Vladimir Sementsov-Ogievskiy (1):
      block: fix spoiling all dirty bitmaps by mirror and migration

 async.c                          |  11 +-
 block-migration.c                |   5 +-
 block.c                          |  81 ++++++++++++---
 block/backup.c                   |  28 ++++++
 block/mirror.c                   |  11 +-
 block/qapi.c                     |   7 +-
 block/vmdk.c                     |  13 ++-
 blockdev.c                       | 133 ++++++++++++++++++++++++
 include/block/block.h            |  12 ++-
 qapi-schema.json                 |   8 ++
 qapi/block-core.json             |  56 ++++++++++-
 qmp-commands.hx                  |  42 ++++++++
 scripts/checkpatch.pl            |  13 ++-
 tests/Makefile                   |   2 +-
 tests/qemu-iotests-quick.sh      |   2 +-
 tests/qemu-iotests/055           | 211 ++++++++++++++++++++++++++++++++-------
 tests/qemu-iotests/055.out       |   4 +-
 tests/qemu-iotests/067           |   3 +-
 tests/qemu-iotests/071           |   2 +-
 tests/qemu-iotests/071.out       |   8 +-
 tests/qemu-iotests/081           |   2 +-
 tests/qemu-iotests/087           |   3 +-
 tests/qemu-iotests/087.out       |   1 -
 tests/qemu-iotests/099           |   2 +-
 tests/qemu-iotests/110           |  94 +++++++++++++++++
 tests/qemu-iotests/110.out       |  19 ++++
 tests/qemu-iotests/check         |   1 +
 tests/qemu-iotests/common.filter |   1 +
 tests/qemu-iotests/group         |   3 +-
 29 files changed, 692 insertions(+), 86 deletions(-)
 create mode 100755 tests/qemu-iotests/110
 create mode 100644 tests/qemu-iotests/110.out

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

* [Qemu-devel] [PULL 01/19] qemu-iotests: Remove 091 from quick group
  2014-12-19 16:34 [Qemu-devel] [PULL 00/19] Block patches Kevin Wolf
@ 2014-12-19 16:34 ` Kevin Wolf
  2014-12-19 16:34 ` [Qemu-devel] [PULL 02/19] qemu-iotests: Speed up make check-block Kevin Wolf
                   ` (19 subsequent siblings)
  20 siblings, 0 replies; 36+ messages in thread
From: Kevin Wolf @ 2014-12-19 16:34 UTC (permalink / raw)
  To: qemu-devel; +Cc: kwolf

From: Fam Zheng <famz@redhat.com>

For the purpose of allowing running quick group on tmpfs.

Signed-off-by: Fam Zheng <famz@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
---
 tests/qemu-iotests/group | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tests/qemu-iotests/group b/tests/qemu-iotests/group
index a4742c6..08099b9 100644
--- a/tests/qemu-iotests/group
+++ b/tests/qemu-iotests/group
@@ -97,7 +97,7 @@
 088 rw auto quick
 089 rw auto quick
 090 rw auto quick
-091 rw auto quick
+091 rw auto
 092 rw auto quick
 095 rw auto quick
 097 rw auto backing
-- 
1.8.3.1

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

* [Qemu-devel] [PULL 02/19] qemu-iotests: Speed up make check-block
  2014-12-19 16:34 [Qemu-devel] [PULL 00/19] Block patches Kevin Wolf
  2014-12-19 16:34 ` [Qemu-devel] [PULL 01/19] qemu-iotests: Remove 091 from quick group Kevin Wolf
@ 2014-12-19 16:34 ` Kevin Wolf
  2014-12-19 16:34 ` [Qemu-devel] [PULL 03/19] tests/Makefile: Add check-block to make check Kevin Wolf
                   ` (18 subsequent siblings)
  20 siblings, 0 replies; 36+ messages in thread
From: Kevin Wolf @ 2014-12-19 16:34 UTC (permalink / raw)
  To: qemu-devel; +Cc: kwolf

From: Fam Zheng <famz@redhat.com>

Using /tmp, which is usually mounted as tmpfs, the quick group can be
quicker.

On my laptop (Lenovo T430s with Fedora 20), this reduces the time from
50s to 30s.

Signed-off-by: Fam Zheng <famz@redhat.com>
Reviewed-by: Max Reitz <mreitz@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
---
 tests/qemu-iotests-quick.sh | 2 +-
 tests/qemu-iotests/check    | 1 +
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/tests/qemu-iotests-quick.sh b/tests/qemu-iotests-quick.sh
index 12af731..0e554bb 100755
--- a/tests/qemu-iotests-quick.sh
+++ b/tests/qemu-iotests-quick.sh
@@ -3,6 +3,6 @@
 cd tests/qemu-iotests
 
 ret=0
-./check -T -qcow2 -g quick || ret=1
+TEST_DIR=${TEST_DIR:-/tmp/qemu-iotests-quick-$$} ./check -T -qcow2 -g quick || ret=1
 
 exit $ret
diff --git a/tests/qemu-iotests/check b/tests/qemu-iotests/check
index 8ca4011..baeae80 100755
--- a/tests/qemu-iotests/check
+++ b/tests/qemu-iotests/check
@@ -238,6 +238,7 @@ QEMU_NBD      -- $QEMU_NBD
 IMGFMT        -- $FULL_IMGFMT_DETAILS
 IMGPROTO      -- $FULL_IMGPROTO_DETAILS
 PLATFORM      -- $FULL_HOST_DETAILS
+TEST_DIR      -- $TEST_DIR
 SOCKET_SCM_HELPER -- $SOCKET_SCM_HELPER
 
 EOF
-- 
1.8.3.1

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

* [Qemu-devel] [PULL 03/19] tests/Makefile: Add check-block to make check
  2014-12-19 16:34 [Qemu-devel] [PULL 00/19] Block patches Kevin Wolf
  2014-12-19 16:34 ` [Qemu-devel] [PULL 01/19] qemu-iotests: Remove 091 from quick group Kevin Wolf
  2014-12-19 16:34 ` [Qemu-devel] [PULL 02/19] qemu-iotests: Speed up make check-block Kevin Wolf
@ 2014-12-19 16:34 ` Kevin Wolf
  2014-12-19 16:34 ` [Qemu-devel] [PULL 04/19] block: mark AioContext as recursive Kevin Wolf
                   ` (17 subsequent siblings)
  20 siblings, 0 replies; 36+ messages in thread
From: Kevin Wolf @ 2014-12-19 16:34 UTC (permalink / raw)
  To: qemu-devel; +Cc: kwolf

From: Fam Zheng <famz@redhat.com>

Signed-off-by: Fam Zheng <famz@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
---
 tests/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tests/Makefile b/tests/Makefile
index 16f0e4c..f430b18 100644
--- a/tests/Makefile
+++ b/tests/Makefile
@@ -463,7 +463,7 @@ check-qapi-schema: $(patsubst %,check-%, $(check-qapi-schema-y))
 check-qtest: $(patsubst %,check-qtest-%, $(QTEST_TARGETS))
 check-unit: $(patsubst %,check-%, $(check-unit-y))
 check-block: $(patsubst %,check-%, $(check-block-y))
-check: check-qapi-schema check-unit check-qtest
+check: check-qapi-schema check-unit check-qtest check-block
 check-clean:
 	$(MAKE) -C tests/tcg clean
 	rm -rf $(check-unit-y) tests/*.o $(QEMU_IOTESTS_HELPERS-y)
-- 
1.8.3.1

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

* [Qemu-devel] [PULL 04/19] block: mark AioContext as recursive
  2014-12-19 16:34 [Qemu-devel] [PULL 00/19] Block patches Kevin Wolf
                   ` (2 preceding siblings ...)
  2014-12-19 16:34 ` [Qemu-devel] [PULL 03/19] tests/Makefile: Add check-block to make check Kevin Wolf
@ 2014-12-19 16:34 ` Kevin Wolf
  2014-12-19 16:34 ` [Qemu-devel] [PULL 05/19] block: do not allocate an iovec per read of a growable/zero_after_eof BDS Kevin Wolf
                   ` (16 subsequent siblings)
  20 siblings, 0 replies; 36+ messages in thread
From: Kevin Wolf @ 2014-12-19 16:34 UTC (permalink / raw)
  To: qemu-devel; +Cc: kwolf

From: Paolo Bonzini <pbonzini@redhat.com>

AioContext can be accessed recursively, in fact that's what we do with
aio_poll.  Marking the GSource as recursive avoids that GLib blocks it
and unblocks it around every call to aio_dispatch, which is a pretty
expensive operation.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
---
 async.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/async.c b/async.c
index 3939b79..572f239 100644
--- a/async.c
+++ b/async.c
@@ -300,6 +300,7 @@ AioContext *aio_context_new(Error **errp)
         error_setg_errno(errp, -ret, "Failed to initialize event notifier");
         return NULL;
     }
+    g_source_set_can_recurse(&ctx->source, true);
     aio_set_event_notifier(ctx, &ctx->notifier,
                            (EventNotifierHandler *)
                            event_notifier_test_and_clear);
-- 
1.8.3.1

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

* [Qemu-devel] [PULL 05/19] block: do not allocate an iovec per read of a growable/zero_after_eof BDS
  2014-12-19 16:34 [Qemu-devel] [PULL 00/19] Block patches Kevin Wolf
                   ` (3 preceding siblings ...)
  2014-12-19 16:34 ` [Qemu-devel] [PULL 04/19] block: mark AioContext as recursive Kevin Wolf
@ 2014-12-19 16:34 ` Kevin Wolf
  2014-12-19 16:34 ` [Qemu-devel] [PULL 06/19] block: replace g_new0 with g_new for bottom half allocation Kevin Wolf
                   ` (15 subsequent siblings)
  20 siblings, 0 replies; 36+ messages in thread
From: Kevin Wolf @ 2014-12-19 16:34 UTC (permalink / raw)
  To: qemu-devel; +Cc: kwolf

From: Paolo Bonzini <pbonzini@redhat.com>

Most reads do not go past the end of the file, and they can use the
input QEMUIOVector instead of creating one.  This removes the
qemu_iovec_* functions from the profile.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
---
 block.c | 12 +++++-------
 1 file changed, 5 insertions(+), 7 deletions(-)

diff --git a/block.c b/block.c
index 4165d42..58f8042 100644
--- a/block.c
+++ b/block.c
@@ -3034,18 +3034,16 @@ static int coroutine_fn bdrv_aligned_preadv(BlockDriverState *bs,
 
         max_nb_sectors = ROUND_UP(MAX(0, total_sectors - sector_num),
                                   align >> BDRV_SECTOR_BITS);
-        if (max_nb_sectors > 0) {
+        if (nb_sectors < max_nb_sectors) {
+            ret = drv->bdrv_co_readv(bs, sector_num, nb_sectors, qiov);
+        } else if (max_nb_sectors > 0) {
             QEMUIOVector local_qiov;
-            size_t local_sectors;
-
-            max_nb_sectors = MIN(max_nb_sectors, SIZE_MAX / BDRV_SECTOR_BITS);
-            local_sectors = MIN(max_nb_sectors, nb_sectors);
 
             qemu_iovec_init(&local_qiov, qiov->niov);
             qemu_iovec_concat(&local_qiov, qiov, 0,
-                              local_sectors * BDRV_SECTOR_SIZE);
+                              max_nb_sectors * BDRV_SECTOR_SIZE);
 
-            ret = drv->bdrv_co_readv(bs, sector_num, local_sectors,
+            ret = drv->bdrv_co_readv(bs, sector_num, max_nb_sectors,
                                      &local_qiov);
 
             qemu_iovec_destroy(&local_qiov);
-- 
1.8.3.1

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

* [Qemu-devel] [PULL 06/19] block: replace g_new0 with g_new for bottom half allocation.
  2014-12-19 16:34 [Qemu-devel] [PULL 00/19] Block patches Kevin Wolf
                   ` (4 preceding siblings ...)
  2014-12-19 16:34 ` [Qemu-devel] [PULL 05/19] block: do not allocate an iovec per read of a growable/zero_after_eof BDS Kevin Wolf
@ 2014-12-19 16:34 ` Kevin Wolf
  2014-12-19 16:34 ` [Qemu-devel] [PULL 07/19] checkpatch: Brace handling on multi-line condition Kevin Wolf
                   ` (14 subsequent siblings)
  20 siblings, 0 replies; 36+ messages in thread
From: Kevin Wolf @ 2014-12-19 16:34 UTC (permalink / raw)
  To: qemu-devel; +Cc: kwolf

From: Paolo Bonzini <pbonzini@redhat.com>

This saves about 15% of the clock cycles spent on allocation.  Using the
slice allocator does not add a visible improvement; allocation is faster
than malloc, while freeing seems to be slower.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
---
 async.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/async.c b/async.c
index 572f239..2be88cc 100644
--- a/async.c
+++ b/async.c
@@ -44,10 +44,12 @@ struct QEMUBH {
 QEMUBH *aio_bh_new(AioContext *ctx, QEMUBHFunc *cb, void *opaque)
 {
     QEMUBH *bh;
-    bh = g_new0(QEMUBH, 1);
-    bh->ctx = ctx;
-    bh->cb = cb;
-    bh->opaque = opaque;
+    bh = g_new(QEMUBH, 1);
+    *bh = (QEMUBH){
+        .ctx = ctx,
+        .cb = cb,
+        .opaque = opaque,
+    };
     qemu_mutex_lock(&ctx->bh_lock);
     bh->next = ctx->first_bh;
     /* Make sure that the members are ready before putting bh into list */
-- 
1.8.3.1

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

* [Qemu-devel] [PULL 07/19] checkpatch: Brace handling on multi-line condition
  2014-12-19 16:34 [Qemu-devel] [PULL 00/19] Block patches Kevin Wolf
                   ` (5 preceding siblings ...)
  2014-12-19 16:34 ` [Qemu-devel] [PULL 06/19] block: replace g_new0 with g_new for bottom half allocation Kevin Wolf
@ 2014-12-19 16:34 ` Kevin Wolf
  2014-12-19 16:34 ` [Qemu-devel] [PULL 08/19] block: Get full backing filename from string Kevin Wolf
                   ` (13 subsequent siblings)
  20 siblings, 0 replies; 36+ messages in thread
From: Kevin Wolf @ 2014-12-19 16:34 UTC (permalink / raw)
  To: qemu-devel; +Cc: kwolf

From: Max Reitz <mreitz@redhat.com>

CODING_STYLE states the following about braces around blocks:

> The opening brace is on the line that contains the control flow
> statement that introduces the new block; [...]

This is obviously impossible with multi-line conditions. Therefore,
CODING_STYLE does not make any clear statement about where to put the
opening brace after a multi-line condition.

There is a reason to prefer to place the opening brace on an own line
after such a condition while still placing it on the same line as the
"control flow statement" if possible; that reason is that the last line
of a multi-line condition is indented, in the case of "if", it is often
indented by four spaces, just as much as the first statement in the
block will be indented. This is hard to read as there is no clearly
visible distinction between condition and block. Placing the opening
brace on a separate line solves this issue.

Also, there are cases where placing the opening brace on a separate line
is the only viable option; if the previous line had nearly 80 characters
and splitting it is not desirable, the opening brace is naturally placed
on an own line.

This patch fixes checkpatch.pl to not complain about braces on own lines
if the condition introducing the block spanned more than one line, or if
the previous line had 79 or 80 characters.

Furthermore, the warning about not having braces around a block is fixed
to mind braces not being on the last line of the condition.

Signed-off-by: Max Reitz <mreitz@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
---
 scripts/checkpatch.pl | 13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)

diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index 053e432..5df61f9 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -1639,7 +1639,13 @@ sub process {
 			#print "realcnt<$realcnt> ctx_cnt<$ctx_cnt>\n";
 			#print "pre<$pre_ctx>\nline<$line>\nctx<$ctx>\nnext<$lines[$ctx_ln - 1]>\n";
 
-			if ($ctx !~ /{\s*/ && defined($lines[$ctx_ln -1]) && $lines[$ctx_ln - 1] =~ /^\+\s*{/) {
+			# The length of the "previous line" is checked against 80 because it
+			# includes the + at the beginning of the line (if the actual line has
+			# 79 or 80 characters, it is no longer possible to add a space and an
+			# opening brace there)
+			if ($#ctx == 0 && $ctx !~ /{\s*/ &&
+			    defined($lines[$ctx_ln - 1]) && $lines[$ctx_ln - 1] =~ /^\+\s*{/ &&
+			    defined($lines[$ctx_ln - 2]) && length($lines[$ctx_ln - 2]) < 80) {
 				ERROR("that open brace { should be on the previous line\n" .
 					"$here\n$ctx\n$rawlines[$ctx_ln - 1]\n");
 			}
@@ -2542,7 +2548,10 @@ sub process {
 
 					substr($block, 0, length($cond), '');
 
-					$seen++ if ($block =~ /^\s*{/);
+					my $spaced_block = $block;
+					$spaced_block =~ s/\n\+/ /g;
+
+					$seen++ if ($spaced_block =~ /^\s*{/);
 
                                         print "APW: cond<$cond> block<$block> allowed<$allowed>\n"
                                             if $dbg_adv_apw;
-- 
1.8.3.1

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

* [Qemu-devel] [PULL 08/19] block: Get full backing filename from string
  2014-12-19 16:34 [Qemu-devel] [PULL 00/19] Block patches Kevin Wolf
                   ` (6 preceding siblings ...)
  2014-12-19 16:34 ` [Qemu-devel] [PULL 07/19] checkpatch: Brace handling on multi-line condition Kevin Wolf
@ 2014-12-19 16:34 ` Kevin Wolf
  2014-12-19 16:34 ` [Qemu-devel] [PULL 09/19] block: JSON filenames and relative backing files Kevin Wolf
                   ` (12 subsequent siblings)
  20 siblings, 0 replies; 36+ messages in thread
From: Kevin Wolf @ 2014-12-19 16:34 UTC (permalink / raw)
  To: qemu-devel; +Cc: kwolf

From: Max Reitz <mreitz@redhat.com>

Introduce bdrv_get_full_backing_filename_from_filename(), a function
which takes the name of the backed file and a potentially relative
backing filename to produce the full (absolute) backing filename.

Use this function from bdrv_get_full_backing_filename().

Signed-off-by: Max Reitz <mreitz@redhat.com>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Fam Zheng <famz@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
---
 block.c               | 16 ++++++++++++----
 include/block/block.h |  3 +++
 2 files changed, 15 insertions(+), 4 deletions(-)

diff --git a/block.c b/block.c
index 58f8042..86f2faa 100644
--- a/block.c
+++ b/block.c
@@ -303,15 +303,23 @@ void path_combine(char *dest, int dest_size,
     }
 }
 
-void bdrv_get_full_backing_filename(BlockDriverState *bs, char *dest, size_t sz)
+void bdrv_get_full_backing_filename_from_filename(const char *backed,
+                                                  const char *backing,
+                                                  char *dest, size_t sz)
 {
-    if (bs->backing_file[0] == '\0' || path_has_protocol(bs->backing_file)) {
-        pstrcpy(dest, sz, bs->backing_file);
+    if (backing[0] == '\0' || path_has_protocol(backing)) {
+        pstrcpy(dest, sz, backing);
     } else {
-        path_combine(dest, sz, bs->filename, bs->backing_file);
+        path_combine(dest, sz, backed, backing);
     }
 }
 
+void bdrv_get_full_backing_filename(BlockDriverState *bs, char *dest, size_t sz)
+{
+    bdrv_get_full_backing_filename_from_filename(bs->filename, bs->backing_file,
+                                                 dest, sz);
+}
+
 void bdrv_register(BlockDriver *bdrv)
 {
     /* Block drivers without coroutine functions need emulation */
diff --git a/include/block/block.h b/include/block/block.h
index 6e7275d..eac9bb0 100644
--- a/include/block/block.h
+++ b/include/block/block.h
@@ -397,6 +397,9 @@ void bdrv_get_backing_filename(BlockDriverState *bs,
                                char *filename, int filename_size);
 void bdrv_get_full_backing_filename(BlockDriverState *bs,
                                     char *dest, size_t sz);
+void bdrv_get_full_backing_filename_from_filename(const char *backed,
+                                                  const char *backing,
+                                                  char *dest, size_t sz);
 int bdrv_is_snapshot(BlockDriverState *bs);
 
 int path_has_protocol(const char *path);
-- 
1.8.3.1

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

* [Qemu-devel] [PULL 09/19] block: JSON filenames and relative backing files
  2014-12-19 16:34 [Qemu-devel] [PULL 00/19] Block patches Kevin Wolf
                   ` (7 preceding siblings ...)
  2014-12-19 16:34 ` [Qemu-devel] [PULL 08/19] block: Get full backing filename from string Kevin Wolf
@ 2014-12-19 16:34 ` Kevin Wolf
  2014-12-19 16:35 ` [Qemu-devel] [PULL 10/19] block: Relative backing file for image creation Kevin Wolf
                   ` (11 subsequent siblings)
  20 siblings, 0 replies; 36+ messages in thread
From: Kevin Wolf @ 2014-12-19 16:34 UTC (permalink / raw)
  To: qemu-devel; +Cc: kwolf

From: Max Reitz <mreitz@redhat.com>

When using a relative backing file name, qemu needs to know the
directory of the top image file. For JSON filenames, such a directory
cannot be easily determined (e.g. how do you determine the directory of
a qcow2 BDS directly on top of a quorum BDS?). Therefore, do not allow
relative filenames for the backing file of BDSs only having a JSON
filename.

Furthermore, BDS::exact_filename should be used whenever possible. If
BDS::filename is not equal to BDS::exact_filename, the former will
always be a JSON object.

Signed-off-by: Max Reitz <mreitz@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
---
 block.c               | 28 ++++++++++++++++++++++------
 block/qapi.c          |  7 ++++++-
 include/block/block.h |  5 +++--
 3 files changed, 31 insertions(+), 9 deletions(-)

diff --git a/block.c b/block.c
index 86f2faa..cf0867c 100644
--- a/block.c
+++ b/block.c
@@ -305,19 +305,28 @@ void path_combine(char *dest, int dest_size,
 
 void bdrv_get_full_backing_filename_from_filename(const char *backed,
                                                   const char *backing,
-                                                  char *dest, size_t sz)
+                                                  char *dest, size_t sz,
+                                                  Error **errp)
 {
-    if (backing[0] == '\0' || path_has_protocol(backing)) {
+    if (backing[0] == '\0' || path_has_protocol(backing) ||
+        path_is_absolute(backing))
+    {
         pstrcpy(dest, sz, backing);
+    } else if (backed[0] == '\0' || strstart(backed, "json:", NULL)) {
+        error_setg(errp, "Cannot use relative backing file names for '%s'",
+                   backed);
     } else {
         path_combine(dest, sz, backed, backing);
     }
 }
 
-void bdrv_get_full_backing_filename(BlockDriverState *bs, char *dest, size_t sz)
+void bdrv_get_full_backing_filename(BlockDriverState *bs, char *dest, size_t sz,
+                                    Error **errp)
 {
-    bdrv_get_full_backing_filename_from_filename(bs->filename, bs->backing_file,
-                                                 dest, sz);
+    char *backed = bs->exact_filename[0] ? bs->exact_filename : bs->filename;
+
+    bdrv_get_full_backing_filename_from_filename(backed, bs->backing_file,
+                                                 dest, sz, errp);
 }
 
 void bdrv_register(BlockDriver *bdrv)
@@ -1225,7 +1234,14 @@ int bdrv_open_backing_file(BlockDriverState *bs, QDict *options, Error **errp)
         QDECREF(options);
         goto free_exit;
     } else {
-        bdrv_get_full_backing_filename(bs, backing_filename, PATH_MAX);
+        bdrv_get_full_backing_filename(bs, backing_filename, PATH_MAX,
+                                       &local_err);
+        if (local_err) {
+            ret = -EINVAL;
+            error_propagate(errp, local_err);
+            QDECREF(options);
+            goto free_exit;
+        }
     }
 
     if (!bs->drv || !bs->drv->supports_backing) {
diff --git a/block/qapi.c b/block/qapi.c
index fa68ba7..a6fd6f7 100644
--- a/block/qapi.c
+++ b/block/qapi.c
@@ -214,7 +214,12 @@ void bdrv_query_image_info(BlockDriverState *bs,
         info->backing_filename = g_strdup(backing_filename);
         info->has_backing_filename = true;
         bdrv_get_full_backing_filename(bs, backing_filename2,
-                                       sizeof(backing_filename2));
+                                       sizeof(backing_filename2), &err);
+        if (err) {
+            error_propagate(errp, err);
+            qapi_free_ImageInfo(info);
+            return;
+        }
 
         if (strcmp(backing_filename, backing_filename2) != 0) {
             info->full_backing_filename =
diff --git a/include/block/block.h b/include/block/block.h
index eac9bb0..9efaa80 100644
--- a/include/block/block.h
+++ b/include/block/block.h
@@ -396,10 +396,11 @@ const char *bdrv_get_encrypted_filename(BlockDriverState *bs);
 void bdrv_get_backing_filename(BlockDriverState *bs,
                                char *filename, int filename_size);
 void bdrv_get_full_backing_filename(BlockDriverState *bs,
-                                    char *dest, size_t sz);
+                                    char *dest, size_t sz, Error **errp);
 void bdrv_get_full_backing_filename_from_filename(const char *backed,
                                                   const char *backing,
-                                                  char *dest, size_t sz);
+                                                  char *dest, size_t sz,
+                                                  Error **errp);
 int bdrv_is_snapshot(BlockDriverState *bs);
 
 int path_has_protocol(const char *path);
-- 
1.8.3.1

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

* [Qemu-devel] [PULL 10/19] block: Relative backing file for image creation
  2014-12-19 16:34 [Qemu-devel] [PULL 00/19] Block patches Kevin Wolf
                   ` (8 preceding siblings ...)
  2014-12-19 16:34 ` [Qemu-devel] [PULL 09/19] block: JSON filenames and relative backing files Kevin Wolf
@ 2014-12-19 16:35 ` Kevin Wolf
  2014-12-19 16:35 ` [Qemu-devel] [PULL 11/19] block/vmdk: Relative backing file for creation Kevin Wolf
                   ` (10 subsequent siblings)
  20 siblings, 0 replies; 36+ messages in thread
From: Kevin Wolf @ 2014-12-19 16:35 UTC (permalink / raw)
  To: qemu-devel; +Cc: kwolf

From: Max Reitz <mreitz@redhat.com>

Relative backing filenames are always relative to the backed image's
directory; the same applies to image creation. Therefore, if the backing
file has to be opened for determining its size (in case the size has not
been explicitly specified) its filename should be interpreted relative
to the new image's base directory and not relative to qemu's working
directory.

Signed-off-by: Max Reitz <mreitz@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Fam Zheng <famz@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
---
 block.c | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/block.c b/block.c
index cf0867c..be75142 100644
--- a/block.c
+++ b/block.c
@@ -5659,16 +5659,26 @@ void bdrv_img_create(const char *filename, const char *fmt,
     if (size == -1) {
         if (backing_file) {
             BlockDriverState *bs;
+            char *full_backing = g_new0(char, PATH_MAX);
             int64_t size;
             int back_flags;
 
+            bdrv_get_full_backing_filename_from_filename(filename, backing_file,
+                                                         full_backing, PATH_MAX,
+                                                         &local_err);
+            if (local_err) {
+                g_free(full_backing);
+                goto out;
+            }
+
             /* backing files always opened read-only */
             back_flags =
                 flags & ~(BDRV_O_RDWR | BDRV_O_SNAPSHOT | BDRV_O_NO_BACKING);
 
             bs = NULL;
-            ret = bdrv_open(&bs, backing_file, NULL, NULL, back_flags,
+            ret = bdrv_open(&bs, full_backing, NULL, NULL, back_flags,
                             backing_drv, &local_err);
+            g_free(full_backing);
             if (ret < 0) {
                 goto out;
             }
-- 
1.8.3.1

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

* [Qemu-devel] [PULL 11/19] block/vmdk: Relative backing file for creation
  2014-12-19 16:34 [Qemu-devel] [PULL 00/19] Block patches Kevin Wolf
                   ` (9 preceding siblings ...)
  2014-12-19 16:35 ` [Qemu-devel] [PULL 10/19] block: Relative backing file for image creation Kevin Wolf
@ 2014-12-19 16:35 ` Kevin Wolf
  2014-12-19 16:35 ` [Qemu-devel] [PULL 12/19] iotests: Add test for relative backing file names Kevin Wolf
                   ` (9 subsequent siblings)
  20 siblings, 0 replies; 36+ messages in thread
From: Kevin Wolf @ 2014-12-19 16:35 UTC (permalink / raw)
  To: qemu-devel; +Cc: kwolf

From: Max Reitz <mreitz@redhat.com>

When a vmdk image is created with a backing file, it is opened to check
whether it is indeed a vmdk file by letting qemu probe it. When doing
so, the backing filename is relative to the image's base directory so it
should be interpreted accordingly.

Signed-off-by: Max Reitz <mreitz@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Fam Zheng <famz@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
---
 block/vmdk.c | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

diff --git a/block/vmdk.c b/block/vmdk.c
index bfff900..52cb888 100644
--- a/block/vmdk.c
+++ b/block/vmdk.c
@@ -1891,8 +1891,19 @@ static int vmdk_create(const char *filename, QemuOpts *opts, Error **errp)
     }
     if (backing_file) {
         BlockDriverState *bs = NULL;
-        ret = bdrv_open(&bs, backing_file, NULL, NULL, BDRV_O_NO_BACKING, NULL,
+        char *full_backing = g_new0(char, PATH_MAX);
+        bdrv_get_full_backing_filename_from_filename(filename, backing_file,
+                                                     full_backing, PATH_MAX,
+                                                     &local_err);
+        if (local_err) {
+            g_free(full_backing);
+            error_propagate(errp, local_err);
+            ret = -ENOENT;
+            goto exit;
+        }
+        ret = bdrv_open(&bs, full_backing, NULL, NULL, BDRV_O_NO_BACKING, NULL,
                         errp);
+        g_free(full_backing);
         if (ret != 0) {
             goto exit;
         }
-- 
1.8.3.1

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

* [Qemu-devel] [PULL 12/19] iotests: Add test for relative backing file names
  2014-12-19 16:34 [Qemu-devel] [PULL 00/19] Block patches Kevin Wolf
                   ` (10 preceding siblings ...)
  2014-12-19 16:35 ` [Qemu-devel] [PULL 11/19] block/vmdk: Relative backing file for creation Kevin Wolf
@ 2014-12-19 16:35 ` Kevin Wolf
  2014-12-19 16:35 ` [Qemu-devel] [PULL 13/19] qapi: Fix document for BlockStats.node-name Kevin Wolf
                   ` (8 subsequent siblings)
  20 siblings, 0 replies; 36+ messages in thread
From: Kevin Wolf @ 2014-12-19 16:35 UTC (permalink / raw)
  To: qemu-devel; +Cc: kwolf

From: Max Reitz <mreitz@redhat.com>

Sometimes, qemu does not have a filename to work with, so it does not
know which directory to use for a backing file specified by a relative
filename. Add a test which tests that qemu exits with an appropriate
error message.

Additionally, add a test for qemu-img create with a backing filename
relative to the backed image's base directory while omitting the image
size.

Signed-off-by: Max Reitz <mreitz@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Fam Zheng <famz@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
---
 tests/qemu-iotests/110     | 94 ++++++++++++++++++++++++++++++++++++++++++++++
 tests/qemu-iotests/110.out | 19 ++++++++++
 tests/qemu-iotests/group   |  1 +
 3 files changed, 114 insertions(+)
 create mode 100755 tests/qemu-iotests/110
 create mode 100644 tests/qemu-iotests/110.out

diff --git a/tests/qemu-iotests/110 b/tests/qemu-iotests/110
new file mode 100755
index 0000000..a687f95
--- /dev/null
+++ b/tests/qemu-iotests/110
@@ -0,0 +1,94 @@
+#!/bin/bash
+#
+# Test case for relative backing file names in complex BDS trees
+#
+# Copyright (C) 2014 Red Hat, Inc.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+#
+
+# creator
+owner=mreitz@redhat.com
+
+seq="$(basename $0)"
+echo "QA output created by $seq"
+
+here="$PWD"
+tmp=/tmp/$$
+status=1	# failure is the default!
+
+_cleanup()
+{
+	_cleanup_test_img
+}
+trap "_cleanup; exit \$status" 0 1 2 3 15
+
+# get standard environment, filters and checks
+. ./common.rc
+. ./common.filter
+
+# Any format supporting backing files
+_supported_fmt qed qcow qcow2 vmdk
+_supported_proto file
+_supported_os Linux
+_unsupported_imgopts "subformat=monolithicFlat" "subformat=twoGbMaxExtentFlat"
+
+TEST_IMG_REL=$(basename "$TEST_IMG")
+
+echo
+echo '=== Reconstructable filename ==='
+echo
+
+TEST_IMG="$TEST_IMG.base" _make_test_img 64M
+_make_test_img -b "$TEST_IMG_REL.base" 64M
+# qemu should be able to reconstruct the filename, so relative backing names
+# should work
+TEST_IMG="json:{'driver':'$IMGFMT','file':{'driver':'file','filename':'$TEST_IMG'}}" \
+    _img_info | _filter_img_info
+
+echo
+echo '=== Non-reconstructable filename ==='
+echo
+
+# Across blkdebug without a config file, you cannot reconstruct filenames, so
+# qemu is incapable of knowing the directory of the top image
+TEST_IMG="json:{
+    'driver': '$IMGFMT',
+    'file': {
+        'driver': 'blkdebug',
+        'image': {
+            'driver': 'file',
+            'filename': '$TEST_IMG'
+        },
+        'set-state': [
+            {
+                'event': 'read_aio',
+                'new_state': 42
+            }
+        ]
+    }
+}" _img_info | _filter_img_info
+
+echo
+echo '=== Backing name is always relative to the backed image ==='
+echo
+
+# omit the image size; it should work anyway
+_make_test_img -b "$TEST_IMG_REL.base"
+
+
+# success, all done
+echo '*** done'
+rm -f $seq.full
+status=0
diff --git a/tests/qemu-iotests/110.out b/tests/qemu-iotests/110.out
new file mode 100644
index 0000000..152bacf
--- /dev/null
+++ b/tests/qemu-iotests/110.out
@@ -0,0 +1,19 @@
+QA output created by 110
+
+=== Reconstructable filename ===
+
+Formatting 'TEST_DIR/t.IMGFMT.base', fmt=IMGFMT size=67108864
+Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=67108864 backing_file='t.IMGFMT.base'
+image: TEST_DIR/t.IMGFMT
+file format: IMGFMT
+virtual size: 64M (67108864 bytes)
+backing file: t.IMGFMT.base (actual path: TEST_DIR/t.IMGFMT.base)
+
+=== Non-reconstructable filename ===
+
+qemu-img: Cannot use relative backing file names for 'json:{"driver": "IMGFMT", "file": {"set-state.0.event": "read_aio", "image": {"driver": "file", "filename": "TEST_DIR/t.IMGFMT"}, "driver": "blkdebug", "set-state.0.new_state": 42}}'
+
+=== Backing name is always relative to the backed image ===
+
+Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=67108864 backing_file='t.IMGFMT.base'
+*** done
diff --git a/tests/qemu-iotests/group b/tests/qemu-iotests/group
index 08099b9..f8bf354 100644
--- a/tests/qemu-iotests/group
+++ b/tests/qemu-iotests/group
@@ -112,6 +112,7 @@
 107 rw auto quick
 108 rw auto quick
 109 rw auto
+110 rw auto backing quick
 111 rw auto quick
 113 rw auto quick
 114 rw auto quick
-- 
1.8.3.1

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

* [Qemu-devel] [PULL 13/19] qapi: Fix document for BlockStats.node-name
  2014-12-19 16:34 [Qemu-devel] [PULL 00/19] Block patches Kevin Wolf
                   ` (11 preceding siblings ...)
  2014-12-19 16:35 ` [Qemu-devel] [PULL 12/19] iotests: Add test for relative backing file names Kevin Wolf
@ 2014-12-19 16:35 ` Kevin Wolf
  2014-12-19 16:35 ` [Qemu-devel] [PULL 14/19] block: fix spoiling all dirty bitmaps by mirror and migration Kevin Wolf
                   ` (7 subsequent siblings)
  20 siblings, 0 replies; 36+ messages in thread
From: Kevin Wolf @ 2014-12-19 16:35 UTC (permalink / raw)
  To: qemu-devel; +Cc: kwolf

From: Fam Zheng <famz@redhat.com>

Signed-off-by: Fam Zheng <famz@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Message-id: 1418694024-26498-1-git-send-email-famz@redhat.com
Signed-off-by: Max Reitz <mreitz@redhat.com>
---
 qapi/block-core.json | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/qapi/block-core.json b/qapi/block-core.json
index 6e8db15..2d8bd25 100644
--- a/qapi/block-core.json
+++ b/qapi/block-core.json
@@ -423,7 +423,7 @@
 # @device: #optional If the stats are for a virtual block device, the name
 #          corresponding to the virtual block device.
 #
-# @device: #optional The node name of the device. (Since 2.3)
+# @node-name: #optional The node name of the device. (Since 2.3)
 #
 # @stats:  A @BlockDeviceStats for the device.
 #
-- 
1.8.3.1

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

* [Qemu-devel] [PULL 14/19] block: fix spoiling all dirty bitmaps by mirror and migration
  2014-12-19 16:34 [Qemu-devel] [PULL 00/19] Block patches Kevin Wolf
                   ` (12 preceding siblings ...)
  2014-12-19 16:35 ` [Qemu-devel] [PULL 13/19] qapi: Fix document for BlockStats.node-name Kevin Wolf
@ 2014-12-19 16:35 ` Kevin Wolf
  2014-12-19 16:35 ` [Qemu-devel] [PULL 15/19] qapi: Comment version info in TransactionAction Kevin Wolf
                   ` (6 subsequent siblings)
  20 siblings, 0 replies; 36+ messages in thread
From: Kevin Wolf @ 2014-12-19 16:35 UTC (permalink / raw)
  To: qemu-devel; +Cc: kwolf

From: Vladimir Sementsov-Ogievskiy <vsementsov@parallels.com>

Mirror and migration use dirty bitmaps for their purposes, and since
commit [block: per caller dirty bitmap] they use their own bitmaps, not
the global one. But they use old functions bdrv_set_dirty and
bdrv_reset_dirty, which change all dirty bitmaps.

Named dirty bitmaps series by Fam and Snow are affected: mirroring and
migration will spoil all (not related to this mirroring or migration)
named dirty bitmaps.

This patch fixes this by adding bdrv_set_dirty_bitmap and
bdrv_reset_dirty_bitmap, which change concrete bitmap. Also, to prevent
such mistakes in future, old functions bdrv_(set,reset)_dirty are made
static, for internal block usage.

Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@parallels.com>
CC: John Snow <jsnow@redhat.com>
CC: Fam Zheng <famz@redhat.com>
CC: Denis V. Lunev <den@openvz.org>
CC: Stefan Hajnoczi <stefanha@redhat.com>
CC: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: John Snow <jsnow@redhat.com>
Reviewed-by: Fam Zheng <famz@redhat.com>
Message-id: 1417081246-3593-1-git-send-email-vsementsov@parallels.com
Signed-off-by: Max Reitz <mreitz@redhat.com>
---
 block-migration.c     |  5 +++--
 block.c               | 23 ++++++++++++++++++++---
 block/mirror.c        | 11 +++++++----
 include/block/block.h |  6 ++++--
 4 files changed, 34 insertions(+), 11 deletions(-)

diff --git a/block-migration.c b/block-migration.c
index 74d9eb1..a0f908c 100644
--- a/block-migration.c
+++ b/block-migration.c
@@ -303,7 +303,7 @@ static int mig_save_device_bulk(QEMUFile *f, BlkMigDevState *bmds)
     blk->aiocb = bdrv_aio_readv(bs, cur_sector, &blk->qiov,
                                 nr_sectors, blk_mig_read_cb, blk);
 
-    bdrv_reset_dirty(bs, cur_sector, nr_sectors);
+    bdrv_reset_dirty_bitmap(bs, bmds->dirty_bitmap, cur_sector, nr_sectors);
     qemu_mutex_unlock_iothread();
 
     bmds->cur_sector = cur_sector + nr_sectors;
@@ -496,7 +496,8 @@ static int mig_save_device_dirty(QEMUFile *f, BlkMigDevState *bmds,
                 g_free(blk);
             }
 
-            bdrv_reset_dirty(bmds->bs, sector, nr_sectors);
+            bdrv_reset_dirty_bitmap(bmds->bs, bmds->dirty_bitmap, sector,
+                                    nr_sectors);
             break;
         }
         sector += BDRV_SECTORS_PER_DIRTY_CHUNK;
diff --git a/block.c b/block.c
index be75142..e76a223 100644
--- a/block.c
+++ b/block.c
@@ -97,6 +97,10 @@ static QTAILQ_HEAD(, BlockDriverState) graph_bdrv_states =
 static QLIST_HEAD(, BlockDriver) bdrv_drivers =
     QLIST_HEAD_INITIALIZER(bdrv_drivers);
 
+static void bdrv_set_dirty(BlockDriverState *bs, int64_t cur_sector,
+                           int nr_sectors);
+static void bdrv_reset_dirty(BlockDriverState *bs, int64_t cur_sector,
+                             int nr_sectors);
 /* If non-zero, use only whitelisted block drivers */
 static int use_bdrv_whitelist;
 
@@ -5411,8 +5415,20 @@ void bdrv_dirty_iter_init(BlockDriverState *bs,
     hbitmap_iter_init(hbi, bitmap->bitmap, 0);
 }
 
-void bdrv_set_dirty(BlockDriverState *bs, int64_t cur_sector,
-                    int nr_sectors)
+void bdrv_set_dirty_bitmap(BlockDriverState *bs, BdrvDirtyBitmap *bitmap,
+                           int64_t cur_sector, int nr_sectors)
+{
+    hbitmap_set(bitmap->bitmap, cur_sector, nr_sectors);
+}
+
+void bdrv_reset_dirty_bitmap(BlockDriverState *bs, BdrvDirtyBitmap *bitmap,
+                             int64_t cur_sector, int nr_sectors)
+{
+    hbitmap_reset(bitmap->bitmap, cur_sector, nr_sectors);
+}
+
+static void bdrv_set_dirty(BlockDriverState *bs, int64_t cur_sector,
+                           int nr_sectors)
 {
     BdrvDirtyBitmap *bitmap;
     QLIST_FOREACH(bitmap, &bs->dirty_bitmaps, list) {
@@ -5420,7 +5436,8 @@ void bdrv_set_dirty(BlockDriverState *bs, int64_t cur_sector,
     }
 }
 
-void bdrv_reset_dirty(BlockDriverState *bs, int64_t cur_sector, int nr_sectors)
+static void bdrv_reset_dirty(BlockDriverState *bs, int64_t cur_sector,
+                             int nr_sectors)
 {
     BdrvDirtyBitmap *bitmap;
     QLIST_FOREACH(bitmap, &bs->dirty_bitmaps, list) {
diff --git a/block/mirror.c b/block/mirror.c
index 2c6dd2a..9019d1b 100644
--- a/block/mirror.c
+++ b/block/mirror.c
@@ -128,7 +128,8 @@ static void mirror_write_complete(void *opaque, int ret)
         BlockDriverState *source = s->common.bs;
         BlockErrorAction action;
 
-        bdrv_set_dirty(source, op->sector_num, op->nb_sectors);
+        bdrv_set_dirty_bitmap(source, s->dirty_bitmap, op->sector_num,
+                              op->nb_sectors);
         action = mirror_error_action(s, false, -ret);
         if (action == BLOCK_ERROR_ACTION_REPORT && s->ret >= 0) {
             s->ret = ret;
@@ -145,7 +146,8 @@ static void mirror_read_complete(void *opaque, int ret)
         BlockDriverState *source = s->common.bs;
         BlockErrorAction action;
 
-        bdrv_set_dirty(source, op->sector_num, op->nb_sectors);
+        bdrv_set_dirty_bitmap(source, s->dirty_bitmap, op->sector_num,
+                              op->nb_sectors);
         action = mirror_error_action(s, true, -ret);
         if (action == BLOCK_ERROR_ACTION_REPORT && s->ret >= 0) {
             s->ret = ret;
@@ -286,7 +288,8 @@ static uint64_t coroutine_fn mirror_iteration(MirrorBlockJob *s)
         next_sector += sectors_per_chunk;
     }
 
-    bdrv_reset_dirty(source, sector_num, nb_sectors);
+    bdrv_reset_dirty_bitmap(source, s->dirty_bitmap, sector_num,
+                            nb_sectors);
 
     /* Copy the dirty cluster.  */
     s->in_flight++;
@@ -442,7 +445,7 @@ static void coroutine_fn mirror_run(void *opaque)
 
             assert(n > 0);
             if (ret == 1) {
-                bdrv_set_dirty(bs, sector_num, n);
+                bdrv_set_dirty_bitmap(bs, s->dirty_bitmap, sector_num, n);
                 sector_num = next;
             } else {
                 sector_num += n;
diff --git a/include/block/block.h b/include/block/block.h
index 9efaa80..760e78b 100644
--- a/include/block/block.h
+++ b/include/block/block.h
@@ -438,8 +438,10 @@ BdrvDirtyBitmap *bdrv_create_dirty_bitmap(BlockDriverState *bs, int granularity,
 void bdrv_release_dirty_bitmap(BlockDriverState *bs, BdrvDirtyBitmap *bitmap);
 BlockDirtyInfoList *bdrv_query_dirty_bitmaps(BlockDriverState *bs);
 int bdrv_get_dirty(BlockDriverState *bs, BdrvDirtyBitmap *bitmap, int64_t sector);
-void bdrv_set_dirty(BlockDriverState *bs, int64_t cur_sector, int nr_sectors);
-void bdrv_reset_dirty(BlockDriverState *bs, int64_t cur_sector, int nr_sectors);
+void bdrv_set_dirty_bitmap(BlockDriverState *bs, BdrvDirtyBitmap *bitmap,
+                           int64_t cur_sector, int nr_sectors);
+void bdrv_reset_dirty_bitmap(BlockDriverState *bs, BdrvDirtyBitmap *bitmap,
+                             int64_t cur_sector, int nr_sectors);
 void bdrv_dirty_iter_init(BlockDriverState *bs,
                           BdrvDirtyBitmap *bitmap, struct HBitmapIter *hbi);
 int64_t bdrv_get_dirty_count(BlockDriverState *bs, BdrvDirtyBitmap *bitmap);
-- 
1.8.3.1

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

* [Qemu-devel] [PULL 15/19] qapi: Comment version info in TransactionAction
  2014-12-19 16:34 [Qemu-devel] [PULL 00/19] Block patches Kevin Wolf
                   ` (13 preceding siblings ...)
  2014-12-19 16:35 ` [Qemu-devel] [PULL 14/19] block: fix spoiling all dirty bitmaps by mirror and migration Kevin Wolf
@ 2014-12-19 16:35 ` Kevin Wolf
  2014-12-19 16:35 ` [Qemu-devel] [PULL 16/19] qmp: Add command 'blockdev-backup' Kevin Wolf
                   ` (5 subsequent siblings)
  20 siblings, 0 replies; 36+ messages in thread
From: Kevin Wolf @ 2014-12-19 16:35 UTC (permalink / raw)
  To: qemu-devel; +Cc: kwolf

From: Fam Zheng <famz@redhat.com>

Signed-off-by: Fam Zheng <famz@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Max Reitz <mreitz@redhat.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Message-id: 1418899027-8445-2-git-send-email-famz@redhat.com
Signed-off-by: Max Reitz <mreitz@redhat.com>
---
 qapi-schema.json | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/qapi-schema.json b/qapi-schema.json
index 563b4ad..47d99cf 100644
--- a/qapi-schema.json
+++ b/qapi-schema.json
@@ -1254,6 +1254,12 @@
 #
 # A discriminated record of operations that can be performed with
 # @transaction.
+#
+# Since 1.1
+#
+# drive-backup since 1.6
+# abort since 1.6
+# blockdev-snapshot-internal-sync since 1.7
 ##
 { 'union': 'TransactionAction',
   'data': {
-- 
1.8.3.1

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

* [Qemu-devel] [PULL 16/19] qmp: Add command 'blockdev-backup'
  2014-12-19 16:34 [Qemu-devel] [PULL 00/19] Block patches Kevin Wolf
                   ` (14 preceding siblings ...)
  2014-12-19 16:35 ` [Qemu-devel] [PULL 15/19] qapi: Comment version info in TransactionAction Kevin Wolf
@ 2014-12-19 16:35 ` Kevin Wolf
  2014-12-19 16:35 ` [Qemu-devel] [PULL 17/19] block: Add blockdev-backup to transaction Kevin Wolf
                   ` (4 subsequent siblings)
  20 siblings, 0 replies; 36+ messages in thread
From: Kevin Wolf @ 2014-12-19 16:35 UTC (permalink / raw)
  To: qemu-devel; +Cc: kwolf

From: Fam Zheng <famz@redhat.com>

Similar to drive-backup, but this command uses a device id as target
instead of creating/opening an image file.

Also add blocker on target bs, since the target is also a named device
now.

Add check and report error for bs == target which became possible but is
an illegal case with introduction of blockdev-backup.

Signed-off-by: Fam Zheng <famz@redhat.com>
Reviewed-by: Max Reitz <mreitz@redhat.com>
Reviewed-by: John Snow <jsnow@redhat.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Message-id: 1418899027-8445-3-git-send-email-famz@redhat.com
Signed-off-by: Max Reitz <mreitz@redhat.com>
---
 block/backup.c       | 28 +++++++++++++++++++++++++++
 blockdev.c           | 54 ++++++++++++++++++++++++++++++++++++++++++++++++++++
 qapi/block-core.json | 54 ++++++++++++++++++++++++++++++++++++++++++++++++++++
 qmp-commands.hx      | 42 ++++++++++++++++++++++++++++++++++++++++
 4 files changed, 178 insertions(+)

diff --git a/block/backup.c b/block/backup.c
index 792e655..1c535b1 100644
--- a/block/backup.c
+++ b/block/backup.c
@@ -360,6 +360,7 @@ static void coroutine_fn backup_run(void *opaque)
     hbitmap_free(job->bitmap);
 
     bdrv_iostatus_disable(target);
+    bdrv_op_unblock_all(target, job->common.blocker);
 
     data = g_malloc(sizeof(*data));
     data->ret = ret;
@@ -379,6 +380,11 @@ void backup_start(BlockDriverState *bs, BlockDriverState *target,
     assert(target);
     assert(cb);
 
+    if (bs == target) {
+        error_setg(errp, "Source and target cannot be the same");
+        return;
+    }
+
     if ((on_source_error == BLOCKDEV_ON_ERROR_STOP ||
          on_source_error == BLOCKDEV_ON_ERROR_ENOSPC) &&
         !bdrv_iostatus_is_enabled(bs)) {
@@ -386,6 +392,26 @@ void backup_start(BlockDriverState *bs, BlockDriverState *target,
         return;
     }
 
+    if (!bdrv_is_inserted(bs)) {
+        error_setg(errp, "Device is not inserted: %s",
+                   bdrv_get_device_name(bs));
+        return;
+    }
+
+    if (!bdrv_is_inserted(target)) {
+        error_setg(errp, "Device is not inserted: %s",
+                   bdrv_get_device_name(target));
+        return;
+    }
+
+    if (bdrv_op_is_blocked(bs, BLOCK_OP_TYPE_BACKUP_SOURCE, errp)) {
+        return;
+    }
+
+    if (bdrv_op_is_blocked(target, BLOCK_OP_TYPE_BACKUP_TARGET, errp)) {
+        return;
+    }
+
     len = bdrv_getlength(bs);
     if (len < 0) {
         error_setg_errno(errp, -len, "unable to get length for '%s'",
@@ -399,6 +425,8 @@ void backup_start(BlockDriverState *bs, BlockDriverState *target,
         return;
     }
 
+    bdrv_op_block_all(target, job->common.blocker);
+
     job->on_source_error = on_source_error;
     job->on_target_error = on_target_error;
     job->target = target;
diff --git a/blockdev.c b/blockdev.c
index 5651a8e..d6ccc5e 100644
--- a/blockdev.c
+++ b/blockdev.c
@@ -2240,6 +2240,8 @@ void qmp_drive_backup(const char *device, const char *target,
     aio_context = bdrv_get_aio_context(bs);
     aio_context_acquire(aio_context);
 
+    /* Although backup_run has this check too, we need to use bs->drv below, so
+     * do an early check redundantly. */
     if (!bdrv_is_inserted(bs)) {
         error_set(errp, QERR_DEVICE_HAS_NO_MEDIUM, device);
         goto out;
@@ -2256,6 +2258,7 @@ void qmp_drive_backup(const char *device, const char *target,
         }
     }
 
+    /* Early check to avoid creating target */
     if (bdrv_op_is_blocked(bs, BLOCK_OP_TYPE_BACKUP_SOURCE, errp)) {
         goto out;
     }
@@ -2323,6 +2326,57 @@ BlockDeviceInfoList *qmp_query_named_block_nodes(Error **errp)
     return bdrv_named_nodes_list();
 }
 
+void qmp_blockdev_backup(const char *device, const char *target,
+                         enum MirrorSyncMode sync,
+                         bool has_speed, int64_t speed,
+                         bool has_on_source_error,
+                         BlockdevOnError on_source_error,
+                         bool has_on_target_error,
+                         BlockdevOnError on_target_error,
+                         Error **errp)
+{
+    BlockDriverState *bs;
+    BlockDriverState *target_bs;
+    Error *local_err = NULL;
+    AioContext *aio_context;
+
+    if (!has_speed) {
+        speed = 0;
+    }
+    if (!has_on_source_error) {
+        on_source_error = BLOCKDEV_ON_ERROR_REPORT;
+    }
+    if (!has_on_target_error) {
+        on_target_error = BLOCKDEV_ON_ERROR_REPORT;
+    }
+
+    bs = bdrv_find(device);
+    if (!bs) {
+        error_set(errp, QERR_DEVICE_NOT_FOUND, device);
+        return;
+    }
+
+    aio_context = bdrv_get_aio_context(bs);
+    aio_context_acquire(aio_context);
+
+    target_bs = bdrv_find(target);
+    if (!target_bs) {
+        error_set(errp, QERR_DEVICE_NOT_FOUND, target);
+        goto out;
+    }
+
+    bdrv_ref(target_bs);
+    bdrv_set_aio_context(target_bs, aio_context);
+    backup_start(bs, target_bs, speed, sync, on_source_error, on_target_error,
+                 block_job_cb, bs, &local_err);
+    if (local_err != NULL) {
+        bdrv_unref(target_bs);
+        error_propagate(errp, local_err);
+    }
+out:
+    aio_context_release(aio_context);
+}
+
 #define DEFAULT_MIRROR_BUF_SIZE   (10 << 20)
 
 void qmp_drive_mirror(const char *device, const char *target,
diff --git a/qapi/block-core.json b/qapi/block-core.json
index 2d8bd25..80984d1 100644
--- a/qapi/block-core.json
+++ b/qapi/block-core.json
@@ -703,6 +703,41 @@
             '*on-target-error': 'BlockdevOnError' } }
 
 ##
+# @BlockdevBackup
+#
+# @device: the name of the device which should be copied.
+#
+# @target: the name of the backup target device.
+#
+# @sync: what parts of the disk image should be copied to the destination
+#        (all the disk, only the sectors allocated in the topmost image, or
+#        only new I/O).
+#
+# @speed: #optional the maximum speed, in bytes per second. The default is 0,
+#         for unlimited.
+#
+# @on-source-error: #optional the action to take on an error on the source,
+#                   default 'report'.  'stop' and 'enospc' can only be used
+#                   if the block device supports io-status (see BlockInfo).
+#
+# @on-target-error: #optional the action to take on an error on the target,
+#                   default 'report' (no limitations, since this applies to
+#                   a different block device than @device).
+#
+# Note that @on-source-error and @on-target-error only affect background I/O.
+# If an error occurs during a guest write request, the device's rerror/werror
+# actions will be used.
+#
+# Since: 2.3
+##
+{ 'type': 'BlockdevBackup',
+  'data': { 'device': 'str', 'target': 'str',
+            'sync': 'MirrorSyncMode',
+            '*speed': 'int',
+            '*on-source-error': 'BlockdevOnError',
+            '*on-target-error': 'BlockdevOnError' } }
+
+##
 # @blockdev-snapshot-sync
 #
 # Generates a synchronous snapshot of a block device.
@@ -822,6 +857,25 @@
 { 'command': 'drive-backup', 'data': 'DriveBackup' }
 
 ##
+# @blockdev-backup
+#
+# Start a point-in-time copy of a block device to a new destination.  The
+# status of ongoing blockdev-backup operations can be checked with
+# query-block-jobs where the BlockJobInfo.type field has the value 'backup'.
+# The operation can be stopped before it has completed using the
+# block-job-cancel command.
+#
+# For the arguments, see the documentation of BlockdevBackup.
+#
+# Returns: Nothing on success.
+#          If @device or @target is not a valid block device, DeviceNotFound.
+#
+# Since 2.3
+##
+{ 'command': 'blockdev-backup', 'data': 'BlockdevBackup' }
+
+
+##
 # @query-named-block-nodes
 #
 # Get the named block driver list
diff --git a/qmp-commands.hx b/qmp-commands.hx
index 3348782..d291b97 100644
--- a/qmp-commands.hx
+++ b/qmp-commands.hx
@@ -1094,6 +1094,48 @@ Example:
                                                "sync": "full",
                                                "target": "backup.img" } }
 <- { "return": {} }
+
+EQMP
+
+    {
+        .name       = "blockdev-backup",
+        .args_type  = "sync:s,device:B,target:B,speed:i?,"
+                      "on-source-error:s?,on-target-error:s?",
+        .mhandler.cmd_new = qmp_marshal_input_blockdev_backup,
+    },
+
+SQMP
+blockdev-backup
+---------------
+
+The device version of drive-backup: this command takes an existing named device
+as backup target.
+
+Arguments:
+
+- "device": the name of the device which should be copied.
+            (json-string)
+- "target": the name of the backup target device. (json-string)
+- "sync": what parts of the disk image should be copied to the destination;
+          possibilities include "full" for all the disk, "top" for only the
+          sectors allocated in the topmost image, or "none" to only replicate
+          new I/O (MirrorSyncMode).
+- "speed": the maximum speed, in bytes per second (json-int, optional)
+- "on-source-error": the action to take on an error on the source, default
+                     'report'.  'stop' and 'enospc' can only be used
+                     if the block device supports io-status.
+                     (BlockdevOnError, optional)
+- "on-target-error": the action to take on an error on the target, default
+                     'report' (no limitations, since this applies to
+                     a different block device than device).
+                     (BlockdevOnError, optional)
+
+Example:
+-> { "execute": "blockdev-backup", "arguments": { "device": "src-id",
+                                                  "sync": "full",
+                                                  "target": "tgt-id" } }
+<- { "return": {} }
+
 EQMP
 
     {
-- 
1.8.3.1

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

* [Qemu-devel] [PULL 17/19] block: Add blockdev-backup to transaction
  2014-12-19 16:34 [Qemu-devel] [PULL 00/19] Block patches Kevin Wolf
                   ` (15 preceding siblings ...)
  2014-12-19 16:35 ` [Qemu-devel] [PULL 16/19] qmp: Add command 'blockdev-backup' Kevin Wolf
@ 2014-12-19 16:35 ` Kevin Wolf
  2014-12-19 16:35 ` [Qemu-devel] [PULL 18/19] qemu-iotests: Test blockdev-backup in 055 Kevin Wolf
                   ` (3 subsequent siblings)
  20 siblings, 0 replies; 36+ messages in thread
From: Kevin Wolf @ 2014-12-19 16:35 UTC (permalink / raw)
  To: qemu-devel; +Cc: kwolf

From: Fam Zheng <famz@redhat.com>

Signed-off-by: Fam Zheng <famz@redhat.com>
Reviewed-by: John Snow <jsnow@redhat.com>
Reviewed-by: Max Reitz <mreitz@redhat.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Message-id: 1418899027-8445-4-git-send-email-famz@redhat.com
Signed-off-by: Max Reitz <mreitz@redhat.com>
---
 blockdev.c       | 79 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 qapi-schema.json |  2 ++
 2 files changed, 81 insertions(+)

diff --git a/blockdev.c b/blockdev.c
index d6ccc5e..f2b3b25 100644
--- a/blockdev.c
+++ b/blockdev.c
@@ -1559,6 +1559,79 @@ static void drive_backup_clean(BlkTransactionState *common)
     }
 }
 
+typedef struct BlockdevBackupState {
+    BlkTransactionState common;
+    BlockDriverState *bs;
+    BlockJob *job;
+    AioContext *aio_context;
+} BlockdevBackupState;
+
+static void blockdev_backup_prepare(BlkTransactionState *common, Error **errp)
+{
+    BlockdevBackupState *state = DO_UPCAST(BlockdevBackupState, common, common);
+    BlockdevBackup *backup;
+    BlockDriverState *bs, *target;
+    Error *local_err = NULL;
+
+    assert(common->action->kind == TRANSACTION_ACTION_KIND_BLOCKDEV_BACKUP);
+    backup = common->action->blockdev_backup;
+
+    bs = bdrv_find(backup->device);
+    if (!bs) {
+        error_set(errp, QERR_DEVICE_NOT_FOUND, backup->device);
+        return;
+    }
+
+    target = bdrv_find(backup->target);
+    if (!target) {
+        error_set(errp, QERR_DEVICE_NOT_FOUND, backup->target);
+        return;
+    }
+
+    /* AioContext is released in .clean() */
+    state->aio_context = bdrv_get_aio_context(bs);
+    if (state->aio_context != bdrv_get_aio_context(target)) {
+        state->aio_context = NULL;
+        error_setg(errp, "Backup between two IO threads is not implemented");
+        return;
+    }
+    aio_context_acquire(state->aio_context);
+
+    qmp_blockdev_backup(backup->device, backup->target,
+                        backup->sync,
+                        backup->has_speed, backup->speed,
+                        backup->has_on_source_error, backup->on_source_error,
+                        backup->has_on_target_error, backup->on_target_error,
+                        &local_err);
+    if (local_err) {
+        error_propagate(errp, local_err);
+        return;
+    }
+
+    state->bs = bs;
+    state->job = state->bs->job;
+}
+
+static void blockdev_backup_abort(BlkTransactionState *common)
+{
+    BlockdevBackupState *state = DO_UPCAST(BlockdevBackupState, common, common);
+    BlockDriverState *bs = state->bs;
+
+    /* Only cancel if it's the job we started */
+    if (bs && bs->job && bs->job == state->job) {
+        block_job_cancel_sync(bs->job);
+    }
+}
+
+static void blockdev_backup_clean(BlkTransactionState *common)
+{
+    BlockdevBackupState *state = DO_UPCAST(BlockdevBackupState, common, common);
+
+    if (state->aio_context) {
+        aio_context_release(state->aio_context);
+    }
+}
+
 static void abort_prepare(BlkTransactionState *common, Error **errp)
 {
     error_setg(errp, "Transaction aborted using Abort action");
@@ -1582,6 +1655,12 @@ static const BdrvActionOps actions[] = {
         .abort = drive_backup_abort,
         .clean = drive_backup_clean,
     },
+    [TRANSACTION_ACTION_KIND_BLOCKDEV_BACKUP] = {
+        .instance_size = sizeof(BlockdevBackupState),
+        .prepare = blockdev_backup_prepare,
+        .abort = blockdev_backup_abort,
+        .clean = blockdev_backup_clean,
+    },
     [TRANSACTION_ACTION_KIND_ABORT] = {
         .instance_size = sizeof(BlkTransactionState),
         .prepare = abort_prepare,
diff --git a/qapi-schema.json b/qapi-schema.json
index 47d99cf..fbfc52f 100644
--- a/qapi-schema.json
+++ b/qapi-schema.json
@@ -1260,11 +1260,13 @@
 # drive-backup since 1.6
 # abort since 1.6
 # blockdev-snapshot-internal-sync since 1.7
+# blockdev-backup since 2.3
 ##
 { 'union': 'TransactionAction',
   'data': {
        'blockdev-snapshot-sync': 'BlockdevSnapshot',
        'drive-backup': 'DriveBackup',
+       'blockdev-backup': 'BlockdevBackup',
        'abort': 'Abort',
        'blockdev-snapshot-internal-sync': 'BlockdevSnapshotInternal'
    } }
-- 
1.8.3.1

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

* [Qemu-devel] [PULL 18/19] qemu-iotests: Test blockdev-backup in 055
  2014-12-19 16:34 [Qemu-devel] [PULL 00/19] Block patches Kevin Wolf
                   ` (16 preceding siblings ...)
  2014-12-19 16:35 ` [Qemu-devel] [PULL 17/19] block: Add blockdev-backup to transaction Kevin Wolf
@ 2014-12-19 16:35 ` Kevin Wolf
  2014-12-19 16:35 ` [Qemu-devel] [PULL 19/19] iotests: Filter out "I/O thread spun..." warning Kevin Wolf
                   ` (2 subsequent siblings)
  20 siblings, 0 replies; 36+ messages in thread
From: Kevin Wolf @ 2014-12-19 16:35 UTC (permalink / raw)
  To: qemu-devel; +Cc: kwolf

From: Fam Zheng <famz@redhat.com>

This applies cases on drive-backup on blockdev-backup, except cases with
target format and mode.

Also add a case to check source == target.

Signed-off-by: Fam Zheng <famz@redhat.com>
Reviewed-by: Max Reitz <mreitz@redhat.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Message-id: 1418899027-8445-5-git-send-email-famz@redhat.com
Signed-off-by: Max Reitz <mreitz@redhat.com>
---
 tests/qemu-iotests/055     | 211 +++++++++++++++++++++++++++++++++++++--------
 tests/qemu-iotests/055.out |   4 +-
 2 files changed, 176 insertions(+), 39 deletions(-)

diff --git a/tests/qemu-iotests/055 b/tests/qemu-iotests/055
index 0872444..e81d4d0 100755
--- a/tests/qemu-iotests/055
+++ b/tests/qemu-iotests/055
@@ -1,8 +1,8 @@
 #!/usr/bin/env python
 #
-# Tests for drive-backup
+# Tests for drive-backup and blockdev-backup
 #
-# Copyright (C) 2013 Red Hat, Inc.
+# Copyright (C) 2013, 2014 Red Hat, Inc.
 #
 # Based on 041.
 #
@@ -27,6 +27,7 @@ from iotests import qemu_img, qemu_io
 
 test_img = os.path.join(iotests.test_dir, 'test.img')
 target_img = os.path.join(iotests.test_dir, 'target.img')
+blockdev_target_img = os.path.join(iotests.test_dir, 'blockdev-target.img')
 
 class TestSingleDrive(iotests.QMPTestCase):
     image_len = 64 * 1024 * 1024 # MB
@@ -38,34 +39,41 @@ class TestSingleDrive(iotests.QMPTestCase):
         qemu_io('-f', iotests.imgfmt, '-c', 'write -P0xd5 1M 32k', test_img)
         qemu_io('-f', iotests.imgfmt, '-c', 'write -P0xdc 32M 124k', test_img)
         qemu_io('-f', iotests.imgfmt, '-c', 'write -P0xdc 67043328 64k', test_img)
+        qemu_img('create', '-f', iotests.imgfmt, blockdev_target_img, str(TestSingleDrive.image_len))
 
-        self.vm = iotests.VM().add_drive(test_img)
+        self.vm = iotests.VM().add_drive(test_img).add_drive(blockdev_target_img)
         self.vm.launch()
 
     def tearDown(self):
         self.vm.shutdown()
         os.remove(test_img)
+        os.remove(blockdev_target_img)
         try:
             os.remove(target_img)
         except OSError:
             pass
 
-    def test_cancel(self):
+    def do_test_cancel(self, cmd, target):
         self.assert_no_active_block_jobs()
 
-        result = self.vm.qmp('drive-backup', device='drive0',
-                             target=target_img, sync='full')
+        result = self.vm.qmp(cmd, device='drive0', target=target, sync='full')
         self.assert_qmp(result, 'return', {})
 
         event = self.cancel_and_wait()
         self.assert_qmp(event, 'data/type', 'backup')
 
-    def test_pause(self):
+    def test_cancel_drive_backup(self):
+        self.do_test_cancel('drive-backup', target_img)
+
+    def test_cancel_blockdev_backup(self):
+        self.do_test_cancel('blockdev-backup', 'drive1')
+
+    def do_test_pause(self, cmd, target, image):
         self.assert_no_active_block_jobs()
 
         self.vm.pause_drive('drive0')
-        result = self.vm.qmp('drive-backup', device='drive0',
-                             target=target_img, sync='full')
+        result = self.vm.qmp(cmd, device='drive0',
+                             target=target, sync='full')
         self.assert_qmp(result, 'return', {})
 
         result = self.vm.qmp('block-job-pause', device='drive0')
@@ -86,14 +94,25 @@ class TestSingleDrive(iotests.QMPTestCase):
         self.wait_until_completed()
 
         self.vm.shutdown()
-        self.assertTrue(iotests.compare_images(test_img, target_img),
+        self.assertTrue(iotests.compare_images(test_img, image),
                         'target image does not match source after backup')
 
+    def test_pause_drive_backup(self):
+        self.do_test_pause('drive-backup', target_img, target_img)
+
+    def test_pause_blockdev_backup(self):
+        self.do_test_pause('blockdev-backup', 'drive1', blockdev_target_img)
+
     def test_medium_not_found(self):
         result = self.vm.qmp('drive-backup', device='ide1-cd0',
                              target=target_img, sync='full')
         self.assert_qmp(result, 'error/class', 'GenericError')
 
+    def test_medium_not_found_blockdev_backup(self):
+        result = self.vm.qmp('blockdev-backup', device='ide1-cd0',
+                             target='drive1', sync='full')
+        self.assert_qmp(result, 'error/class', 'GenericError')
+
     def test_image_not_found(self):
         result = self.vm.qmp('drive-backup', device='drive0',
                              target=target_img, sync='full', mode='existing')
@@ -105,31 +124,53 @@ class TestSingleDrive(iotests.QMPTestCase):
                              format='spaghetti-noodles')
         self.assert_qmp(result, 'error/class', 'GenericError')
 
-    def test_device_not_found(self):
-        result = self.vm.qmp('drive-backup', device='nonexistent',
-                             target=target_img, sync='full')
+    def do_test_device_not_found(self, cmd, **args):
+        result = self.vm.qmp(cmd, **args)
         self.assert_qmp(result, 'error/class', 'DeviceNotFound')
 
+    def test_device_not_found(self):
+        self.do_test_device_not_found('drive-backup', device='nonexistent',
+                                      target=target_img, sync='full')
+
+        self.do_test_device_not_found('blockdev-backup', device='nonexistent',
+                                      target='drive0', sync='full')
+
+        self.do_test_device_not_found('blockdev-backup', device='drive0',
+                                      target='nonexistent', sync='full')
+
+        self.do_test_device_not_found('blockdev-backup', device='nonexistent',
+                                      target='nonexistent', sync='full')
+
+    def test_target_is_source(self):
+        result = self.vm.qmp('blockdev-backup', device='drive0',
+                             target='drive0', sync='full')
+        self.assert_qmp(result, 'error/class', 'GenericError')
+
 class TestSetSpeed(iotests.QMPTestCase):
     image_len = 80 * 1024 * 1024 # MB
 
     def setUp(self):
         qemu_img('create', '-f', iotests.imgfmt, test_img, str(TestSetSpeed.image_len))
         qemu_io('-f', iotests.imgfmt, '-c', 'write -P1 0 512', test_img)
-        self.vm = iotests.VM().add_drive(test_img)
+        qemu_img('create', '-f', iotests.imgfmt, blockdev_target_img, str(TestSingleDrive.image_len))
+
+        self.vm = iotests.VM().add_drive(test_img).add_drive(blockdev_target_img)
         self.vm.launch()
 
     def tearDown(self):
         self.vm.shutdown()
         os.remove(test_img)
-        os.remove(target_img)
+        os.remove(blockdev_target_img)
+        try:
+            os.remove(target_img)
+        except OSError:
+            pass
 
-    def test_set_speed(self):
+    def do_test_set_speed(self, cmd, target):
         self.assert_no_active_block_jobs()
 
         self.vm.pause_drive('drive0')
-        result = self.vm.qmp('drive-backup', device='drive0',
-                             target=target_img, sync='full')
+        result = self.vm.qmp(cmd, device='drive0', target=target, sync='full')
         self.assert_qmp(result, 'return', {})
 
         # Default speed is 0
@@ -148,10 +189,10 @@ class TestSetSpeed(iotests.QMPTestCase):
         event = self.cancel_and_wait(resume=True)
         self.assert_qmp(event, 'data/type', 'backup')
 
-        # Check setting speed in drive-backup works
+        # Check setting speed option works
         self.vm.pause_drive('drive0')
-        result = self.vm.qmp('drive-backup', device='drive0',
-                             target=target_img, sync='full', speed=4*1024*1024)
+        result = self.vm.qmp(cmd, device='drive0',
+                             target=target, sync='full', speed=4*1024*1024)
         self.assert_qmp(result, 'return', {})
 
         result = self.vm.qmp('query-block-jobs')
@@ -161,18 +202,24 @@ class TestSetSpeed(iotests.QMPTestCase):
         event = self.cancel_and_wait(resume=True)
         self.assert_qmp(event, 'data/type', 'backup')
 
-    def test_set_speed_invalid(self):
+    def test_set_speed_drive_backup(self):
+        self.do_test_set_speed('drive-backup', target_img)
+
+    def test_set_speed_blockdev_backup(self):
+        self.do_test_set_speed('blockdev-backup', 'drive1')
+
+    def do_test_set_speed_invalid(self, cmd, target):
         self.assert_no_active_block_jobs()
 
-        result = self.vm.qmp('drive-backup', device='drive0',
-                             target=target_img, sync='full', speed=-1)
+        result = self.vm.qmp(cmd, device='drive0',
+                             target=target, sync='full', speed=-1)
         self.assert_qmp(result, 'error/class', 'GenericError')
 
         self.assert_no_active_block_jobs()
 
         self.vm.pause_drive('drive0')
-        result = self.vm.qmp('drive-backup', device='drive0',
-                             target=target_img, sync='full')
+        result = self.vm.qmp(cmd, device='drive0',
+                             target=target, sync='full')
         self.assert_qmp(result, 'return', {})
 
         result = self.vm.qmp('block-job-set-speed', device='drive0', speed=-1)
@@ -181,6 +228,12 @@ class TestSetSpeed(iotests.QMPTestCase):
         event = self.cancel_and_wait(resume=True)
         self.assert_qmp(event, 'data/type', 'backup')
 
+    def test_set_speed_invalid_drive_backup(self):
+        self.do_test_set_speed_invalid('drive-backup', target_img)
+
+    def test_set_speed_invalid_blockdev_backup(self):
+        self.do_test_set_speed_invalid('blockdev-backup',  'drive1')
+
 class TestSingleTransaction(iotests.QMPTestCase):
     image_len = 64 * 1024 * 1024 # MB
 
@@ -190,41 +243,50 @@ class TestSingleTransaction(iotests.QMPTestCase):
         qemu_io('-f', iotests.imgfmt, '-c', 'write -P0xd5 1M 32k', test_img)
         qemu_io('-f', iotests.imgfmt, '-c', 'write -P0xdc 32M 124k', test_img)
         qemu_io('-f', iotests.imgfmt, '-c', 'write -P0xdc 67043328 64k', test_img)
+        qemu_img('create', '-f', iotests.imgfmt, blockdev_target_img, str(TestSingleDrive.image_len))
 
-        self.vm = iotests.VM().add_drive(test_img)
+        self.vm = iotests.VM().add_drive(test_img).add_drive(blockdev_target_img)
         self.vm.launch()
 
     def tearDown(self):
         self.vm.shutdown()
         os.remove(test_img)
+        os.remove(blockdev_target_img)
         try:
             os.remove(target_img)
         except OSError:
             pass
 
-    def test_cancel(self):
+    def do_test_cancel(self, cmd, target):
         self.assert_no_active_block_jobs()
 
         result = self.vm.qmp('transaction', actions=[{
-                'type': 'drive-backup',
+                'type': cmd,
                 'data': { 'device': 'drive0',
-                          'target': target_img,
+                          'target': target,
                           'sync': 'full' },
             }
         ])
+
         self.assert_qmp(result, 'return', {})
 
         event = self.cancel_and_wait()
         self.assert_qmp(event, 'data/type', 'backup')
 
-    def test_pause(self):
+    def test_cancel_drive_backup(self):
+        self.do_test_cancel('drive-backup', target_img)
+
+    def test_cancel_blockdev_backup(self):
+        self.do_test_cancel('blockdev-backup', 'drive1')
+
+    def do_test_pause(self, cmd, target, image):
         self.assert_no_active_block_jobs()
 
         self.vm.pause_drive('drive0')
         result = self.vm.qmp('transaction', actions=[{
-                'type': 'drive-backup',
+                'type': cmd,
                 'data': { 'device': 'drive0',
-                          'target': target_img,
+                          'target': target,
                           'sync': 'full' },
             }
         ])
@@ -248,19 +310,31 @@ class TestSingleTransaction(iotests.QMPTestCase):
         self.wait_until_completed()
 
         self.vm.shutdown()
-        self.assertTrue(iotests.compare_images(test_img, target_img),
+        self.assertTrue(iotests.compare_images(test_img, image),
                         'target image does not match source after backup')
 
-    def test_medium_not_found(self):
+    def test_pause_drive_backup(self):
+        self.do_test_pause('drive-backup', target_img, target_img)
+
+    def test_pause_blockdev_backup(self):
+        self.do_test_pause('blockdev-backup', 'drive1', blockdev_target_img)
+
+    def do_test_medium_not_found(self, cmd, target):
         result = self.vm.qmp('transaction', actions=[{
-                'type': 'drive-backup',
+                'type': cmd,
                 'data': { 'device': 'ide1-cd0',
-                          'target': target_img,
+                          'target': target,
                           'sync': 'full' },
             }
         ])
         self.assert_qmp(result, 'error/class', 'GenericError')
 
+    def test_medium_not_found_drive_backup(self):
+        self.do_test_medium_not_found('drive-backup', target_img)
+
+    def test_medium_not_found_blockdev_backup(self):
+        self.do_test_medium_not_found('blockdev-backup', 'drive1')
+
     def test_image_not_found(self):
         result = self.vm.qmp('transaction', actions=[{
                 'type': 'drive-backup',
@@ -283,6 +357,43 @@ class TestSingleTransaction(iotests.QMPTestCase):
         ])
         self.assert_qmp(result, 'error/class', 'DeviceNotFound')
 
+        result = self.vm.qmp('transaction', actions=[{
+                'type': 'blockdev-backup',
+                'data': { 'device': 'nonexistent',
+                          'target': 'drive1',
+                          'sync': 'full' },
+            }
+        ])
+        self.assert_qmp(result, 'error/class', 'DeviceNotFound')
+
+        result = self.vm.qmp('transaction', actions=[{
+                'type': 'blockdev-backup',
+                'data': { 'device': 'drive0',
+                          'target': 'nonexistent',
+                          'sync': 'full' },
+            }
+        ])
+        self.assert_qmp(result, 'error/class', 'DeviceNotFound')
+
+        result = self.vm.qmp('transaction', actions=[{
+                'type': 'blockdev-backup',
+                'data': { 'device': 'nonexistent',
+                          'target': 'nonexistent',
+                          'sync': 'full' },
+            }
+        ])
+        self.assert_qmp(result, 'error/class', 'DeviceNotFound')
+
+    def test_target_is_source(self):
+        result = self.vm.qmp('transaction', actions=[{
+                'type': 'blockdev-backup',
+                'data': { 'device': 'drive0',
+                          'target': 'drive0',
+                          'sync': 'full' },
+            }
+        ])
+        self.assert_qmp(result, 'error/class', 'GenericError')
+
     def test_abort(self):
         result = self.vm.qmp('transaction', actions=[{
                 'type': 'drive-backup',
@@ -298,5 +409,31 @@ class TestSingleTransaction(iotests.QMPTestCase):
         self.assert_qmp(result, 'error/class', 'GenericError')
         self.assert_no_active_block_jobs()
 
+        result = self.vm.qmp('transaction', actions=[{
+                'type': 'blockdev-backup',
+                'data': { 'device': 'nonexistent',
+                          'target': 'drive1',
+                          'sync': 'full' },
+            }, {
+                'type': 'Abort',
+                'data': {},
+            }
+        ])
+        self.assert_qmp(result, 'error/class', 'GenericError')
+        self.assert_no_active_block_jobs()
+
+        result = self.vm.qmp('transaction', actions=[{
+                'type': 'blockdev-backup',
+                'data': { 'device': 'drive0',
+                          'target': 'nonexistent',
+                          'sync': 'full' },
+            }, {
+                'type': 'Abort',
+                'data': {},
+            }
+        ])
+        self.assert_qmp(result, 'error/class', 'GenericError')
+        self.assert_no_active_block_jobs()
+
 if __name__ == '__main__':
     iotests.main(supported_fmts=['raw', 'qcow2'])
diff --git a/tests/qemu-iotests/055.out b/tests/qemu-iotests/055.out
index 6323079..42314e9 100644
--- a/tests/qemu-iotests/055.out
+++ b/tests/qemu-iotests/055.out
@@ -1,5 +1,5 @@
-..............
+........................
 ----------------------------------------------------------------------
-Ran 14 tests
+Ran 24 tests
 
 OK
-- 
1.8.3.1

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

* [Qemu-devel] [PULL 19/19] iotests: Filter out "I/O thread spun..." warning
  2014-12-19 16:34 [Qemu-devel] [PULL 00/19] Block patches Kevin Wolf
                   ` (17 preceding siblings ...)
  2014-12-19 16:35 ` [Qemu-devel] [PULL 18/19] qemu-iotests: Test blockdev-backup in 055 Kevin Wolf
@ 2014-12-19 16:35 ` Kevin Wolf
  2014-12-22 11:14 ` [Qemu-devel] [PULL 00/19] Block patches Peter Maydell
  2015-01-05 11:55 ` Stefan Hajnoczi
  20 siblings, 0 replies; 36+ messages in thread
From: Kevin Wolf @ 2014-12-19 16:35 UTC (permalink / raw)
  To: qemu-devel; +Cc: kwolf

From: Max Reitz <mreitz@redhat.com>

Filter out the "main loop: WARNING: I/O thread spun for..." warning from
qemu output (it hardly matters for code specifically testing I/O).

Furthermore, use _filter_qemu in all the custom functions which run
qemu.

Signed-off-by: Max Reitz <mreitz@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
---
 tests/qemu-iotests/067           | 3 ++-
 tests/qemu-iotests/071           | 2 +-
 tests/qemu-iotests/071.out       | 8 ++++----
 tests/qemu-iotests/081           | 2 +-
 tests/qemu-iotests/087           | 3 ++-
 tests/qemu-iotests/087.out       | 1 -
 tests/qemu-iotests/099           | 2 +-
 tests/qemu-iotests/common.filter | 1 +
 8 files changed, 12 insertions(+), 10 deletions(-)

diff --git a/tests/qemu-iotests/067 b/tests/qemu-iotests/067
index 29cd6b5..0508c69 100755
--- a/tests/qemu-iotests/067
+++ b/tests/qemu-iotests/067
@@ -45,7 +45,8 @@ function do_run_qemu()
 
 function run_qemu()
 {
-    do_run_qemu "$@" 2>&1 | _filter_testdir | _filter_qmp | sed -e 's/\("actual-size":\s*\)[0-9]\+/\1SIZE/g'
+    do_run_qemu "$@" 2>&1 | _filter_testdir | _filter_qmp | _filter_qemu \
+                          | sed -e 's/\("actual-size":\s*\)[0-9]\+/\1SIZE/g'
 }
 
 size=128M
diff --git a/tests/qemu-iotests/071 b/tests/qemu-iotests/071
index 5d61ef6..9eaa49b 100755
--- a/tests/qemu-iotests/071
+++ b/tests/qemu-iotests/071
@@ -51,7 +51,7 @@ function do_run_qemu()
 
 function run_qemu()
 {
-    do_run_qemu "$@" 2>&1 | _filter_testdir | _filter_qmp | _filter_qemu_io
+    do_run_qemu "$@" 2>&1 | _filter_testdir | _filter_qemu | _filter_qmp | _filter_qemu_io
 }
 
 IMG_SIZE=64M
diff --git a/tests/qemu-iotests/071.out b/tests/qemu-iotests/071.out
index 46484ff..9205ce2 100644
--- a/tests/qemu-iotests/071.out
+++ b/tests/qemu-iotests/071.out
@@ -52,8 +52,8 @@ read failed: Input/output error
 {"timestamp": {"seconds":  TIMESTAMP, "microseconds":  TIMESTAMP}, "event": "SHUTDOWN"}
 {"timestamp": {"seconds":  TIMESTAMP, "microseconds":  TIMESTAMP}, "event": "DEVICE_TRAY_MOVED", "data": {"device": "ide1-cd0", "tray-open": true}}
 {"timestamp": {"seconds":  TIMESTAMP, "microseconds":  TIMESTAMP}, "event": "DEVICE_TRAY_MOVED", "data": {"device": "floppy0", "tray-open": true}}
-qemu-system-x86_64: Failed to flush the L2 table cache: Input/output error
-qemu-system-x86_64: Failed to flush the refcount block cache: Input/output error
+QEMU_PROG: Failed to flush the L2 table cache: Input/output error
+QEMU_PROG: Failed to flush the refcount block cache: Input/output error
 
 
 === Testing blkverify on existing block device ===
@@ -92,7 +92,7 @@ read failed: Input/output error
 {"timestamp": {"seconds":  TIMESTAMP, "microseconds":  TIMESTAMP}, "event": "SHUTDOWN"}
 {"timestamp": {"seconds":  TIMESTAMP, "microseconds":  TIMESTAMP}, "event": "DEVICE_TRAY_MOVED", "data": {"device": "ide1-cd0", "tray-open": true}}
 {"timestamp": {"seconds":  TIMESTAMP, "microseconds":  TIMESTAMP}, "event": "DEVICE_TRAY_MOVED", "data": {"device": "floppy0", "tray-open": true}}
-qemu-system-x86_64: Failed to flush the L2 table cache: Input/output error
-qemu-system-x86_64: Failed to flush the refcount block cache: Input/output error
+QEMU_PROG: Failed to flush the L2 table cache: Input/output error
+QEMU_PROG: Failed to flush the refcount block cache: Input/output error
 
 *** done
diff --git a/tests/qemu-iotests/081 b/tests/qemu-iotests/081
index 9ab93ff..d9b042c 100755
--- a/tests/qemu-iotests/081
+++ b/tests/qemu-iotests/081
@@ -53,7 +53,7 @@ function do_run_qemu()
 
 function run_qemu()
 {
-    do_run_qemu "$@" 2>&1 | _filter_testdir | _filter_qmp | _filter_qemu_io
+    do_run_qemu "$@" 2>&1 | _filter_testdir | _filter_qemu | _filter_qmp | _filter_qemu_io
 }
 
 test_quorum=$($QEMU_IMG --help|grep quorum)
diff --git a/tests/qemu-iotests/087 b/tests/qemu-iotests/087
index d7454d1..8694749 100755
--- a/tests/qemu-iotests/087
+++ b/tests/qemu-iotests/087
@@ -45,7 +45,8 @@ function do_run_qemu()
 
 function run_qemu()
 {
-    do_run_qemu "$@" 2>&1 | _filter_testdir | _filter_qmp | sed -e 's/\("actual-size":\s*\)[0-9]\+/\1SIZE/g'
+    do_run_qemu "$@" 2>&1 | _filter_testdir | _filter_qmp | _filter_qemu \
+                          | sed -e 's/\("actual-size":\s*\)[0-9]\+/\1SIZE/g'
 }
 
 size=128M
diff --git a/tests/qemu-iotests/087.out b/tests/qemu-iotests/087.out
index 7d38cc2..91f4ea1 100644
--- a/tests/qemu-iotests/087.out
+++ b/tests/qemu-iotests/087.out
@@ -21,7 +21,6 @@ QMP_VERSION
 {"return": {}}
 {"error": {"class": "GenericError", "desc": "Device with id 'disk' already exists"}}
 {"error": {"class": "GenericError", "desc": "Device name 'test-node' conflicts with an existing node name"}}
-main-loop: WARNING: I/O thread spun for 1000 iterations
 {"error": {"class": "GenericError", "desc": "could not open disk image disk2: node-name=disk is conflicting with a device id"}}
 {"error": {"class": "GenericError", "desc": "could not open disk image disk2: Duplicate node name"}}
 {"error": {"class": "GenericError", "desc": "could not open disk image disk3: node-name=disk3 is conflicting with a device id"}}
diff --git a/tests/qemu-iotests/099 b/tests/qemu-iotests/099
index 948afff..80f3d9a 100755
--- a/tests/qemu-iotests/099
+++ b/tests/qemu-iotests/099
@@ -57,7 +57,7 @@ function run_qemu()
     # Get the "file": "foo" entry ($foo may only contain escaped double quotes,
     # which is how we can extract it)
     do_run_qemu "$@" 2>&1 | _filter_testdir | _filter_imgfmt | _filter_qmp \
-        | grep "drv0" \
+        | _filter_qemu | grep "drv0" \
         | sed -e 's/^.*"file": "\(\(\\"\|[^"]\)*\)".*$/\1/' -e 's/\\"/"/g'
 }
 
diff --git a/tests/qemu-iotests/common.filter b/tests/qemu-iotests/common.filter
index 6c14590..bae96ef 100644
--- a/tests/qemu-iotests/common.filter
+++ b/tests/qemu-iotests/common.filter
@@ -159,6 +159,7 @@ _filter_qemu()
 {
     sed -e "s#\\(^\\|(qemu) \\)$(basename $QEMU_PROG):#\1QEMU_PROG:#" \
         -e 's#^QEMU [0-9]\+\.[0-9]\+\.[0-9]\+ monitor#QEMU X.Y.Z monitor#' \
+        -e '/main-loop: WARNING: I\/O thread spun for [0-9]\+ iterations/d' \
         -e $'s#\r##' # QEMU monitor uses \r\n line endings
 }
 
-- 
1.8.3.1

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

* Re: [Qemu-devel] [PULL 00/19] Block patches
  2014-12-19 16:34 [Qemu-devel] [PULL 00/19] Block patches Kevin Wolf
                   ` (18 preceding siblings ...)
  2014-12-19 16:35 ` [Qemu-devel] [PULL 19/19] iotests: Filter out "I/O thread spun..." warning Kevin Wolf
@ 2014-12-22 11:14 ` Peter Maydell
  2014-12-22 12:07   ` Peter Maydell
  2015-01-05 11:55 ` Stefan Hajnoczi
  20 siblings, 1 reply; 36+ messages in thread
From: Peter Maydell @ 2014-12-22 11:14 UTC (permalink / raw)
  To: Kevin Wolf; +Cc: QEMU Developers

On 19 December 2014 at 16:34, Kevin Wolf <kwolf@redhat.com> wrote:
> The following changes since commit dfa9c2a0f4d0a0c8b2c1449ecdbb1297427e1560:
>
>   Merge remote-tracking branch 'remotes/bonzini/tags/for-upstream' into staging (2014-12-15 16:43:42 +0000)
>
> are available in the git repository at:
>
>
>   git://repo.or.cz/qemu/kevin.git tags/for-upstream
>
> for you to fetch changes up to 55873077d9e00c4da12ba1068bd9566fc6c32388:
>
>   iotests: Filter out "I/O thread spun..." warning (2014-12-19 17:17:47 +0100)
>
> ----------------------------------------------------------------
> Block patches for 2.3

Hi. I'm afraid this fails "make check" on MacOSX:
/Users/pm215/src/qemu/tests/qemu-iotests-quick.sh
/Users/pm215/src/qemu/tests/qemu-iotests/common.config: line 158:
/bin/true: No such file or directory
check: failed to source common.config

On OSX "true" is /usr/bin/true. common.config should just use
"true" here I think, and let the shell figure out where it is
(typically a builtin, obviously).

thanks
-- PMM

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

* Re: [Qemu-devel] [PULL 00/19] Block patches
  2014-12-22 11:14 ` [Qemu-devel] [PULL 00/19] Block patches Peter Maydell
@ 2014-12-22 12:07   ` Peter Maydell
  2014-12-22 12:22     ` Peter Maydell
  0 siblings, 1 reply; 36+ messages in thread
From: Peter Maydell @ 2014-12-22 12:07 UTC (permalink / raw)
  To: Kevin Wolf; +Cc: QEMU Developers

On 22 December 2014 at 11:14, Peter Maydell <peter.maydell@linaro.org> wrote:
> Hi. I'm afraid this fails "make check" on MacOSX:
> /Users/pm215/src/qemu/tests/qemu-iotests-quick.sh
> /Users/pm215/src/qemu/tests/qemu-iotests/common.config: line 158:
> /bin/true: No such file or directory
> check: failed to source common.config
>
> On OSX "true" is /usr/bin/true. common.config should just use
> "true" here I think, and let the shell figure out where it is
> (typically a builtin, obviously).

common.rc and common.filter also have this bug. With those
fixed, 'make check-block' now runs two tests (most are skipped
with "not suitable for this OS: Darwin"), of which 058 fails:

===begin===
058                [12:01:48] [12:01:49] - output mismatch (see 058.out.bad)
--- /Users/pm215/src/qemu/tests/qemu-iotests/058.out    2014-02-17
23:38:30.000000000 +0000
+++ 058.out.bad    2014-12-22 12:01:49.000000000 +0000
@@ -1,44 +1,37 @@
 QA output created by 058

 == preparing image ==
-Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=67108864
-wrote 4096/4096 bytes at offset 4096
-4 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
-wrote 4096/4096 bytes at offset 8192
-4 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
-wrote 4096/4096 bytes at offset 4096
-4 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
-wrote 4096/4096 bytes at offset 8192
-4 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=67108864
cluster_size=65536 lazy_refcounts=off
+wite [-bcCpqz] [-P patten ] off len -- wites a numbe of bytes at a
specified offset
+wite [-bcCpqz] [-P patten ] off len -- wites a numbe of bytes at a
specified offset
+wite [-bcCpqz] [-P patten ] off len -- wites a numbe of bytes at a
specified offset
+wite [-bcCpqz] [-P patten ] off len -- wites a numbe of bytes at a
specified offset
 No errors were found on the image.
+Image end offset: 393216

 == verifying the image file with patterns ==
-read 4096/4096 bytes at offset 4096
-4 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
-read 4096/4096 bytes at offset 8192
-4 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+ead [-abCpqv] [-P patten [-s off] [-l len]] off len -- eads a numbe
of bytes at a specified offset
+ead [-abCpqv] [-P patten [-s off] [-l len]] off len -- eads a numbe
of bytes at a specified offset

 == verifying the exported snapshot with patterns, method 1 ==
-read 4096/4096 bytes at offset 4096
-4 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
-read 4096/4096 bytes at offset 8192
-4 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+ead [-abCpqv] [-P patten [-s off] [-l len]] off len -- eads a numbe
of bytes at a specified offset
+ead [-abCpqv] [-P patten [-s off] [-l len]] off len -- eads a numbe
of bytes at a specified offset

 == verifying the exported snapshot with patterns, method 2 ==
-read 4096/4096 bytes at offset 4096
-4 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
-read 4096/4096 bytes at offset 8192
-4 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+ead [-abCpqv] [-P patten [-s off] [-l len]] off len -- eads a numbe
of bytes at a specified offset
+ead [-abCpqv] [-P patten [-s off] [-l len]] off len -- eads a numbe
of bytes at a specified offset
+qemu-img: Could not open '-l': Could not open '-l': No such file or directory

 == verifying the converted snapshot with patterns, method 1 ==
-read 4096/4096 bytes at offset 4096
-4 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
-read 4096/4096 bytes at offset 8192
-4 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+qemu-io: can't open device .converted: Could not open '.converted':
No such file or directory
+no file open, try 'help open'
+qemu-io: can't open device .converted: Could not open '.converted':
No such file or directory
+no file open, try 'help open'
+qemu-img: Could not open '-l': Could not open '-l': No such file or directory

 == verifying the converted snapshot with patterns, method 2 ==
-read 4096/4096 bytes at offset 4096
-4 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
-read 4096/4096 bytes at offset 8192
-4 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+qemu-io: can't open device .converted: Could not open '.converted':
No such file or directory
+no file open, try 'help open'
+qemu-io: can't open device .converted: Could not open '.converted':
No such file or directory
+no file open, try 'help open'
 *** done
===endit===

Something very odd is happening here: why are all the "r"s apparently
missing from those error messages?

-- PMM

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

* Re: [Qemu-devel] [PULL 00/19] Block patches
  2014-12-22 12:07   ` Peter Maydell
@ 2014-12-22 12:22     ` Peter Maydell
  2014-12-23  2:15       ` Fam Zheng
  0 siblings, 1 reply; 36+ messages in thread
From: Peter Maydell @ 2014-12-22 12:22 UTC (permalink / raw)
  To: Kevin Wolf; +Cc: QEMU Developers

On 22 December 2014 at 12:07, Peter Maydell <peter.maydell@linaro.org> wrote:
> Something very odd is happening here: why are all the "r"s apparently
> missing from those error messages?

Looks like the result of using GNU sed-isms in some of the filters. On OSX:

$ echo "art trick" | sed -e 's/\r//g'
at tick

On Linux with GNU sed:
$ echo "art trick" | sed -e 's/\r//g'
art trick

This likely breaks on the BSDs too. I suspect these scripts need
a careful overhaul before we can add them to 'make check' :-(

-- PMM

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

* Re: [Qemu-devel] [PULL 00/19] Block patches
  2014-12-22 12:22     ` Peter Maydell
@ 2014-12-23  2:15       ` Fam Zheng
  0 siblings, 0 replies; 36+ messages in thread
From: Fam Zheng @ 2014-12-23  2:15 UTC (permalink / raw)
  To: Peter Maydell; +Cc: Kevin Wolf, QEMU Developers

On Mon, 12/22 12:22, Peter Maydell wrote:
> On 22 December 2014 at 12:07, Peter Maydell <peter.maydell@linaro.org> wrote:
> > Something very odd is happening here: why are all the "r"s apparently
> > missing from those error messages?
> 
> Looks like the result of using GNU sed-isms in some of the filters. On OSX:
> 
> $ echo "art trick" | sed -e 's/\r//g'
> at tick
> 
> On Linux with GNU sed:
> $ echo "art trick" | sed -e 's/\r//g'
> art trick
> 
> This likely breaks on the BSDs too. I suspect these scripts need
> a careful overhaul before we can add them to 'make check' :-(
> 

Oops! Thanks Peter, I'll take care of it and respin. We should drop these
patches from this PULL for now.

Fam

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

* Re: [Qemu-devel] [PULL 00/19] Block patches
  2014-12-19 16:34 [Qemu-devel] [PULL 00/19] Block patches Kevin Wolf
                   ` (19 preceding siblings ...)
  2014-12-22 11:14 ` [Qemu-devel] [PULL 00/19] Block patches Peter Maydell
@ 2015-01-05 11:55 ` Stefan Hajnoczi
  20 siblings, 0 replies; 36+ messages in thread
From: Stefan Hajnoczi @ 2015-01-05 11:55 UTC (permalink / raw)
  To: Kevin Wolf; +Cc: qemu-devel

On Fri, Dec 19, 2014 at 4:34 PM, Kevin Wolf <kwolf@redhat.com> wrote:
> The following changes since commit dfa9c2a0f4d0a0c8b2c1449ecdbb1297427e1560:
>
>   Merge remote-tracking branch 'remotes/bonzini/tags/for-upstream' into staging (2014-12-15 16:43:42 +0000)
>
> are available in the git repository at:
>
>
>   git://repo.or.cz/qemu/kevin.git tags/for-upstream
>
> for you to fetch changes up to 55873077d9e00c4da12ba1068bd9566fc6c32388:
>
>   iotests: Filter out "I/O thread spun..." warning (2014-12-19 17:17:47 +0100)

Taking over from Kevin since he is on vacation.

I dropped the patch that adds qemu-iotests to make check for now.
Once Fam has resolved the issues we can merge that patch again.

I've sent a new pull request.

Stefan

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

* [Qemu-devel] [PULL 00/19] Block patches
@ 2015-01-05 11:51 Stefan Hajnoczi
  0 siblings, 0 replies; 36+ messages in thread
From: Stefan Hajnoczi @ 2015-01-05 11:51 UTC (permalink / raw)
  To: qemu-devel; +Cc: Peter Maydell, Stefan Hajnoczi

The following changes since commit ab0302ee764fd702465aef6d88612cdff4302809:

  Merge remote-tracking branch 'remotes/pmaydell/tags/pull-target-arm-20141223' into staging (2014-12-23 15:05:22 +0000)

are available in the git repository at:

  git://github.com/stefanha/qemu.git tags/block-pull-request

for you to fetch changes up to 3bd54e576f40f1d5bf45b4828c7316efd76a4db6:

  migration/block: fix pending() return value (2015-01-05 11:34:52 +0000)

----------------------------------------------------------------

----------------------------------------------------------------

Fam Zheng (7):
  qemu-iotests: Remove 091 from quick group
  qemu-iotests: Speed up make check-block
  qapi: Fix document for BlockStats.node-name
  qapi: Comment version info in TransactionAction
  qmp: Add command 'blockdev-backup'
  block: Add blockdev-backup to transaction
  qemu-iotests: Test blockdev-backup in 055

Max Reitz (7):
  checkpatch: Brace handling on multi-line condition
  block: Get full backing filename from string
  block: JSON filenames and relative backing files
  block: Relative backing file for image creation
  block/vmdk: Relative backing file for creation
  iotests: Add test for relative backing file names
  iotests: Filter out "I/O thread spun..." warning

Paolo Bonzini (3):
  block: mark AioContext as recursive
  block: do not allocate an iovec per read of a growable/zero_after_eof
    BDS
  block: replace g_new0 with g_new for bottom half allocation.

Vladimir Sementsov-Ogievskiy (2):
  block: fix spoiling all dirty bitmaps by mirror and migration
  migration/block: fix pending() return value

 async.c                          |  11 +-
 block.c                          |  81 ++++++++++++---
 block/backup.c                   |  28 ++++++
 block/mirror.c                   |  11 +-
 block/qapi.c                     |   7 +-
 block/vmdk.c                     |  13 ++-
 blockdev.c                       | 133 ++++++++++++++++++++++++
 include/block/block.h            |  12 ++-
 migration/block.c                |   9 +-
 qapi-schema.json                 |   8 ++
 qapi/block-core.json             |  56 ++++++++++-
 qmp-commands.hx                  |  42 ++++++++
 scripts/checkpatch.pl            |  13 ++-
 tests/qemu-iotests-quick.sh      |   2 +-
 tests/qemu-iotests/055           | 211 ++++++++++++++++++++++++++++++++-------
 tests/qemu-iotests/055.out       |   4 +-
 tests/qemu-iotests/067           |   3 +-
 tests/qemu-iotests/071           |   2 +-
 tests/qemu-iotests/071.out       |   8 +-
 tests/qemu-iotests/081           |   2 +-
 tests/qemu-iotests/087           |   3 +-
 tests/qemu-iotests/087.out       |   1 -
 tests/qemu-iotests/099           |   2 +-
 tests/qemu-iotests/110           |  94 +++++++++++++++++
 tests/qemu-iotests/110.out       |  19 ++++
 tests/qemu-iotests/check         |   1 +
 tests/qemu-iotests/common.filter |   1 +
 tests/qemu-iotests/group         |   3 +-
 28 files changed, 693 insertions(+), 87 deletions(-)
 create mode 100755 tests/qemu-iotests/110
 create mode 100644 tests/qemu-iotests/110.out

-- 
2.1.0

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

* Re: [Qemu-devel] [PULL 00/19] Block patches
  2014-12-12 17:09 Stefan Hajnoczi
@ 2014-12-15 11:11 ` Peter Maydell
  0 siblings, 0 replies; 36+ messages in thread
From: Peter Maydell @ 2014-12-15 11:11 UTC (permalink / raw)
  To: Stefan Hajnoczi; +Cc: QEMU Developers

On 12 December 2014 at 17:09, Stefan Hajnoczi <stefanha@redhat.com> wrote:
> The following changes since commit 99c9c3cb24e566258a0a141178934f9cb5198842:
>
>   Merge remote-tracking branch 'remotes/mjt/tags/pull-trivial-patches-2014-12-11' into staging (2014-12-11 18:27:02 +0000)
>
> are available in the git repository at:
>
>   git://github.com/stefanha/qemu.git tags/block-pull-request
>
> for you to fetch changes up to 82595da8dedde128d8004ec47441aeb720c08704:
>
>   linux-aio: simplify removal of completed iocbs from the list (2014-12-12 16:57:55 +0000)
>
> ----------------------------------------------------------------
>
> ----------------------------------------------------------------

Applied, thanks.

-- PMM

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

* [Qemu-devel] [PULL 00/19] Block patches
@ 2014-12-12 17:09 Stefan Hajnoczi
  2014-12-15 11:11 ` Peter Maydell
  0 siblings, 1 reply; 36+ messages in thread
From: Stefan Hajnoczi @ 2014-12-12 17:09 UTC (permalink / raw)
  To: qemu-devel; +Cc: Peter Maydell, Stefan Hajnoczi

The following changes since commit 99c9c3cb24e566258a0a141178934f9cb5198842:

  Merge remote-tracking branch 'remotes/mjt/tags/pull-trivial-patches-2014-12-11' into staging (2014-12-11 18:27:02 +0000)

are available in the git repository at:

  git://github.com/stefanha/qemu.git tags/block-pull-request

for you to fetch changes up to 82595da8dedde128d8004ec47441aeb720c08704:

  linux-aio: simplify removal of completed iocbs from the list (2014-12-12 16:57:55 +0000)

----------------------------------------------------------------

----------------------------------------------------------------

Fam Zheng (2):
  qemu-iotests: Remove traling whitespaces in *.out
  block: Don't add trailing space in "Formating..." message

Gary R Hook (1):
  block migration: fix return value

Gonglei (1):
  block/rbd: fix memory leak

Jeff Cody (4):
  block: vhdx - remove redundant comments
  block: vhdx - update PAYLOAD_BLOCK_UNMAPPED value to match 1.00 spec
  block: vhdx - change .vhdx_create default block state to ZERO
  block: vhdx - set .bdrv_has_zero_init to bdrv_has_zero_init_1

Max Reitz (5):
  vmdk: Fix error for JSON descriptor file names
  iotests: Add test for vmdk JSON file names
  qemu-io: Add sigraise command
  iotests: Filter for "Killed" in qemu-io output
  iotests: Fix test 039

Paolo Bonzini (5):
  linux-aio: queue requests that cannot be submitted
  linux-aio: track whether the queue is blocked
  linux-aio: rename LaioQueue idx field to "n"
  linux-aio: drop return code from laio_io_unplug and ioq_submit
  linux-aio: simplify removal of completed iocbs from the list

Stefan Hajnoczi (1):
  block: drop unused bdrv_clear_incoming_migration_all() prototype

 block-migration.c                |  10 +-
 block.c                          |   6 +-
 block/linux-aio.c                |  99 ++++++-------
 block/raw-aio.h                  |   2 +-
 block/rbd.c                      |   8 +-
 block/vhdx.c                     |  18 ++-
 block/vhdx.h                     |   3 +-
 block/vmdk.c                     |  10 +-
 include/block/block.h            |   3 +-
 include/qemu/option.h            |   2 +-
 include/qemu/queue.h             |  11 ++
 qemu-doc.texi                    |   6 +-
 qemu-io-cmds.c                   |  46 ++++++
 tests/qemu-iotests/001.out       |   2 +-
 tests/qemu-iotests/002.out       |   2 +-
 tests/qemu-iotests/003.out       |   2 +-
 tests/qemu-iotests/004.out       |   2 +-
 tests/qemu-iotests/005.out       |   2 +-
 tests/qemu-iotests/006.out       |   2 +-
 tests/qemu-iotests/007.out       |   2 +-
 tests/qemu-iotests/008.out       |   2 +-
 tests/qemu-iotests/009.out       |   2 +-
 tests/qemu-iotests/010.out       |   2 +-
 tests/qemu-iotests/011.out       |   2 +-
 tests/qemu-iotests/012.out       |   2 +-
 tests/qemu-iotests/013.out       |   2 +-
 tests/qemu-iotests/014.out       |   2 +-
 tests/qemu-iotests/015.out       |   2 +-
 tests/qemu-iotests/016.out       |   2 +-
 tests/qemu-iotests/017.out       |   2 +-
 tests/qemu-iotests/018.out       |   2 +-
 tests/qemu-iotests/019.out       |   4 +-
 tests/qemu-iotests/020.out       |   4 +-
 tests/qemu-iotests/021.out       |   2 +-
 tests/qemu-iotests/022.out       |   2 +-
 tests/qemu-iotests/023.out       |  16 +--
 tests/qemu-iotests/024.out       |   6 +-
 tests/qemu-iotests/025.out       |   2 +-
 tests/qemu-iotests/026.out       | 300 +++++++++++++++++++--------------------
 tests/qemu-iotests/027.out       |   2 +-
 tests/qemu-iotests/028.out       |   6 +-
 tests/qemu-iotests/029.out       |   8 +-
 tests/qemu-iotests/031.out       |   4 +-
 tests/qemu-iotests/032.out       |   2 +-
 tests/qemu-iotests/033.out       |   2 +-
 tests/qemu-iotests/034.out       |   4 +-
 tests/qemu-iotests/035.out       |   2 +-
 tests/qemu-iotests/036.out       |   6 +-
 tests/qemu-iotests/037.out       |   4 +-
 tests/qemu-iotests/038.out       |   4 +-
 tests/qemu-iotests/039           |  18 ++-
 tests/qemu-iotests/039.out       |  18 +--
 tests/qemu-iotests/042.out       |   2 +-
 tests/qemu-iotests/043.out       |  52 +++----
 tests/qemu-iotests/046.out       |   4 +-
 tests/qemu-iotests/047.out       |   2 +-
 tests/qemu-iotests/048.out       |   4 +-
 tests/qemu-iotests/049.out       | 112 +++++++--------
 tests/qemu-iotests/050.out       |   6 +-
 tests/qemu-iotests/051.out       |   6 +-
 tests/qemu-iotests/052.out       |   2 +-
 tests/qemu-iotests/053.out       |   2 +-
 tests/qemu-iotests/054.out       |   4 +-
 tests/qemu-iotests/059           |   6 +
 tests/qemu-iotests/059.out       |   4 +
 tests/qemu-iotests/060.out       |  22 +--
 tests/qemu-iotests/061.out       |  44 +++---
 tests/qemu-iotests/062.out       |   2 +-
 tests/qemu-iotests/066.out       |   2 +-
 tests/qemu-iotests/067.out       |   2 +-
 tests/qemu-iotests/068.out       |   2 +-
 tests/qemu-iotests/069.out       |   4 +-
 tests/qemu-iotests/071.out       |   8 +-
 tests/qemu-iotests/072.out       |   2 +-
 tests/qemu-iotests/073.out       |   4 +-
 tests/qemu-iotests/077.out       |   2 +-
 tests/qemu-iotests/080.out       |  24 ++--
 tests/qemu-iotests/081.out       |   6 +-
 tests/qemu-iotests/082.out       |  14 +-
 tests/qemu-iotests/084.out       |   4 +-
 tests/qemu-iotests/086.out       |   2 +-
 tests/qemu-iotests/087.out       |   6 +-
 tests/qemu-iotests/088.out       |   2 +-
 tests/qemu-iotests/089.out       |   4 +-
 tests/qemu-iotests/090.out       |   2 +-
 tests/qemu-iotests/091.out       |   2 +-
 tests/qemu-iotests/092.out       |   8 +-
 tests/qemu-iotests/095.out       |   6 +-
 tests/qemu-iotests/097.out       |  24 ++--
 tests/qemu-iotests/098.out       |  16 +--
 tests/qemu-iotests/099.out       |   4 +-
 tests/qemu-iotests/100.out       |  14 +-
 tests/qemu-iotests/103.out       |   2 +-
 tests/qemu-iotests/104.out       |   4 +-
 tests/qemu-iotests/107.out       |   2 +-
 tests/qemu-iotests/108.out       |  12 +-
 tests/qemu-iotests/common.filter |   2 +-
 util/qemu-option.c               |  10 +-
 98 files changed, 619 insertions(+), 527 deletions(-)

-- 
2.1.0

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

* Re: [Qemu-devel] [PULL 00/19] Block patches
  2014-03-07 13:32 Kevin Wolf
@ 2014-03-08 12:40 ` Peter Maydell
  0 siblings, 0 replies; 36+ messages in thread
From: Peter Maydell @ 2014-03-08 12:40 UTC (permalink / raw)
  To: Kevin Wolf; +Cc: QEMU Developers

On 7 March 2014 13:32, Kevin Wolf <kwolf@redhat.com> wrote:
> The following changes since commit f55ea6297cc0224fe4934b90ff5343b620b14669:
>
>   block/gluster: Add missing argument to qemu_gluster_init() call (2014-03-04 20:20:57 +0000)
>
> are available in the git repository at:
>
>   git://repo.or.cz/qemu/kevin.git tags/for-upstream
>
> for you to fetch changes up to 4089f7c6a0d91020ca60ce8300784c93dd9ddcbe:
>
>   block: qemu-iotests 085 - live snapshots tests (2014-03-07 11:36:12 +0100)
>
> ----------------------------------------------------------------

Applied, thanks.

-- PMM

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

* [Qemu-devel] [PULL 00/19] Block patches
@ 2014-03-07 13:32 Kevin Wolf
  2014-03-08 12:40 ` Peter Maydell
  0 siblings, 1 reply; 36+ messages in thread
From: Kevin Wolf @ 2014-03-07 13:32 UTC (permalink / raw)
  To: qemu-devel; +Cc: kwolf

The following changes since commit f55ea6297cc0224fe4934b90ff5343b620b14669:

  block/gluster: Add missing argument to qemu_gluster_init() call (2014-03-04 20:20:57 +0000)

are available in the git repository at:

  git://repo.or.cz/qemu/kevin.git tags/for-upstream

for you to fetch changes up to 4089f7c6a0d91020ca60ce8300784c93dd9ddcbe:

  block: qemu-iotests 085 - live snapshots tests (2014-03-07 11:36:12 +0100)

----------------------------------------------------------------
Block patches

----------------------------------------------------------------
Benoît Canet (1):
      block: make bdrv_swap rebuild the bs graph node list field.

Bharata B Rao (2):
      gluster: Change licence to GPLv2+
      gluster: Remove unused defines and header include

Jeff Cody (2):
      block: mirror - remove code cruft that has no function
      block: qemu-iotests 085 - live snapshots tests

Kevin Wolf (8):
      qemu-img convert: Fix progress output
      qemu-iotests: Test progress output for conversion
      iscsi: Use bs->sg for everything else than disks
      block: Fix bs->request_alignment assertion for bs->sg=1
      blockdev: Fail blockdev-add with encrypted images
      blockdev: Fix NULL pointer dereference in blockdev-add
      qemu-iotests: Test a few blockdev-add error cases
      block: Fix error path segfault in bdrv_open()

Max Reitz (5):
      block: Keep "filename" option after parsing
      block/raw-posix: Implement bdrv_parse_filename()
      block/raw-posix: Strip "file:" prefix on creation
      block/raw-win32: Implement bdrv_parse_filename()
      block/raw-win32: Strip "file:" prefix on creation

Peter Maydell (1):
      hw/ide/ahci.h: Avoid shifting left into sign bit

 block.c                    |  34 ++++++--
 block/gluster.c            |  16 +---
 block/iscsi.c              |   9 +--
 block/mirror.c             |   3 -
 block/raw-posix.c          |  14 ++++
 block/raw-win32.c          |  14 ++++
 blockdev.c                 |  15 +++-
 hw/ide/ahci.h              |  10 +--
 qemu-img.c                 |  20 ++---
 tests/qemu-iotests/051     |   9 +++
 tests/qemu-iotests/051.out |  15 ++++
 tests/qemu-iotests/085     | 192 +++++++++++++++++++++++++++++++++++++++++++++
 tests/qemu-iotests/085.out |  55 +++++++++++++
 tests/qemu-iotests/086     |  65 +++++++++++++++
 tests/qemu-iotests/086.out |  18 +++++
 tests/qemu-iotests/087     | 122 ++++++++++++++++++++++++++++
 tests/qemu-iotests/087.out |  40 ++++++++++
 tests/qemu-iotests/group   |   3 +
 18 files changed, 608 insertions(+), 46 deletions(-)
 create mode 100755 tests/qemu-iotests/085
 create mode 100644 tests/qemu-iotests/085.out
 create mode 100755 tests/qemu-iotests/086
 create mode 100644 tests/qemu-iotests/086.out
 create mode 100755 tests/qemu-iotests/087
 create mode 100644 tests/qemu-iotests/087.out

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

* Re: [Qemu-devel] [PULL 00/19] Block patches
  2012-09-24 14:26 Kevin Wolf
@ 2012-09-25 23:26 ` Anthony Liguori
  0 siblings, 0 replies; 36+ messages in thread
From: Anthony Liguori @ 2012-09-25 23:26 UTC (permalink / raw)
  To: Kevin Wolf; +Cc: qemu-devel

Kevin Wolf <kwolf@redhat.com> writes:

> The following changes since commit d3e8f95753114a827f9cd8e819b1d5cc8333f76b:
>
>   w32: Add implementation of gmtime_r, localtime_r (2012-09-23 17:09:30 +0000)
>
> are available in the git repository at:
>
>   git://repo.or.cz/qemu/kevin.git for-anthony

Pulled. Thanks.

Regards,

Anthony Liguori

>
> Jeff Cody (18):
>       block: correctly set the keep_read_only flag
>       block: make bdrv_set_enable_write_cache() modify open_flags
>       block: Framework for reopening files safely
>       block: move aio initialization into a helper function
>       block: move open flag parsing in raw block drivers to helper functions
>       block: do not parse BDRV_O_CACHE_WB in block drivers
>       block: use BDRV_O_NOCACHE instead of s->aligned_buf in raw-posix.c
>       block: purge s->aligned_buf and s->aligned_buf_size from raw-posix.c
>       block: raw-posix image file reopen
>       block: raw image file reopen
>       block: qed image file reopen
>       block: qcow2 image file reopen
>       block: qcow image file reopen
>       block: vmdk image file reopen
>       block: vdi image file reopen
>       block: vpc image file reopen
>       block: convert bdrv_commit() to use bdrv_reopen()
>       block: remove keep_read_only flag from BlockDriverState struct
>
> Kevin Shanahan (1):
>       blockdev: preserve readonly and snapshot states across media changes
>
>  block.c           |  299 ++++++++++++++++++++++++++++++++++++++++++++---------
>  block.h           |   18 +++
>  block/iscsi.c     |    4 -
>  block/qcow.c      |   10 ++
>  block/qcow2.c     |   10 ++
>  block/qed.c       |    9 ++
>  block/raw-posix.c |  225 ++++++++++++++++++++++++++++++----------
>  block/raw-win32.c |   40 ++++----
>  block/raw.c       |   10 ++
>  block/rbd.c       |    6 -
>  block/sheepdog.c  |   14 +--
>  block/vdi.c       |    7 ++
>  block/vmdk.c      |   35 ++++++
>  block/vpc.c       |    7 ++
>  block_int.h       |    9 ++-
>  blockdev.c        |    2 +
>  16 files changed, 563 insertions(+), 142 deletions(-)

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

* [Qemu-devel] [PULL 00/19] Block patches
@ 2012-09-24 14:26 Kevin Wolf
  2012-09-25 23:26 ` Anthony Liguori
  0 siblings, 1 reply; 36+ messages in thread
From: Kevin Wolf @ 2012-09-24 14:26 UTC (permalink / raw)
  To: anthony; +Cc: kwolf, qemu-devel

The following changes since commit d3e8f95753114a827f9cd8e819b1d5cc8333f76b:

  w32: Add implementation of gmtime_r, localtime_r (2012-09-23 17:09:30 +0000)

are available in the git repository at:

  git://repo.or.cz/qemu/kevin.git for-anthony

Jeff Cody (18):
      block: correctly set the keep_read_only flag
      block: make bdrv_set_enable_write_cache() modify open_flags
      block: Framework for reopening files safely
      block: move aio initialization into a helper function
      block: move open flag parsing in raw block drivers to helper functions
      block: do not parse BDRV_O_CACHE_WB in block drivers
      block: use BDRV_O_NOCACHE instead of s->aligned_buf in raw-posix.c
      block: purge s->aligned_buf and s->aligned_buf_size from raw-posix.c
      block: raw-posix image file reopen
      block: raw image file reopen
      block: qed image file reopen
      block: qcow2 image file reopen
      block: qcow image file reopen
      block: vmdk image file reopen
      block: vdi image file reopen
      block: vpc image file reopen
      block: convert bdrv_commit() to use bdrv_reopen()
      block: remove keep_read_only flag from BlockDriverState struct

Kevin Shanahan (1):
      blockdev: preserve readonly and snapshot states across media changes

 block.c           |  299 ++++++++++++++++++++++++++++++++++++++++++++---------
 block.h           |   18 +++
 block/iscsi.c     |    4 -
 block/qcow.c      |   10 ++
 block/qcow2.c     |   10 ++
 block/qed.c       |    9 ++
 block/raw-posix.c |  225 ++++++++++++++++++++++++++++++----------
 block/raw-win32.c |   40 ++++----
 block/raw.c       |   10 ++
 block/rbd.c       |    6 -
 block/sheepdog.c  |   14 +--
 block/vdi.c       |    7 ++
 block/vmdk.c      |   35 ++++++
 block/vpc.c       |    7 ++
 block_int.h       |    9 ++-
 blockdev.c        |    2 +
 16 files changed, 563 insertions(+), 142 deletions(-)

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

* Re: [Qemu-devel] [PULL 00/19] Block patches
  2011-10-21 17:18 Kevin Wolf
@ 2011-10-24 16:19 ` Anthony Liguori
  0 siblings, 0 replies; 36+ messages in thread
From: Anthony Liguori @ 2011-10-24 16:19 UTC (permalink / raw)
  To: Kevin Wolf; +Cc: qemu-devel

On 10/21/2011 12:18 PM, Kevin Wolf wrote:
> The following changes since commit c2e2343e1faae7bbc77574c12a25881b1b696808:
>
>    hw/arm_gic.c: Fix save/load of irq_target array (2011-10-21 17:19:56 +0200)
>
> are available in the git repository at:
>    git://repo.or.cz/qemu/kevin.git for-anthony

Pulled.  Thanks.

Regards,

Anthony Liguori

>
> Alex Jia (1):
>        fix memory leak in aio_write_f
>
> Kevin Wolf (5):
>        xen_disk: Always set feature-barrier = 1
>        fdc: Fix floppy port I/O
>        qemu-img: Don't allow preallocation and compression at the same time
>        qcow2: Fix bdrv_write_compressed error handling
>        pc: Fix floppy drives with if=none
>
> Paolo Bonzini (12):
>        sheepdog: add coroutine_fn markers
>        add socket_set_block
>        block: rename bdrv_co_rw_bh
>        block: unify flush implementations
>        block: add bdrv_co_discard and bdrv_aio_discard support
>        vmdk: fix return values of vmdk_parent_open
>        vmdk: clean up open
>        block: add a CoMutex to synchronous read drivers
>        block: take lock around bdrv_read implementations
>        block: take lock around bdrv_write implementations
>        block: change flush to co_flush
>        block: change discard to co_discard
>
> Stefan Hajnoczi (1):
>        block: drop redundant bdrv_flush implementation
>
>   block.c               |  258 ++++++++++++++++++++++++++++++-------------------
>   block.h               |    5 +
>   block/blkdebug.c      |    6 -
>   block/blkverify.c     |    9 --
>   block/bochs.c         |   15 +++-
>   block/cloop.c         |   15 +++-
>   block/cow.c           |   34 ++++++-
>   block/dmg.c           |   15 +++-
>   block/nbd.c           |   28 +++++-
>   block/parallels.c     |   15 +++-
>   block/qcow.c          |   17 +---
>   block/qcow2-cluster.c |    6 +-
>   block/qcow2.c         |   72 ++++++--------
>   block/qed.c           |    6 -
>   block/raw-posix.c     |   23 +----
>   block/raw-win32.c     |    4 +-
>   block/raw.c           |   23 ++---
>   block/rbd.c           |    4 +-
>   block/sheepdog.c      |   14 ++--
>   block/vdi.c           |    6 +-
>   block/vmdk.c          |   82 ++++++++++------
>   block/vpc.c           |   34 ++++++-
>   block/vvfat.c         |   28 +++++-
>   block_int.h           |    9 +-
>   hw/fdc.c              |   14 +++
>   hw/fdc.h              |    9 ++-
>   hw/pc.c               |   25 +++--
>   hw/pc.h               |    3 +-
>   hw/pc_piix.c          |    5 +-
>   hw/xen_disk.c         |    5 +-
>   oslib-posix.c         |    7 ++
>   oslib-win32.c         |    6 +
>   qemu-img.c            |   11 ++
>   qemu-io.c             |    1 +
>   qemu_socket.h         |    1 +
>   trace-events          |    1 +
>   36 files changed, 524 insertions(+), 292 deletions(-)
>
>

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

* [Qemu-devel] [PULL 00/19] Block patches
@ 2011-10-21 17:18 Kevin Wolf
  2011-10-24 16:19 ` Anthony Liguori
  0 siblings, 1 reply; 36+ messages in thread
From: Kevin Wolf @ 2011-10-21 17:18 UTC (permalink / raw)
  To: anthony; +Cc: kwolf, qemu-devel

The following changes since commit c2e2343e1faae7bbc77574c12a25881b1b696808:

  hw/arm_gic.c: Fix save/load of irq_target array (2011-10-21 17:19:56 +0200)

are available in the git repository at:
  git://repo.or.cz/qemu/kevin.git for-anthony

Alex Jia (1):
      fix memory leak in aio_write_f

Kevin Wolf (5):
      xen_disk: Always set feature-barrier = 1
      fdc: Fix floppy port I/O
      qemu-img: Don't allow preallocation and compression at the same time
      qcow2: Fix bdrv_write_compressed error handling
      pc: Fix floppy drives with if=none

Paolo Bonzini (12):
      sheepdog: add coroutine_fn markers
      add socket_set_block
      block: rename bdrv_co_rw_bh
      block: unify flush implementations
      block: add bdrv_co_discard and bdrv_aio_discard support
      vmdk: fix return values of vmdk_parent_open
      vmdk: clean up open
      block: add a CoMutex to synchronous read drivers
      block: take lock around bdrv_read implementations
      block: take lock around bdrv_write implementations
      block: change flush to co_flush
      block: change discard to co_discard

Stefan Hajnoczi (1):
      block: drop redundant bdrv_flush implementation

 block.c               |  258 ++++++++++++++++++++++++++++++-------------------
 block.h               |    5 +
 block/blkdebug.c      |    6 -
 block/blkverify.c     |    9 --
 block/bochs.c         |   15 +++-
 block/cloop.c         |   15 +++-
 block/cow.c           |   34 ++++++-
 block/dmg.c           |   15 +++-
 block/nbd.c           |   28 +++++-
 block/parallels.c     |   15 +++-
 block/qcow.c          |   17 +---
 block/qcow2-cluster.c |    6 +-
 block/qcow2.c         |   72 ++++++--------
 block/qed.c           |    6 -
 block/raw-posix.c     |   23 +----
 block/raw-win32.c     |    4 +-
 block/raw.c           |   23 ++---
 block/rbd.c           |    4 +-
 block/sheepdog.c      |   14 ++--
 block/vdi.c           |    6 +-
 block/vmdk.c          |   82 ++++++++++------
 block/vpc.c           |   34 ++++++-
 block/vvfat.c         |   28 +++++-
 block_int.h           |    9 +-
 hw/fdc.c              |   14 +++
 hw/fdc.h              |    9 ++-
 hw/pc.c               |   25 +++--
 hw/pc.h               |    3 +-
 hw/pc_piix.c          |    5 +-
 hw/xen_disk.c         |    5 +-
 oslib-posix.c         |    7 ++
 oslib-win32.c         |    6 +
 qemu-img.c            |   11 ++
 qemu-io.c             |    1 +
 qemu_socket.h         |    1 +
 trace-events          |    1 +
 36 files changed, 524 insertions(+), 292 deletions(-)

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

* Re: [Qemu-devel] [PULL 00/19] Block patches
  2010-06-15 14:19 Kevin Wolf
@ 2010-06-15 14:26 ` Anthony Liguori
  0 siblings, 0 replies; 36+ messages in thread
From: Anthony Liguori @ 2010-06-15 14:26 UTC (permalink / raw)
  To: Kevin Wolf; +Cc: qemu-devel

On 06/15/2010 09:19 AM, Kevin Wolf wrote:
> The following changes since commit fd42deeb4cb42f90084046e3ebdb4383953195e3:
>    Gerd Hoffmann (1):
>          Add exit notifiers.
>
> are available in the git repository at:
>
>    git://repo.or.cz/qemu/kevin.git for-anthony
>    

Merged.  Thanks.

Regards,

Anthony Liguori

> Blue Swirl (1):
>        block: fix a warning and possible truncation
>
> Christoph Hellwig (3):
>        cow: use pread/pwrite
>        cow: stop using mmap
>        cow: use qemu block API
>
> Jan Kiszka (1):
>        xen: Fix build error due to missing include
>
> Jes Sorensen (1):
>        Correct definitions for FD_CMD_SAVE and FD_CMD_RESTORE
>
> Kevin Wolf (5):
>        vpc: Read/write multiple sectors at once
>        qcow2: Allow get_refcount to return errors
>        qcow2: Allow alloc_clusters_noref to return errors
>        qcow2: Return real error code in load_refcount_block
>        qcow2: Restore L1 entry on l2_allocate failure
>
> Markus Armbruster (7):
>        Fix regression for "-drive file="
>        block: Move error actions from DriveInfo to BlockDriverState
>        block: Decouple block device "commit all" from DriveInfo
>        monitor: Make "commit FOO" complain when FOO doesn't exist
>        block: New bdrv_next()
>        block: Decouple savevm from DriveInfo
>        blockdev: Give drives internal linkage
>
> Miguel Di Ciurcio Filho (1):
>        savevm: Really verify if a drive supports snapshots
>
>   block.c                |   49 ++++++++++++++++++-
>   block.h                |   11 ++++
>   block/cow.c            |  127 ++++++++++++++++++++++++++----------------------
>   block/qcow2-cluster.c  |    1 +
>   block/qcow2-refcount.c |   70 +++++++++++++++++++++++----
>   block/vpc.c            |   41 +++++++++++----
>   block_int.h            |    1 +
>   blockdev.c             |   39 +++++---------
>   blockdev.h             |   12 -----
>   hw/fdc.c               |    4 +-
>   hw/ide/core.c          |    2 +-
>   hw/scsi-disk.c         |    2 +-
>   hw/virtio-blk.c        |    3 +-
>   hw/xen_backend.h       |    1 +
>   qemu-char.c            |    7 +--
>   qemu-common.h          |    3 -
>   qemu-malloc.c          |    5 --
>   savevm.c               |   90 +++++++++++++++++++---------------
>   18 files changed, 291 insertions(+), 177 deletions(-)
>
>
>    

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

* [Qemu-devel] [PULL 00/19] Block patches
@ 2010-06-15 14:19 Kevin Wolf
  2010-06-15 14:26 ` Anthony Liguori
  0 siblings, 1 reply; 36+ messages in thread
From: Kevin Wolf @ 2010-06-15 14:19 UTC (permalink / raw)
  To: anthony; +Cc: kwolf, qemu-devel

The following changes since commit fd42deeb4cb42f90084046e3ebdb4383953195e3:
  Gerd Hoffmann (1):
        Add exit notifiers.

are available in the git repository at:

  git://repo.or.cz/qemu/kevin.git for-anthony

Blue Swirl (1):
      block: fix a warning and possible truncation

Christoph Hellwig (3):
      cow: use pread/pwrite
      cow: stop using mmap
      cow: use qemu block API

Jan Kiszka (1):
      xen: Fix build error due to missing include

Jes Sorensen (1):
      Correct definitions for FD_CMD_SAVE and FD_CMD_RESTORE

Kevin Wolf (5):
      vpc: Read/write multiple sectors at once
      qcow2: Allow get_refcount to return errors
      qcow2: Allow alloc_clusters_noref to return errors
      qcow2: Return real error code in load_refcount_block
      qcow2: Restore L1 entry on l2_allocate failure

Markus Armbruster (7):
      Fix regression for "-drive file="
      block: Move error actions from DriveInfo to BlockDriverState
      block: Decouple block device "commit all" from DriveInfo
      monitor: Make "commit FOO" complain when FOO doesn't exist
      block: New bdrv_next()
      block: Decouple savevm from DriveInfo
      blockdev: Give drives internal linkage

Miguel Di Ciurcio Filho (1):
      savevm: Really verify if a drive supports snapshots

 block.c                |   49 ++++++++++++++++++-
 block.h                |   11 ++++
 block/cow.c            |  127 ++++++++++++++++++++++++++----------------------
 block/qcow2-cluster.c  |    1 +
 block/qcow2-refcount.c |   70 +++++++++++++++++++++++----
 block/vpc.c            |   41 +++++++++++----
 block_int.h            |    1 +
 blockdev.c             |   39 +++++---------
 blockdev.h             |   12 -----
 hw/fdc.c               |    4 +-
 hw/ide/core.c          |    2 +-
 hw/scsi-disk.c         |    2 +-
 hw/virtio-blk.c        |    3 +-
 hw/xen_backend.h       |    1 +
 qemu-char.c            |    7 +--
 qemu-common.h          |    3 -
 qemu-malloc.c          |    5 --
 savevm.c               |   90 +++++++++++++++++++---------------
 18 files changed, 291 insertions(+), 177 deletions(-)

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

end of thread, other threads:[~2015-01-05 11:56 UTC | newest]

Thread overview: 36+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-12-19 16:34 [Qemu-devel] [PULL 00/19] Block patches Kevin Wolf
2014-12-19 16:34 ` [Qemu-devel] [PULL 01/19] qemu-iotests: Remove 091 from quick group Kevin Wolf
2014-12-19 16:34 ` [Qemu-devel] [PULL 02/19] qemu-iotests: Speed up make check-block Kevin Wolf
2014-12-19 16:34 ` [Qemu-devel] [PULL 03/19] tests/Makefile: Add check-block to make check Kevin Wolf
2014-12-19 16:34 ` [Qemu-devel] [PULL 04/19] block: mark AioContext as recursive Kevin Wolf
2014-12-19 16:34 ` [Qemu-devel] [PULL 05/19] block: do not allocate an iovec per read of a growable/zero_after_eof BDS Kevin Wolf
2014-12-19 16:34 ` [Qemu-devel] [PULL 06/19] block: replace g_new0 with g_new for bottom half allocation Kevin Wolf
2014-12-19 16:34 ` [Qemu-devel] [PULL 07/19] checkpatch: Brace handling on multi-line condition Kevin Wolf
2014-12-19 16:34 ` [Qemu-devel] [PULL 08/19] block: Get full backing filename from string Kevin Wolf
2014-12-19 16:34 ` [Qemu-devel] [PULL 09/19] block: JSON filenames and relative backing files Kevin Wolf
2014-12-19 16:35 ` [Qemu-devel] [PULL 10/19] block: Relative backing file for image creation Kevin Wolf
2014-12-19 16:35 ` [Qemu-devel] [PULL 11/19] block/vmdk: Relative backing file for creation Kevin Wolf
2014-12-19 16:35 ` [Qemu-devel] [PULL 12/19] iotests: Add test for relative backing file names Kevin Wolf
2014-12-19 16:35 ` [Qemu-devel] [PULL 13/19] qapi: Fix document for BlockStats.node-name Kevin Wolf
2014-12-19 16:35 ` [Qemu-devel] [PULL 14/19] block: fix spoiling all dirty bitmaps by mirror and migration Kevin Wolf
2014-12-19 16:35 ` [Qemu-devel] [PULL 15/19] qapi: Comment version info in TransactionAction Kevin Wolf
2014-12-19 16:35 ` [Qemu-devel] [PULL 16/19] qmp: Add command 'blockdev-backup' Kevin Wolf
2014-12-19 16:35 ` [Qemu-devel] [PULL 17/19] block: Add blockdev-backup to transaction Kevin Wolf
2014-12-19 16:35 ` [Qemu-devel] [PULL 18/19] qemu-iotests: Test blockdev-backup in 055 Kevin Wolf
2014-12-19 16:35 ` [Qemu-devel] [PULL 19/19] iotests: Filter out "I/O thread spun..." warning Kevin Wolf
2014-12-22 11:14 ` [Qemu-devel] [PULL 00/19] Block patches Peter Maydell
2014-12-22 12:07   ` Peter Maydell
2014-12-22 12:22     ` Peter Maydell
2014-12-23  2:15       ` Fam Zheng
2015-01-05 11:55 ` Stefan Hajnoczi
  -- strict thread matches above, loose matches on Subject: below --
2015-01-05 11:51 Stefan Hajnoczi
2014-12-12 17:09 Stefan Hajnoczi
2014-12-15 11:11 ` Peter Maydell
2014-03-07 13:32 Kevin Wolf
2014-03-08 12:40 ` Peter Maydell
2012-09-24 14:26 Kevin Wolf
2012-09-25 23:26 ` Anthony Liguori
2011-10-21 17:18 Kevin Wolf
2011-10-24 16:19 ` Anthony Liguori
2010-06-15 14:19 Kevin Wolf
2010-06-15 14:26 ` Anthony Liguori

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.