qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PULL 0/9] Block layer patches for 2.12.0-rc2
@ 2018-04-03 16:33 Kevin Wolf
  2018-04-03 16:33 ` [Qemu-devel] [PULL 1/9] gluster: Fix blockdev-add with server.N.type=unix Kevin Wolf
                   ` (9 more replies)
  0 siblings, 10 replies; 13+ messages in thread
From: Kevin Wolf @ 2018-04-03 16:33 UTC (permalink / raw)
  To: qemu-block; +Cc: kwolf, peter.maydell, qemu-devel

The following changes since commit f184de7553272223d6af731d7d623a7cebf710b5:

  Merge remote-tracking branch 'remotes/riscv/tags/riscv-qemu-2.12-critical-fixes' into staging (2018-03-31 09:42:33 +0100)

are available in the git repository at:

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

for you to fetch changes up to 9c1386d3ff76c5983529884e3d8420df958c5a29:

  Merge remote-tracking branch 'mreitz/tags/pull-block-2018-04-03' into queue-block (2018-04-03 17:48:45 +0200)

----------------------------------------------------------------
Block layer patches

----------------------------------------------------------------
Alberto Garcia (3):
      iotests: Update 051 and 186 after commit 1454509726719e0933c
      iotests: Update 186 after commit ac64273c66ab136c44043259162
      iotests: Test abnormally large size in compressed cluster descriptor

Jeff Cody (1):
      block: handle invalid lseek returns gracefully

Kevin Wolf (2):
      gluster: Fix blockdev-add with server.N.type=unix
      Merge remote-tracking branch 'mreitz/tags/pull-block-2018-04-03' into queue-block

Lukáš Doktor (1):
      qemu-iotests: Use ppc64 qemu_arch on ppc64le host

Max Reitz (2):
      block/file-posix: Fix fully preallocated truncate
      iotests: Test preallocated truncate of 2G image

Vladimir Sementsov-Ogievskiy (1):
      iotests: fix 208 for luks format

 block/file-posix.c               | 19 +++++++--
 block/gluster.c                  | 21 ++++++++--
 tests/qemu-iotests/051.pc.out    | 20 ----------
 tests/qemu-iotests/106           | 24 ++++++++++++
 tests/qemu-iotests/106.out       | 10 +++++
 tests/qemu-iotests/122           | 47 ++++++++++++++++++++++
 tests/qemu-iotests/122.out       | 33 ++++++++++++++++
 tests/qemu-iotests/186           |  6 +--
 tests/qemu-iotests/186.out       | 84 ++++++++++++++--------------------------
 tests/qemu-iotests/208           |  2 +-
 tests/qemu-iotests/check         |  4 +-
 tests/qemu-iotests/common.config |  1 +
 tests/qemu-iotests/common.filter |  5 +++
 13 files changed, 184 insertions(+), 92 deletions(-)

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

* [Qemu-devel] [PULL 1/9] gluster: Fix blockdev-add with server.N.type=unix
  2018-04-03 16:33 [Qemu-devel] [PULL 0/9] Block layer patches for 2.12.0-rc2 Kevin Wolf
@ 2018-04-03 16:33 ` Kevin Wolf
  2018-04-03 21:03   ` Jeff Cody
  2018-04-03 16:33 ` [Qemu-devel] [PULL 2/9] block: handle invalid lseek returns gracefully Kevin Wolf
                   ` (8 subsequent siblings)
  9 siblings, 1 reply; 13+ messages in thread
From: Kevin Wolf @ 2018-04-03 16:33 UTC (permalink / raw)
  To: qemu-block; +Cc: kwolf, peter.maydell, qemu-devel

The legacy command line interface gets the socket path from an option
called 'socket'. QAPI in contract uses SocketAddress, where the
corresponding option is called 'path'.

Fix the gluster block driver to accept both 'socket' and 'path', with
'path' being the preferred syntax.

https://bugzilla.redhat.com/show_bug.cgi?id=1545155

Cc: qemu-stable@nongnu.org
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
---
 block/gluster.c | 21 +++++++++++++++++----
 1 file changed, 17 insertions(+), 4 deletions(-)

diff --git a/block/gluster.c b/block/gluster.c
index 296e036b3d..4adc1a875b 100644
--- a/block/gluster.c
+++ b/block/gluster.c
@@ -167,7 +167,12 @@ static QemuOptsList runtime_unix_opts = {
         {
             .name = GLUSTER_OPT_SOCKET,
             .type = QEMU_OPT_STRING,
-            .help = "socket file path)",
+            .help = "socket file path (legacy)",
+        },
+        {
+            .name = GLUSTER_OPT_PATH,
+            .type = QEMU_OPT_STRING,
+            .help = "socket file path (QAPI)",
         },
         { /* end of list */ }
     },
@@ -615,10 +620,18 @@ static int qemu_gluster_parse_json(BlockdevOptionsGluster *gconf,
                 goto out;
             }
 
-            ptr = qemu_opt_get(opts, GLUSTER_OPT_SOCKET);
+            ptr = qemu_opt_get(opts, GLUSTER_OPT_PATH);
+            if (!ptr) {
+                ptr = qemu_opt_get(opts, GLUSTER_OPT_SOCKET);
+            } else if (qemu_opt_get(opts, GLUSTER_OPT_SOCKET)) {
+                error_setg(&local_err,
+                           "Conflicting parameters 'path' and 'socket'");
+                error_append_hint(&local_err, GERR_INDEX_HINT, i);
+                goto out;
+            }
             if (!ptr) {
                 error_setg(&local_err, QERR_MISSING_PARAMETER,
-                           GLUSTER_OPT_SOCKET);
+                           GLUSTER_OPT_PATH);
                 error_append_hint(&local_err, GERR_INDEX_HINT, i);
                 goto out;
             }
@@ -684,7 +697,7 @@ static int qemu_gluster_parse(BlockdevOptionsGluster *gconf,
                              "file.server.0.host=1.2.3.4,"
                              "file.server.0.port=24007,"
                              "file.server.1.transport=unix,"
-                             "file.server.1.socket=/var/run/glusterd.socket ..."
+                             "file.server.1.path=/var/run/glusterd.socket ..."
                              "\n");
             return ret;
         }
-- 
2.13.6

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

* [Qemu-devel] [PULL 2/9] block: handle invalid lseek returns gracefully
  2018-04-03 16:33 [Qemu-devel] [PULL 0/9] Block layer patches for 2.12.0-rc2 Kevin Wolf
  2018-04-03 16:33 ` [Qemu-devel] [PULL 1/9] gluster: Fix blockdev-add with server.N.type=unix Kevin Wolf
@ 2018-04-03 16:33 ` Kevin Wolf
  2018-04-03 16:33 ` [Qemu-devel] [PULL 3/9] iotests: Update 051 and 186 after commit 1454509726719e0933c Kevin Wolf
                   ` (7 subsequent siblings)
  9 siblings, 0 replies; 13+ messages in thread
From: Kevin Wolf @ 2018-04-03 16:33 UTC (permalink / raw)
  To: qemu-block; +Cc: kwolf, peter.maydell, qemu-devel

From: Jeff Cody <jcody@redhat.com>

In commit 223a23c198787328ae75bc65d84edf5fde33c0b6, we implemented a
workaround in the gluster driver to handle invalid values returned for
SEEK_DATA or SEEK_HOLE.

In some instances, these same invalid values can be seen in the posix
file handler as well - for example, it has been reported on FUSE gluster
mounts.

Calling assert() for these invalid values is overly harsh; we can safely
return -EIO and allow this case to be treated as a "learned nothing"
case (e.g., D4 / H4, as commented in the code).

This patch does the same thing that 223a23c198787 did for gluster.c,
except in file-posix.c

Signed-off-by: Jeff Cody <jcody@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
---
 block/file-posix.c | 14 ++++++++++++--
 1 file changed, 12 insertions(+), 2 deletions(-)

diff --git a/block/file-posix.c b/block/file-posix.c
index d7fb772c14..a2f6d8a8c8 100644
--- a/block/file-posix.c
+++ b/block/file-posix.c
@@ -2114,7 +2114,12 @@ static int find_allocation(BlockDriverState *bs, off_t start,
     if (offs < 0) {
         return -errno;          /* D3 or D4 */
     }
-    assert(offs >= start);
+
+    if (offs < start) {
+        /* This is not a valid return by lseek().  We are safe to just return
+         * -EIO in this case, and we'll treat it like D4. */
+        return -EIO;
+    }
 
     if (offs > start) {
         /* D2: in hole, next data at offs */
@@ -2146,7 +2151,12 @@ static int find_allocation(BlockDriverState *bs, off_t start,
     if (offs < 0) {
         return -errno;          /* D1 and (H3 or H4) */
     }
-    assert(offs >= start);
+
+    if (offs < start) {
+        /* This is not a valid return by lseek().  We are safe to just return
+         * -EIO in this case, and we'll treat it like H4. */
+        return -EIO;
+    }
 
     if (offs > start) {
         /*
-- 
2.13.6

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

* [Qemu-devel] [PULL 3/9] iotests: Update 051 and 186 after commit 1454509726719e0933c
  2018-04-03 16:33 [Qemu-devel] [PULL 0/9] Block layer patches for 2.12.0-rc2 Kevin Wolf
  2018-04-03 16:33 ` [Qemu-devel] [PULL 1/9] gluster: Fix blockdev-add with server.N.type=unix Kevin Wolf
  2018-04-03 16:33 ` [Qemu-devel] [PULL 2/9] block: handle invalid lseek returns gracefully Kevin Wolf
@ 2018-04-03 16:33 ` Kevin Wolf
  2018-04-03 16:33 ` [Qemu-devel] [PULL 4/9] iotests: Update 186 after commit ac64273c66ab136c44043259162 Kevin Wolf
                   ` (6 subsequent siblings)
  9 siblings, 0 replies; 13+ messages in thread
From: Kevin Wolf @ 2018-04-03 16:33 UTC (permalink / raw)
  To: qemu-block; +Cc: kwolf, peter.maydell, qemu-devel

From: Alberto Garcia <berto@igalia.com>

SCSI controllers are no longer created automatically for
-drive if=scsi, so this patch updates the tests that relied
on that.

Signed-off-by: Alberto Garcia <berto@igalia.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Cc: Thomas Huth <thuth@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
---
 tests/qemu-iotests/051.pc.out | 20 --------------------
 tests/qemu-iotests/186        |  4 ----
 tests/qemu-iotests/186.out    | 28 ----------------------------
 3 files changed, 52 deletions(-)

diff --git a/tests/qemu-iotests/051.pc.out b/tests/qemu-iotests/051.pc.out
index 830c11880a..b01f9a90d7 100644
--- a/tests/qemu-iotests/051.pc.out
+++ b/tests/qemu-iotests/051.pc.out
@@ -117,20 +117,10 @@ Testing: -drive if=ide,media=cdrom
 QEMU X.Y.Z monitor - type 'help' for more information
 (qemu) quit
 
-Testing: -drive if=scsi,media=cdrom
-QEMU X.Y.Z monitor - type 'help' for more information
-(qemu) QEMU_PROG: -drive if=scsi,media=cdrom: warning: bus=0,unit=0 is deprecated with this machine type
-quit
-
 Testing: -drive if=ide
 QEMU X.Y.Z monitor - type 'help' for more information
 (qemu) QEMU_PROG: Initialization of device ide-hd failed: Device needs media, but drive is empty
 
-Testing: -drive if=scsi
-QEMU X.Y.Z monitor - type 'help' for more information
-(qemu) QEMU_PROG: -drive if=scsi: warning: bus=0,unit=0 is deprecated with this machine type
-QEMU_PROG: -drive if=scsi: Device needs media, but drive is empty
-
 Testing: -drive if=virtio
 QEMU X.Y.Z monitor - type 'help' for more information
 (qemu) QEMU_PROG: -drive if=virtio: Device needs media, but drive is empty
@@ -170,20 +160,10 @@ Testing: -drive file=TEST_DIR/t.qcow2,if=ide,media=cdrom,readonly=on
 QEMU X.Y.Z monitor - type 'help' for more information
 (qemu) quit
 
-Testing: -drive file=TEST_DIR/t.qcow2,if=scsi,media=cdrom,readonly=on
-QEMU X.Y.Z monitor - type 'help' for more information
-(qemu) QEMU_PROG: -drive file=TEST_DIR/t.qcow2,if=scsi,media=cdrom,readonly=on: warning: bus=0,unit=0 is deprecated with this machine type
-quit
-
 Testing: -drive file=TEST_DIR/t.qcow2,if=ide,readonly=on
 QEMU X.Y.Z monitor - type 'help' for more information
 (qemu) QEMU_PROG: Initialization of device ide-hd failed: Block node is read-only
 
-Testing: -drive file=TEST_DIR/t.qcow2,if=scsi,readonly=on
-QEMU X.Y.Z monitor - type 'help' for more information
-(qemu) QEMU_PROG: -drive file=TEST_DIR/t.qcow2,if=scsi,readonly=on: warning: bus=0,unit=0 is deprecated with this machine type
-quit
-
 Testing: -drive file=TEST_DIR/t.qcow2,if=virtio,readonly=on
 QEMU X.Y.Z monitor - type 'help' for more information
 (qemu) quit
diff --git a/tests/qemu-iotests/186 b/tests/qemu-iotests/186
index 44cc01ed87..9687243d34 100755
--- a/tests/qemu-iotests/186
+++ b/tests/qemu-iotests/186
@@ -133,10 +133,6 @@ check_info_block -drive if=ide,driver=null-co
 check_info_block -drive if=ide,media=cdrom
 check_info_block -drive if=ide,driver=null-co,media=cdrom
 
-check_info_block -drive if=scsi,driver=null-co
-check_info_block -drive if=scsi,media=cdrom
-check_info_block -drive if=scsi,driver=null-co,media=cdrom
-
 check_info_block -drive if=virtio,driver=null-co
 
 check_info_block -drive if=pflash,driver=null-co,size=1M
diff --git a/tests/qemu-iotests/186.out b/tests/qemu-iotests/186.out
index c8377fe146..ec75c0fc60 100644
--- a/tests/qemu-iotests/186.out
+++ b/tests/qemu-iotests/186.out
@@ -442,34 +442,6 @@ ide0-cd0 (NODE_NAME): null-co:// (null-co, read-only)
     Cache mode:       writeback
 (qemu) quit
 
-Testing: -drive if=scsi,driver=null-co
-QEMU X.Y.Z monitor - type 'help' for more information
-(qemu) QEMU_PROG: -drive if=scsi,driver=null-co: warning: bus=0,unit=0 is deprecated with this machine type
-info block
-scsi0-hd0 (NODE_NAME): null-co:// (null-co)
-    Attached to:      /machine/unattached/device[27]/scsi.0/legacy[0]
-    Cache mode:       writeback
-(qemu) quit
-
-Testing: -drive if=scsi,media=cdrom
-QEMU X.Y.Z monitor - type 'help' for more information
-(qemu) QEMU_PROG: -drive if=scsi,media=cdrom: warning: bus=0,unit=0 is deprecated with this machine type
-info block
-scsi0-cd0: [not inserted]
-    Attached to:      /machine/unattached/device[27]/scsi.0/legacy[0]
-    Removable device: not locked, tray closed
-(qemu) quit
-
-Testing: -drive if=scsi,driver=null-co,media=cdrom
-QEMU X.Y.Z monitor - type 'help' for more information
-(qemu) QEMU_PROG: -drive if=scsi,driver=null-co,media=cdrom: warning: bus=0,unit=0 is deprecated with this machine type
-info block
-scsi0-cd0 (NODE_NAME): null-co:// (null-co, read-only)
-    Attached to:      /machine/unattached/device[27]/scsi.0/legacy[0]
-    Removable device: not locked, tray closed
-    Cache mode:       writeback
-(qemu) quit
-
 Testing: -drive if=virtio,driver=null-co
 QEMU X.Y.Z monitor - type 'help' for more information
 (qemu) info block
-- 
2.13.6

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

* [Qemu-devel] [PULL 4/9] iotests: Update 186 after commit ac64273c66ab136c44043259162
  2018-04-03 16:33 [Qemu-devel] [PULL 0/9] Block layer patches for 2.12.0-rc2 Kevin Wolf
                   ` (2 preceding siblings ...)
  2018-04-03 16:33 ` [Qemu-devel] [PULL 3/9] iotests: Update 051 and 186 after commit 1454509726719e0933c Kevin Wolf
@ 2018-04-03 16:33 ` Kevin Wolf
  2018-04-03 16:33 ` [Qemu-devel] [PULL 5/9] iotests: fix 208 for luks format Kevin Wolf
                   ` (5 subsequent siblings)
  9 siblings, 0 replies; 13+ messages in thread
From: Kevin Wolf @ 2018-04-03 16:33 UTC (permalink / raw)
  To: qemu-block; +Cc: kwolf, peter.maydell, qemu-devel

From: Alberto Garcia <berto@igalia.com>

Commit ac64273c66ab136c44 modified the output of iotest 186, changing
the QOM path of floppy drives from /machine/unattached/device[17] to
/machine/unattached/device[13].

Instead of updating the test output to reflect this change, this patch
adds a new filter that hides all QOM paths from the 'Attached to:'
line of the 'info block' command.

Signed-off-by: Alberto Garcia <berto@igalia.com>
Cc: Philippe Mathieu-Daudé <f4bug@amsat.org>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
---
 tests/qemu-iotests/186           |  2 +-
 tests/qemu-iotests/186.out       | 56 ++++++++++++++++++++--------------------
 tests/qemu-iotests/common.filter |  5 ++++
 3 files changed, 34 insertions(+), 29 deletions(-)

diff --git a/tests/qemu-iotests/186 b/tests/qemu-iotests/186
index 9687243d34..0aa4395a57 100755
--- a/tests/qemu-iotests/186
+++ b/tests/qemu-iotests/186
@@ -64,7 +64,7 @@ function check_info_block()
 {
     echo "info block" |
     do_run_qemu "$@" | _filter_win32 | _filter_hmp | _filter_qemu |
-        _filter_generated_node_ids
+        _filter_generated_node_ids | _filter_qom_path
 }
 
 
diff --git a/tests/qemu-iotests/186.out b/tests/qemu-iotests/186.out
index ec75c0fc60..716b01ac3d 100644
--- a/tests/qemu-iotests/186.out
+++ b/tests/qemu-iotests/186.out
@@ -7,7 +7,7 @@ Testing: -device floppy
 QEMU X.Y.Z monitor - type 'help' for more information
 (qemu) info block
 /machine/peripheral-anon/device[1]: [not inserted]
-    Attached to:      /machine/peripheral-anon/device[1]
+    Attached to:      PATH
     Removable device: not locked, tray closed
 (qemu) quit
 
@@ -23,7 +23,7 @@ Testing: -device ide-cd
 QEMU X.Y.Z monitor - type 'help' for more information
 (qemu) info block
 /machine/peripheral-anon/device[1]: [not inserted]
-    Attached to:      /machine/peripheral-anon/device[1]
+    Attached to:      PATH
     Removable device: not locked, tray closed
 (qemu) quit
 
@@ -39,7 +39,7 @@ Testing: -device scsi-cd
 QEMU X.Y.Z monitor - type 'help' for more information
 (qemu) info block
 /machine/peripheral-anon/device[1]: [not inserted]
-    Attached to:      /machine/peripheral-anon/device[1]
+    Attached to:      PATH
     Removable device: not locked, tray closed
 (qemu) quit
 
@@ -58,7 +58,7 @@ Testing: -blockdev driver=null-co,node-name=null -device ide-hd,drive=null
 QEMU X.Y.Z monitor - type 'help' for more information
 (qemu) info block
 null: null-co:// (null-co)
-    Attached to:      /machine/peripheral-anon/device[1]
+    Attached to:      PATH
     Cache mode:       writeback
 (qemu) quit
 
@@ -74,7 +74,7 @@ Testing: -blockdev driver=null-co,node-name=null -device scsi-hd,drive=null
 QEMU X.Y.Z monitor - type 'help' for more information
 (qemu) info block
 null: null-co:// (null-co)
-    Attached to:      /machine/peripheral-anon/device[1]
+    Attached to:      PATH
     Cache mode:       writeback
 (qemu) quit
 
@@ -90,7 +90,7 @@ Testing: -blockdev driver=null-co,node-name=null -device virtio-blk-pci,drive=nu
 QEMU X.Y.Z monitor - type 'help' for more information
 (qemu) info block
 null: null-co:// (null-co)
-    Attached to:      /machine/peripheral-anon/device[1]/virtio-backend
+    Attached to:      PATH
     Cache mode:       writeback
 (qemu) quit
 
@@ -98,7 +98,7 @@ Testing: -blockdev driver=null-co,node-name=null -device virtio-blk-pci,drive=nu
 QEMU X.Y.Z monitor - type 'help' for more information
 (qemu) info block
 null: null-co:// (null-co)
-    Attached to:      /machine/peripheral/qdev_id/virtio-backend
+    Attached to:      PATH
     Cache mode:       writeback
 (qemu) quit
 
@@ -106,7 +106,7 @@ Testing: -blockdev driver=null-co,node-name=null -device floppy,drive=null
 QEMU X.Y.Z monitor - type 'help' for more information
 (qemu) info block
 null: null-co:// (null-co)
-    Attached to:      /machine/peripheral-anon/device[1]
+    Attached to:      PATH
     Removable device: not locked, tray closed
     Cache mode:       writeback
 (qemu) quit
@@ -124,7 +124,7 @@ Testing: -blockdev driver=null-co,node-name=null -device ide-cd,drive=null
 QEMU X.Y.Z monitor - type 'help' for more information
 (qemu) info block
 null: null-co:// (null-co)
-    Attached to:      /machine/peripheral-anon/device[1]
+    Attached to:      PATH
     Removable device: not locked, tray closed
     Cache mode:       writeback
 (qemu) quit
@@ -142,7 +142,7 @@ Testing: -blockdev driver=null-co,node-name=null -device scsi-cd,drive=null
 QEMU X.Y.Z monitor - type 'help' for more information
 (qemu) info block
 null: null-co:// (null-co)
-    Attached to:      /machine/peripheral-anon/device[1]
+    Attached to:      PATH
     Removable device: not locked, tray closed
     Cache mode:       writeback
 (qemu) quit
@@ -191,7 +191,7 @@ none0 (null): null-co:// (null-co)
     Cache mode:       writeback
 
 null: null-co:// (null-co)
-    Attached to:      /machine/peripheral/qdev_id/virtio-backend
+    Attached to:      PATH
     Cache mode:       writeback
 (qemu) quit
 
@@ -241,7 +241,7 @@ Testing: -drive if=none,driver=null-co,node-name=null -device ide-hd,drive=none0
 QEMU X.Y.Z monitor - type 'help' for more information
 (qemu) info block
 none0 (null): null-co:// (null-co)
-    Attached to:      /machine/peripheral-anon/device[1]
+    Attached to:      PATH
     Cache mode:       writeback
 (qemu) quit
 
@@ -257,7 +257,7 @@ Testing: -drive if=none,driver=null-co,node-name=null -device scsi-hd,drive=none
 QEMU X.Y.Z monitor - type 'help' for more information
 (qemu) info block
 none0 (null): null-co:// (null-co)
-    Attached to:      /machine/peripheral-anon/device[1]
+    Attached to:      PATH
     Cache mode:       writeback
 (qemu) quit
 
@@ -273,7 +273,7 @@ Testing: -drive if=none,driver=null-co,node-name=null -device virtio-blk-pci,dri
 QEMU X.Y.Z monitor - type 'help' for more information
 (qemu) info block
 none0 (null): null-co:// (null-co)
-    Attached to:      /machine/peripheral-anon/device[1]/virtio-backend
+    Attached to:      PATH
     Cache mode:       writeback
 (qemu) quit
 
@@ -281,7 +281,7 @@ Testing: -drive if=none,driver=null-co,node-name=null -device virtio-blk-pci,dri
 QEMU X.Y.Z monitor - type 'help' for more information
 (qemu) info block
 none0 (null): null-co:// (null-co)
-    Attached to:      /machine/peripheral/qdev_id/virtio-backend
+    Attached to:      PATH
     Cache mode:       writeback
 (qemu) quit
 
@@ -289,7 +289,7 @@ Testing: -drive if=none,driver=null-co,node-name=null -device floppy,drive=none0
 QEMU X.Y.Z monitor - type 'help' for more information
 (qemu) info block
 none0 (null): null-co:// (null-co)
-    Attached to:      /machine/peripheral-anon/device[1]
+    Attached to:      PATH
     Removable device: not locked, tray closed
     Cache mode:       writeback
 (qemu) quit
@@ -307,7 +307,7 @@ Testing: -drive if=none,driver=null-co,node-name=null -device ide-cd,drive=none0
 QEMU X.Y.Z monitor - type 'help' for more information
 (qemu) info block
 none0 (null): null-co:// (null-co)
-    Attached to:      /machine/peripheral-anon/device[1]
+    Attached to:      PATH
     Removable device: not locked, tray closed
     Cache mode:       writeback
 (qemu) quit
@@ -325,7 +325,7 @@ Testing: -drive if=none,driver=null-co,node-name=null -device scsi-cd,drive=none
 QEMU X.Y.Z monitor - type 'help' for more information
 (qemu) info block
 none0 (null): null-co:// (null-co)
-    Attached to:      /machine/peripheral-anon/device[1]
+    Attached to:      PATH
     Removable device: not locked, tray closed
     Cache mode:       writeback
 (qemu) quit
@@ -353,7 +353,7 @@ Testing: -drive if=none -device floppy,drive=none0
 QEMU X.Y.Z monitor - type 'help' for more information
 (qemu) info block
 none0: [not inserted]
-    Attached to:      /machine/peripheral-anon/device[1]
+    Attached to:      PATH
     Removable device: not locked, tray closed
 (qemu) quit
 
@@ -369,7 +369,7 @@ Testing: -drive if=none -device ide-cd,drive=none0
 QEMU X.Y.Z monitor - type 'help' for more information
 (qemu) info block
 none0: [not inserted]
-    Attached to:      /machine/peripheral-anon/device[1]
+    Attached to:      PATH
     Removable device: not locked, tray closed
 (qemu) quit
 
@@ -385,7 +385,7 @@ Testing: -drive if=none -device scsi-cd,drive=none0
 QEMU X.Y.Z monitor - type 'help' for more information
 (qemu) info block
 none0: [not inserted]
-    Attached to:      /machine/peripheral-anon/device[1]
+    Attached to:      PATH
     Removable device: not locked, tray closed
 (qemu) quit
 
@@ -404,7 +404,7 @@ Testing: -drive if=floppy
 QEMU X.Y.Z monitor - type 'help' for more information
 (qemu) info block
 floppy0: [not inserted]
-    Attached to:      /machine/unattached/device[17]
+    Attached to:      PATH
     Removable device: not locked, tray closed
 (qemu) quit
 
@@ -412,7 +412,7 @@ Testing: -drive if=floppy,driver=null-co
 QEMU X.Y.Z monitor - type 'help' for more information
 (qemu) info block
 floppy0 (NODE_NAME): null-co:// (null-co)
-    Attached to:      /machine/unattached/device[17]
+    Attached to:      PATH
     Removable device: not locked, tray closed
     Cache mode:       writeback
 (qemu) quit
@@ -421,7 +421,7 @@ Testing: -drive if=ide,driver=null-co
 QEMU X.Y.Z monitor - type 'help' for more information
 (qemu) info block
 ide0-hd0 (NODE_NAME): null-co:// (null-co)
-    Attached to:      /machine/unattached/device[18]
+    Attached to:      PATH
     Cache mode:       writeback
 (qemu) quit
 
@@ -429,7 +429,7 @@ Testing: -drive if=ide,media=cdrom
 QEMU X.Y.Z monitor - type 'help' for more information
 (qemu) info block
 ide0-cd0: [not inserted]
-    Attached to:      /machine/unattached/device[18]
+    Attached to:      PATH
     Removable device: not locked, tray closed
 (qemu) quit
 
@@ -437,7 +437,7 @@ Testing: -drive if=ide,driver=null-co,media=cdrom
 QEMU X.Y.Z monitor - type 'help' for more information
 (qemu) info block
 ide0-cd0 (NODE_NAME): null-co:// (null-co, read-only)
-    Attached to:      /machine/unattached/device[18]
+    Attached to:      PATH
     Removable device: not locked, tray closed
     Cache mode:       writeback
 (qemu) quit
@@ -446,7 +446,7 @@ Testing: -drive if=virtio,driver=null-co
 QEMU X.Y.Z monitor - type 'help' for more information
 (qemu) info block
 virtio0 (NODE_NAME): null-co:// (null-co)
-    Attached to:      /machine/peripheral-anon/device[1]/virtio-backend
+    Attached to:      PATH
     Cache mode:       writeback
 (qemu) quit
 
@@ -454,7 +454,7 @@ Testing: -drive if=pflash,driver=null-co,size=1M
 QEMU X.Y.Z monitor - type 'help' for more information
 (qemu) info block
 pflash0 (NODE_NAME): json:{"driver": "null-co", "size": "1M"} (null-co)
-    Attached to:      /machine/unattached/device[2]
+    Attached to:      PATH
     Cache mode:       writeback
 (qemu) quit
 
diff --git a/tests/qemu-iotests/common.filter b/tests/qemu-iotests/common.filter
index cb2be23340..c5f4bcf578 100644
--- a/tests/qemu-iotests/common.filter
+++ b/tests/qemu-iotests/common.filter
@@ -32,6 +32,11 @@ _filter_generated_node_ids()
      sed -re 's/\#block[0-9]{3,}/NODE_NAME/'
 }
 
+_filter_qom_path()
+{
+    sed -e 's#\(Attached to: *\) /.*#\1 PATH#'
+}
+
 # replace occurrences of the actual TEST_DIR value with TEST_DIR
 _filter_testdir()
 {
-- 
2.13.6

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

* [Qemu-devel] [PULL 5/9] iotests: fix 208 for luks format
  2018-04-03 16:33 [Qemu-devel] [PULL 0/9] Block layer patches for 2.12.0-rc2 Kevin Wolf
                   ` (3 preceding siblings ...)
  2018-04-03 16:33 ` [Qemu-devel] [PULL 4/9] iotests: Update 186 after commit ac64273c66ab136c44043259162 Kevin Wolf
@ 2018-04-03 16:33 ` Kevin Wolf
  2018-04-03 16:33 ` [Qemu-devel] [PULL 6/9] block/file-posix: Fix fully preallocated truncate Kevin Wolf
                   ` (4 subsequent siblings)
  9 siblings, 0 replies; 13+ messages in thread
From: Kevin Wolf @ 2018-04-03 16:33 UTC (permalink / raw)
  To: qemu-block; +Cc: kwolf, peter.maydell, qemu-devel

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

Support luks images creatins like in 205

Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
---
 tests/qemu-iotests/208 | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tests/qemu-iotests/208 b/tests/qemu-iotests/208
index 4e82b96c82..18f59ada94 100755
--- a/tests/qemu-iotests/208
+++ b/tests/qemu-iotests/208
@@ -28,7 +28,7 @@ with iotests.FilePath('disk.img') as disk_img_path, \
      iotests.VM() as vm:
 
     img_size = '10M'
-    iotests.qemu_img_pipe('create', '-f', iotests.imgfmt, disk_img_path, img_size)
+    iotests.qemu_img_create('-f', iotests.imgfmt, disk_img_path, img_size)
 
     iotests.log('Launching VM...')
     (vm.add_drive(disk_img_path, 'node-name=drive0-node', interface='none')
-- 
2.13.6

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

* [Qemu-devel] [PULL 6/9] block/file-posix: Fix fully preallocated truncate
  2018-04-03 16:33 [Qemu-devel] [PULL 0/9] Block layer patches for 2.12.0-rc2 Kevin Wolf
                   ` (4 preceding siblings ...)
  2018-04-03 16:33 ` [Qemu-devel] [PULL 5/9] iotests: fix 208 for luks format Kevin Wolf
@ 2018-04-03 16:33 ` Kevin Wolf
  2018-04-03 16:33 ` [Qemu-devel] [PULL 7/9] iotests: Test preallocated truncate of 2G image Kevin Wolf
                   ` (3 subsequent siblings)
  9 siblings, 0 replies; 13+ messages in thread
From: Kevin Wolf @ 2018-04-03 16:33 UTC (permalink / raw)
  To: qemu-block; +Cc: kwolf, peter.maydell, qemu-devel

From: Max Reitz <mreitz@redhat.com>

Storing the lseek() result in an int results in it overflowing when the
file is at least 2 GB big.  Then, we have a 50 % chance of the result
being "negative" and thus thinking an error occurred when actually
everything went just fine.

So we should use the correct type for storing the result: off_t.

Reported-by: Daniel P. Berrange <berrange@redhat.com>
Buglink: https://bugzilla.redhat.com/show_bug.cgi?id=1549231
Cc: qemu-stable@nongnu.org
Signed-off-by: Max Reitz <mreitz@redhat.com>
Message-id: 20180228131315.30194-2-mreitz@redhat.com
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Max Reitz <mreitz@redhat.com>
---
 block/file-posix.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/block/file-posix.c b/block/file-posix.c
index a2f6d8a8c8..3794c0007a 100644
--- a/block/file-posix.c
+++ b/block/file-posix.c
@@ -1701,6 +1701,7 @@ static int raw_regular_truncate(int fd, int64_t offset, PreallocMode prealloc,
     case PREALLOC_MODE_FULL:
     {
         int64_t num = 0, left = offset - current_length;
+        off_t seek_result;
 
         /*
          * Knowing the final size from the beginning could allow the file
@@ -1715,8 +1716,8 @@ static int raw_regular_truncate(int fd, int64_t offset, PreallocMode prealloc,
 
         buf = g_malloc0(65536);
 
-        result = lseek(fd, current_length, SEEK_SET);
-        if (result < 0) {
+        seek_result = lseek(fd, current_length, SEEK_SET);
+        if (seek_result < 0) {
             result = -errno;
             error_setg_errno(errp, -result,
                              "Failed to seek to the old end of file");
-- 
2.13.6

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

* [Qemu-devel] [PULL 7/9] iotests: Test preallocated truncate of 2G image
  2018-04-03 16:33 [Qemu-devel] [PULL 0/9] Block layer patches for 2.12.0-rc2 Kevin Wolf
                   ` (5 preceding siblings ...)
  2018-04-03 16:33 ` [Qemu-devel] [PULL 6/9] block/file-posix: Fix fully preallocated truncate Kevin Wolf
@ 2018-04-03 16:33 ` Kevin Wolf
  2018-04-03 16:33 ` [Qemu-devel] [PULL 8/9] qemu-iotests: Use ppc64 qemu_arch on ppc64le host Kevin Wolf
                   ` (2 subsequent siblings)
  9 siblings, 0 replies; 13+ messages in thread
From: Kevin Wolf @ 2018-04-03 16:33 UTC (permalink / raw)
  To: qemu-block; +Cc: kwolf, peter.maydell, qemu-devel

From: Max Reitz <mreitz@redhat.com>

Signed-off-by: Max Reitz <mreitz@redhat.com>
Message-id: 20180228131315.30194-3-mreitz@redhat.com
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Max Reitz <mreitz@redhat.com>
---
 tests/qemu-iotests/106     | 24 ++++++++++++++++++++++++
 tests/qemu-iotests/106.out | 10 ++++++++++
 2 files changed, 34 insertions(+)

diff --git a/tests/qemu-iotests/106 b/tests/qemu-iotests/106
index bfe71f4e60..5e51f88a78 100755
--- a/tests/qemu-iotests/106
+++ b/tests/qemu-iotests/106
@@ -86,6 +86,30 @@ for growth_mode in falloc full off; do
     $QEMU_IMG resize -f "$IMGFMT" --shrink --preallocation=$growth_mode "$TEST_IMG" -${GROWTH_SIZE}K
 done
 
+echo
+echo '=== Testing image growth on 2G empty image ==='
+
+for growth_mode in falloc full; do
+    echo
+    echo "--- growth_mode=$growth_mode ---"
+
+    # Maybe we want to do an lseek() to the end of the file before the
+    # preallocation; if the file has a length of 2 GB, that would
+    # return an integer that overflows to negative when put into a
+    # plain int.  We should use the correct type for the result, and
+    # this tests we do.
+
+    _make_test_img 2G
+    $QEMU_IMG resize -f "$IMGFMT" --preallocation=$growth_mode "$TEST_IMG" +${GROWTH_SIZE}K
+
+    actual_size=$($QEMU_IMG info -f "$IMGFMT" "$TEST_IMG" | grep 'disk size')
+    actual_size=$(echo "$actual_size" | sed -e 's/^[^0-9]*\([0-9]\+\).*$/\1/')
+
+    if [ $actual_size -lt $GROWTH_SIZE ]; then
+        echo "ERROR: Image should have at least ${GROWTH_SIZE}K, but has ${actual_size}K"
+    fi
+done
+
 # success, all done
 echo '*** done'
 rm -f $seq.full
diff --git a/tests/qemu-iotests/106.out b/tests/qemu-iotests/106.out
index 0a42312301..c459957660 100644
--- a/tests/qemu-iotests/106.out
+++ b/tests/qemu-iotests/106.out
@@ -47,4 +47,14 @@ qemu-img: Preallocation can only be used for growing images
 
 --- growth_mode=off ---
 Image resized.
+
+=== Testing image growth on 2G empty image ===
+
+--- growth_mode=falloc ---
+Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=2147483648
+Image resized.
+
+--- growth_mode=full ---
+Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=2147483648
+Image resized.
 *** done
-- 
2.13.6

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

* [Qemu-devel] [PULL 8/9] qemu-iotests: Use ppc64 qemu_arch on ppc64le host
  2018-04-03 16:33 [Qemu-devel] [PULL 0/9] Block layer patches for 2.12.0-rc2 Kevin Wolf
                   ` (6 preceding siblings ...)
  2018-04-03 16:33 ` [Qemu-devel] [PULL 7/9] iotests: Test preallocated truncate of 2G image Kevin Wolf
@ 2018-04-03 16:33 ` Kevin Wolf
  2018-04-03 16:34 ` [Qemu-devel] [PULL 9/9] iotests: Test abnormally large size in compressed cluster descriptor Kevin Wolf
  2018-04-04 14:40 ` [Qemu-devel] [PULL 0/9] Block layer patches for 2.12.0-rc2 Peter Maydell
  9 siblings, 0 replies; 13+ messages in thread
From: Kevin Wolf @ 2018-04-03 16:33 UTC (permalink / raw)
  To: qemu-block; +Cc: kwolf, peter.maydell, qemu-devel

From: Lukáš Doktor <ldoktor@redhat.com>

The qemu target does not always correspond to the host machine type. For
example ppc64le machine target is ppc64. Let's introduce "qemu_arch"
variable to store the matching qemu architecture related to the current
architecture and use it when auto-detecting the default qemu binary.

Signed-off-by: Lukáš Doktor <ldoktor@redhat.com>
Message-id: 20180329112053.5399-2-ldoktor@redhat.com
Signed-off-by: Max Reitz <mreitz@redhat.com>
---
 tests/qemu-iotests/check         | 4 ++--
 tests/qemu-iotests/common.config | 1 +
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/tests/qemu-iotests/check b/tests/qemu-iotests/check
index ec8033350d..aa94c6c7ea 100755
--- a/tests/qemu-iotests/check
+++ b/tests/qemu-iotests/check
@@ -538,8 +538,8 @@ if [ -z "$QEMU_PROG" ]
 then
     if [ -x "$build_iotests/qemu" ]; then
         export QEMU_PROG="$build_iotests/qemu"
-    elif [ -x "$build_root/$arch-softmmu/qemu-system-$arch" ]; then
-        export QEMU_PROG="$build_root/$arch-softmmu/qemu-system-$arch"
+    elif [ -x "$build_root/${qemu_arch}-softmmu/qemu-system-${qemu_arch}" ]; then
+        export QEMU_PROG="$build_root/${qemu_arch}-softmmu/qemu-system-${qemu_arch}"
     else
         pushd "$build_root" > /dev/null
         for binary in *-softmmu/qemu-system-*
diff --git a/tests/qemu-iotests/common.config b/tests/qemu-iotests/common.config
index cdcda54546..102aa6878a 100644
--- a/tests/qemu-iotests/common.config
+++ b/tests/qemu-iotests/common.config
@@ -23,6 +23,7 @@ PATH=".:$PATH"
 
 HOSTOS=`uname -s`
 arch=`uname -m`
+[[ "$arch" =~ "ppc64" ]] && qemu_arch=ppc64 || qemu_arch="$arch"
 
 export PWD=`pwd`
 
-- 
2.13.6

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

* [Qemu-devel] [PULL 9/9] iotests: Test abnormally large size in compressed cluster descriptor
  2018-04-03 16:33 [Qemu-devel] [PULL 0/9] Block layer patches for 2.12.0-rc2 Kevin Wolf
                   ` (7 preceding siblings ...)
  2018-04-03 16:33 ` [Qemu-devel] [PULL 8/9] qemu-iotests: Use ppc64 qemu_arch on ppc64le host Kevin Wolf
@ 2018-04-03 16:34 ` Kevin Wolf
  2018-04-04 14:40 ` [Qemu-devel] [PULL 0/9] Block layer patches for 2.12.0-rc2 Peter Maydell
  9 siblings, 0 replies; 13+ messages in thread
From: Kevin Wolf @ 2018-04-03 16:34 UTC (permalink / raw)
  To: qemu-block; +Cc: kwolf, peter.maydell, qemu-devel

From: Alberto Garcia <berto@igalia.com>

L2 entries for compressed clusters have a field that indicates the
number of sectors used to store the data in the image.

That's however not the size of the compressed data itself, just the
number of sectors where that data is located. The actual data size is
usually not a multiple of the sector size, and therefore cannot be
represented with this field.

The way it works is that QEMU reads all the specified sectors and
starts decompressing the data until there's enough to recover the
original uncompressed cluster. If there are any bytes left that
haven't been decompressed they are simply ignored.

One consequence of this is that even if the size field is larger than
it needs to be QEMU can handle it just fine: it will read more data
from disk but it will ignore the extra bytes.

This test creates an image with two compressed clusters that use 5
sectors (2.5 KB) each, increases the size field to the maximum (8192
sectors, or 4 MB) and verifies that the data can be read without
problems.

This test is important because while the decompressed data takes
exactly one cluster, the maximum value allowed in the compressed size
field is twice the cluster size. So although QEMU won't produce images
with such large values we need to make sure that it can handle them.

Another effect of increasing the size field is that it can make
it include data from the following host cluster(s). In this case
'qemu-img check' will detect that the refcounts are not correct, and
we'll need to rebuild them.

Additionally, this patch also tests that decreasing the size corrupts
the image since the original data can no longer be recovered. In this
case QEMU returns an error when trying to read the compressed data,
but 'qemu-img check' doesn't see anything wrong if the refcounts are
consistent.

One possible task for the future is to make 'qemu-img check' verify
the sizes of the compressed clusters, by trying to decompress the data
and checking that the size stored in the L2 entry is correct.

Signed-off-by: Alberto Garcia <berto@igalia.com>
Message-id: 20180329120745.11154-1-berto@igalia.com
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Max Reitz <mreitz@redhat.com>
---
 tests/qemu-iotests/122     | 47 ++++++++++++++++++++++++++++++++++++++++++++++
 tests/qemu-iotests/122.out | 33 ++++++++++++++++++++++++++++++++
 2 files changed, 80 insertions(+)

diff --git a/tests/qemu-iotests/122 b/tests/qemu-iotests/122
index 45b359c2ba..6cf4fcb866 100755
--- a/tests/qemu-iotests/122
+++ b/tests/qemu-iotests/122
@@ -130,6 +130,53 @@ $QEMU_IO -c "read -P 0    1024k 1022k" "$TEST_IMG" 2>&1 | _filter_qemu_io | _fil
 
 
 echo
+echo "=== Corrupted size field in compressed cluster descriptor ==="
+echo
+# Create an empty image and fill half of it with compressed data.
+# The L2 entries of the two compressed clusters are located at
+# 0x800000 and 0x800008, their original values are 0x4008000000a00000
+# and 0x4008000000a00802 (5 sectors for compressed data each).
+_make_test_img 8M -o cluster_size=2M
+$QEMU_IO -c "write -c -P 0x11 0 2M" -c "write -c -P 0x11 2M 2M" "$TEST_IMG" \
+         2>&1 | _filter_qemu_io | _filter_testdir
+
+# Reduce size of compressed data to 4 sectors: this corrupts the image.
+poke_file "$TEST_IMG" $((0x800000)) "\x40\x06"
+$QEMU_IO -c "read  -P 0x11 0 4M" "$TEST_IMG" 2>&1 | _filter_qemu_io | _filter_testdir
+
+# 'qemu-img check' however doesn't see anything wrong because it
+# doesn't try to decompress the data and the refcounts are consistent.
+# TODO: update qemu-img so this can be detected.
+_check_test_img
+
+# Increase size of compressed data to the maximum (8192 sectors).
+# This makes QEMU read more data (8192 sectors instead of 5, host
+# addresses [0xa00000, 0xdfffff]), but the decompression algorithm
+# stops once we have enough to restore the uncompressed cluster, so
+# the rest of the data is ignored.
+poke_file "$TEST_IMG" $((0x800000)) "\x7f\xfe"
+# Do it also for the second compressed cluster (L2 entry at 0x800008).
+# In this case the compressed data would span 3 host clusters
+# (host addresses: [0xa00802, 0xe00801])
+poke_file "$TEST_IMG" $((0x800008)) "\x7f\xfe"
+
+# Here the image is too small so we're asking QEMU to read beyond the
+# end of the image.
+$QEMU_IO -c "read  -P 0x11  0 4M" "$TEST_IMG" 2>&1 | _filter_qemu_io | _filter_testdir
+# But if we grow the image we won't be reading beyond its end anymore.
+$QEMU_IO -c "write -P 0x22 4M 4M" "$TEST_IMG" 2>&1 | _filter_qemu_io | _filter_testdir
+$QEMU_IO -c "read  -P 0x11  0 4M" "$TEST_IMG" 2>&1 | _filter_qemu_io | _filter_testdir
+
+# The refcount data is however wrong because due to the increased size
+# of the compressed data it now reaches the following host clusters.
+# This can be repaired by qemu-img check by increasing the refcount of
+# those clusters.
+# TODO: update qemu-img to correct the compressed cluster size instead.
+_check_test_img -r all
+$QEMU_IO -c "read  -P 0x11  0 4M" "$TEST_IMG" 2>&1 | _filter_qemu_io | _filter_testdir
+$QEMU_IO -c "read  -P 0x22 4M 4M" "$TEST_IMG" 2>&1 | _filter_qemu_io | _filter_testdir
+
+echo
 echo "=== Full allocation with -S 0 ==="
 echo
 
diff --git a/tests/qemu-iotests/122.out b/tests/qemu-iotests/122.out
index 47d8656db8..a6b7fe007e 100644
--- a/tests/qemu-iotests/122.out
+++ b/tests/qemu-iotests/122.out
@@ -99,6 +99,39 @@ read 1024/1024 bytes at offset 1047552
 read 1046528/1046528 bytes at offset 1048576
 1022 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
 
+=== Corrupted size field in compressed cluster descriptor ===
+
+Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=8388608
+wrote 2097152/2097152 bytes at offset 0
+2 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+wrote 2097152/2097152 bytes at offset 2097152
+2 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+read failed: Input/output error
+No errors were found on the image.
+read 4194304/4194304 bytes at offset 0
+4 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+wrote 4194304/4194304 bytes at offset 4194304
+4 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+read 4194304/4194304 bytes at offset 0
+4 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+ERROR cluster 6 refcount=1 reference=3
+ERROR cluster 7 refcount=1 reference=2
+Repairing cluster 6 refcount=1 reference=3
+Repairing cluster 7 refcount=1 reference=2
+Repairing OFLAG_COPIED data cluster: l2_entry=8000000000c00000 refcount=3
+Repairing OFLAG_COPIED data cluster: l2_entry=8000000000e00000 refcount=2
+The following inconsistencies were found and repaired:
+
+    0 leaked clusters
+    4 corruptions
+
+Double checking the fixed image now...
+No errors were found on the image.
+read 4194304/4194304 bytes at offset 0
+4 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+read 4194304/4194304 bytes at offset 4194304
+4 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+
 === Full allocation with -S 0 ===
 
 Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=67108864
-- 
2.13.6

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

* Re: [Qemu-devel] [PULL 1/9] gluster: Fix blockdev-add with server.N.type=unix
  2018-04-03 16:33 ` [Qemu-devel] [PULL 1/9] gluster: Fix blockdev-add with server.N.type=unix Kevin Wolf
@ 2018-04-03 21:03   ` Jeff Cody
  2018-04-04  9:54     ` Kevin Wolf
  0 siblings, 1 reply; 13+ messages in thread
From: Jeff Cody @ 2018-04-03 21:03 UTC (permalink / raw)
  To: Kevin Wolf; +Cc: qemu-block, peter.maydell, qemu-devel

On Tue, Apr 03, 2018 at 06:33:52PM +0200, Kevin Wolf wrote:
> The legacy command line interface gets the socket path from an option
> called 'socket'. QAPI in contract uses SocketAddress, where the
> corresponding option is called 'path'.
> 
> Fix the gluster block driver to accept both 'socket' and 'path', with
> 'path' being the preferred syntax.
> 
> https://bugzilla.redhat.com/show_bug.cgi?id=1545155
> 
> Cc: qemu-stable@nongnu.org
> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
> Reviewed-by: Eric Blake <eblake@redhat.com>

Oops, you and I had a pull request collision on this patch (it is in both of
our PRs); Sorry, my fault, I didn't know you were pulling it in through your
tree.

> ---
>  block/gluster.c | 21 +++++++++++++++++----
>  1 file changed, 17 insertions(+), 4 deletions(-)
> 
> diff --git a/block/gluster.c b/block/gluster.c
> index 296e036b3d..4adc1a875b 100644
> --- a/block/gluster.c
> +++ b/block/gluster.c
> @@ -167,7 +167,12 @@ static QemuOptsList runtime_unix_opts = {
>          {
>              .name = GLUSTER_OPT_SOCKET,
>              .type = QEMU_OPT_STRING,
> -            .help = "socket file path)",
> +            .help = "socket file path (legacy)",
> +        },
> +        {
> +            .name = GLUSTER_OPT_PATH,
> +            .type = QEMU_OPT_STRING,
> +            .help = "socket file path (QAPI)",
>          },
>          { /* end of list */ }
>      },
> @@ -615,10 +620,18 @@ static int qemu_gluster_parse_json(BlockdevOptionsGluster *gconf,
>                  goto out;
>              }
>  
> -            ptr = qemu_opt_get(opts, GLUSTER_OPT_SOCKET);
> +            ptr = qemu_opt_get(opts, GLUSTER_OPT_PATH);
> +            if (!ptr) {
> +                ptr = qemu_opt_get(opts, GLUSTER_OPT_SOCKET);
> +            } else if (qemu_opt_get(opts, GLUSTER_OPT_SOCKET)) {
> +                error_setg(&local_err,
> +                           "Conflicting parameters 'path' and 'socket'");
> +                error_append_hint(&local_err, GERR_INDEX_HINT, i);
> +                goto out;
> +            }
>              if (!ptr) {
>                  error_setg(&local_err, QERR_MISSING_PARAMETER,
> -                           GLUSTER_OPT_SOCKET);
> +                           GLUSTER_OPT_PATH);
>                  error_append_hint(&local_err, GERR_INDEX_HINT, i);
>                  goto out;
>              }
> @@ -684,7 +697,7 @@ static int qemu_gluster_parse(BlockdevOptionsGluster *gconf,
>                               "file.server.0.host=1.2.3.4,"
>                               "file.server.0.port=24007,"
>                               "file.server.1.transport=unix,"
> -                             "file.server.1.socket=/var/run/glusterd.socket ..."
> +                             "file.server.1.path=/var/run/glusterd.socket ..."
>                               "\n");
>              return ret;
>          }
> -- 
> 2.13.6
> 
> 

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

* Re: [Qemu-devel] [PULL 1/9] gluster: Fix blockdev-add with server.N.type=unix
  2018-04-03 21:03   ` Jeff Cody
@ 2018-04-04  9:54     ` Kevin Wolf
  0 siblings, 0 replies; 13+ messages in thread
From: Kevin Wolf @ 2018-04-04  9:54 UTC (permalink / raw)
  To: Jeff Cody; +Cc: qemu-block, peter.maydell, qemu-devel

Am 03.04.2018 um 23:03 hat Jeff Cody geschrieben:
> On Tue, Apr 03, 2018 at 06:33:52PM +0200, Kevin Wolf wrote:
> > The legacy command line interface gets the socket path from an option
> > called 'socket'. QAPI in contract uses SocketAddress, where the
> > corresponding option is called 'path'.
> > 
> > Fix the gluster block driver to accept both 'socket' and 'path', with
> > 'path' being the preferred syntax.
> > 
> > https://bugzilla.redhat.com/show_bug.cgi?id=1545155
> > 
> > Cc: qemu-stable@nongnu.org
> > Signed-off-by: Kevin Wolf <kwolf@redhat.com>
> > Reviewed-by: Eric Blake <eblake@redhat.com>
> 
> Oops, you and I had a pull request collision on this patch (it is in both of
> our PRs); Sorry, my fault, I didn't know you were pulling it in through your
> tree.

Or my fault for applying a patch to something that is maintained by you.
Anyway, I think git should sort it out without a problem.

Kevin

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

* Re: [Qemu-devel] [PULL 0/9] Block layer patches for 2.12.0-rc2
  2018-04-03 16:33 [Qemu-devel] [PULL 0/9] Block layer patches for 2.12.0-rc2 Kevin Wolf
                   ` (8 preceding siblings ...)
  2018-04-03 16:34 ` [Qemu-devel] [PULL 9/9] iotests: Test abnormally large size in compressed cluster descriptor Kevin Wolf
@ 2018-04-04 14:40 ` Peter Maydell
  9 siblings, 0 replies; 13+ messages in thread
From: Peter Maydell @ 2018-04-04 14:40 UTC (permalink / raw)
  To: Kevin Wolf; +Cc: Qemu-block, QEMU Developers

On 3 April 2018 at 17:33, Kevin Wolf <kwolf@redhat.com> wrote:
> The following changes since commit f184de7553272223d6af731d7d623a7cebf710b5:
>
>   Merge remote-tracking branch 'remotes/riscv/tags/riscv-qemu-2.12-critical-fixes' into staging (2018-03-31 09:42:33 +0100)
>
> are available in the git repository at:
>
>   git://repo.or.cz/qemu/kevin.git tags/for-upstream
>
> for you to fetch changes up to 9c1386d3ff76c5983529884e3d8420df958c5a29:
>
>   Merge remote-tracking branch 'mreitz/tags/pull-block-2018-04-03' into queue-block (2018-04-03 17:48:45 +0200)
>
> ----------------------------------------------------------------
> Block layer patches
>
> ----------------------------------------------------------------
> Alberto Garcia (3):
>       iotests: Update 051 and 186 after commit 1454509726719e0933c
>       iotests: Update 186 after commit ac64273c66ab136c44043259162
>       iotests: Test abnormally large size in compressed cluster descriptor
>
> Jeff Cody (1):
>       block: handle invalid lseek returns gracefully
>
> Kevin Wolf (2):
>       gluster: Fix blockdev-add with server.N.type=unix
>       Merge remote-tracking branch 'mreitz/tags/pull-block-2018-04-03' into queue-block
>
> Lukáš Doktor (1):
>       qemu-iotests: Use ppc64 qemu_arch on ppc64le host
>
> Max Reitz (2):
>       block/file-posix: Fix fully preallocated truncate
>       iotests: Test preallocated truncate of 2G image
>
> Vladimir Sementsov-Ogievskiy (1):
>       iotests: fix 208 for luks format

Applied, thanks.

-- PMM

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

end of thread, other threads:[~2018-04-04 14:41 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-04-03 16:33 [Qemu-devel] [PULL 0/9] Block layer patches for 2.12.0-rc2 Kevin Wolf
2018-04-03 16:33 ` [Qemu-devel] [PULL 1/9] gluster: Fix blockdev-add with server.N.type=unix Kevin Wolf
2018-04-03 21:03   ` Jeff Cody
2018-04-04  9:54     ` Kevin Wolf
2018-04-03 16:33 ` [Qemu-devel] [PULL 2/9] block: handle invalid lseek returns gracefully Kevin Wolf
2018-04-03 16:33 ` [Qemu-devel] [PULL 3/9] iotests: Update 051 and 186 after commit 1454509726719e0933c Kevin Wolf
2018-04-03 16:33 ` [Qemu-devel] [PULL 4/9] iotests: Update 186 after commit ac64273c66ab136c44043259162 Kevin Wolf
2018-04-03 16:33 ` [Qemu-devel] [PULL 5/9] iotests: fix 208 for luks format Kevin Wolf
2018-04-03 16:33 ` [Qemu-devel] [PULL 6/9] block/file-posix: Fix fully preallocated truncate Kevin Wolf
2018-04-03 16:33 ` [Qemu-devel] [PULL 7/9] iotests: Test preallocated truncate of 2G image Kevin Wolf
2018-04-03 16:33 ` [Qemu-devel] [PULL 8/9] qemu-iotests: Use ppc64 qemu_arch on ppc64le host Kevin Wolf
2018-04-03 16:34 ` [Qemu-devel] [PULL 9/9] iotests: Test abnormally large size in compressed cluster descriptor Kevin Wolf
2018-04-04 14:40 ` [Qemu-devel] [PULL 0/9] Block layer patches for 2.12.0-rc2 Peter Maydell

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).