All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [PULL 0/8] Block patches
@ 2013-07-15 11:16 Kevin Wolf
  2013-07-15 11:16 ` [Qemu-devel] [PULL 1/8] blockdev: add sync mode to drive-backup QMP command Kevin Wolf
                   ` (7 more replies)
  0 siblings, 8 replies; 31+ messages in thread
From: Kevin Wolf @ 2013-07-15 11:16 UTC (permalink / raw)
  To: anthony; +Cc: kwolf, qemu-devel

The following changes since commit c3cb8e77804313e1be99b5f28a34a346736707a5:

  ioport: remove LITTLE_ENDIAN mark for portio (2013-07-12 14:37:47 -0500)

are available in the git repository at:

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

for you to fetch changes up to a62eaa26c1d6d48fbdc3ac1d32bd1314f5fdc8c9:

  ahci: Fix FLUSH command (2013-07-15 11:53:55 +0200)

----------------------------------------------------------------
Kevin Wolf (6):
      block: Don't parse protocol from file.filename
      qemu-iotests: Update 051 reference output
      block: Add return value for bdrv_flush_all()
      cpus: Add return value for vm_stop()
      migration: Fail migration on bdrv_flush_all() error
      ahci: Fix FLUSH command

Stefan Hajnoczi (2):
      blockdev: add sync mode to drive-backup QMP command
      block: add drive_backup HMP command

 block.c                          |  27 ++++++---
 block/sheepdog.c                 |   2 +-
 blockdev.c                       |   6 ++
 cpus.c                           |  20 ++++---
 hmp-commands.hx                  |  20 +++++++
 hmp.c                            |  28 +++++++++
 hmp.h                            |   1 +
 hw/ide/ahci.c                    |   8 ++-
 hw/ide/core.c                    |   9 +++
 hw/ide/internal.h                |   1 +
 include/block/block.h            |   5 +-
 include/sysemu/sysemu.h          |   4 +-
 migration.c                      |  17 +++++-
 qapi-schema.json                 |   7 ++-
 qemu-img.c                       |   4 +-
 qmp-commands.hx                  |   6 +-
 stubs/vm-stop.c                  |   2 +-
 tests/qemu-iotests/051           |  12 ++++
 tests/qemu-iotests/051.out       | 121 ++++++++++++++++++++++++++++-----------
 tests/qemu-iotests/055           |  36 +++++++-----
 tests/qemu-iotests/common.filter |   2 +-
 21 files changed, 262 insertions(+), 76 deletions(-)

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

* [Qemu-devel] [PULL 1/8] blockdev: add sync mode to drive-backup QMP command
  2013-07-15 11:16 [Qemu-devel] [PULL 0/8] Block patches Kevin Wolf
@ 2013-07-15 11:16 ` Kevin Wolf
  2013-07-15 11:16 ` [Qemu-devel] [PULL 2/8] block: add drive_backup HMP command Kevin Wolf
                   ` (6 subsequent siblings)
  7 siblings, 0 replies; 31+ messages in thread
From: Kevin Wolf @ 2013-07-15 11:16 UTC (permalink / raw)
  To: anthony; +Cc: kwolf, qemu-devel

From: Stefan Hajnoczi <stefanha@redhat.com>

The drive-backup command is similar to the drive-mirror command, except
no guest data written after the command executes gets copied.  Add a
sync mode argument which determines whether the entire disk is copied,
just allocated clusters, or only clusters being written to by the guest.

Currently only sync mode 'full' is supported - it copies the entire disk.
For read-only point-in-time snapshots we may only need sync mode 'none'
since the target can be a qcow2 file using the guest's disk as its
backing file (no need to copy the entire disk).  Finally, sync mode
'top' is useful if we wish to preserve the backing chain.

Note that this patch just adds the sync mode argument to drive-backup.
It does not implement sync modes 'top' or 'none'.  This patch is
necessary so we can add a drive-backup HMP command that behaves like the
existing drive-mirror HMP command and takes a sync mode.

Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
---
 blockdev.c             |  6 ++++++
 qapi-schema.json       |  7 ++++++-
 qmp-commands.hx        |  6 +++++-
 tests/qemu-iotests/055 | 36 +++++++++++++++++++++---------------
 4 files changed, 38 insertions(+), 17 deletions(-)

diff --git a/blockdev.c b/blockdev.c
index b3a57e0..c5abd65 100644
--- a/blockdev.c
+++ b/blockdev.c
@@ -936,6 +936,7 @@ static void drive_backup_prepare(BlkTransactionState *common, Error **errp)
 
     qmp_drive_backup(backup->device, backup->target,
                      backup->has_format, backup->format,
+                     backup->sync,
                      backup->has_mode, backup->mode,
                      backup->has_speed, backup->speed,
                      backup->has_on_source_error, backup->on_source_error,
@@ -1421,6 +1422,7 @@ void qmp_block_commit(const char *device,
 
 void qmp_drive_backup(const char *device, const char *target,
                       bool has_format, const char *format,
+                      enum MirrorSyncMode sync,
                       bool has_mode, enum NewImageMode mode,
                       bool has_speed, int64_t speed,
                       bool has_on_source_error, BlockdevOnError on_source_error,
@@ -1435,6 +1437,10 @@ void qmp_drive_backup(const char *device, const char *target,
     int64_t size;
     int ret;
 
+    if (sync != MIRROR_SYNC_MODE_FULL) {
+        error_setg(errp, "only sync mode 'full' is currently supported");
+        return;
+    }
     if (!has_speed) {
         speed = 0;
     }
diff --git a/qapi-schema.json b/qapi-schema.json
index b251d28..cf57783 100644
--- a/qapi-schema.json
+++ b/qapi-schema.json
@@ -1634,6 +1634,10 @@
 # @format: #optional the format of the new destination, default is to
 #          probe if @mode is 'existing', else the format of the source
 #
+# @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).
+#
 # @mode: #optional whether and how QEMU should create a new image, default is
 #        'absolute-paths'.
 #
@@ -1655,7 +1659,8 @@
 ##
 { 'type': 'DriveBackup',
   'data': { 'device': 'str', 'target': 'str', '*format': 'str',
-            '*mode': 'NewImageMode', '*speed': 'int',
+            'sync': 'MirrorSyncMode', '*mode': 'NewImageMode',
+            '*speed': 'int',
             '*on-source-error': 'BlockdevOnError',
             '*on-target-error': 'BlockdevOnError' } }
 
diff --git a/qmp-commands.hx b/qmp-commands.hx
index 362f0e1..e075df4 100644
--- a/qmp-commands.hx
+++ b/qmp-commands.hx
@@ -913,7 +913,7 @@ EQMP
 
     {
         .name       = "drive-backup",
-        .args_type  = "device:B,target:s,speed:i?,mode:s?,format:s?,"
+        .args_type  = "sync:s,device:B,target:s,speed:i?,mode:s?,format:s?,"
                       "on-source-error:s?,on-target-error:s?",
         .mhandler.cmd_new = qmp_marshal_input_drive_backup,
     },
@@ -939,6 +939,10 @@ Arguments:
 - "format": the format of the new destination, default is to probe if 'mode' is
             'existing', else the format of the source
             (json-string, optional)
+- "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).
 - "mode": whether and how QEMU should create a new image
           (NewImageMode, optional, default 'absolute-paths')
 - "speed": the maximum speed, in bytes per second (json-int, optional)
diff --git a/tests/qemu-iotests/055 b/tests/qemu-iotests/055
index 887c959..c66f8db 100755
--- a/tests/qemu-iotests/055
+++ b/tests/qemu-iotests/055
@@ -54,7 +54,7 @@ class TestSingleDrive(iotests.QMPTestCase):
         self.assert_no_active_block_jobs()
 
         result = self.vm.qmp('drive-backup', device='drive0',
-                             target=target_img)
+                             target=target_img, sync='full')
         self.assert_qmp(result, 'return', {})
 
         event = self.cancel_and_wait()
@@ -64,7 +64,7 @@ class TestSingleDrive(iotests.QMPTestCase):
         self.assert_no_active_block_jobs()
 
         result = self.vm.qmp('drive-backup', device='drive0',
-                             target=target_img)
+                             target=target_img, sync='full')
         self.assert_qmp(result, 'return', {})
 
         result = self.vm.qmp('block-job-pause', device='drive0')
@@ -89,17 +89,17 @@ class TestSingleDrive(iotests.QMPTestCase):
 
     def test_medium_not_found(self):
         result = self.vm.qmp('drive-backup', device='ide1-cd0',
-                             target=target_img)
+                             target=target_img, sync='full')
         self.assert_qmp(result, 'error/class', 'GenericError')
 
     def test_image_not_found(self):
         result = self.vm.qmp('drive-backup', device='drive0',
-                             mode='existing', target=target_img)
+                             target=target_img, sync='full', mode='existing')
         self.assert_qmp(result, 'error/class', 'GenericError')
 
     def test_device_not_found(self):
         result = self.vm.qmp('drive-backup', device='nonexistent',
-                             target=target_img)
+                             target=target_img, sync='full')
         self.assert_qmp(result, 'error/class', 'DeviceNotFound')
 
 class TestSetSpeed(iotests.QMPTestCase):
@@ -119,7 +119,7 @@ class TestSetSpeed(iotests.QMPTestCase):
         self.assert_no_active_block_jobs()
 
         result = self.vm.qmp('drive-backup', device='drive0',
-                             target=target_img)
+                             target=target_img, sync='full')
         self.assert_qmp(result, 'return', {})
 
         # Default speed is 0
@@ -140,7 +140,7 @@ class TestSetSpeed(iotests.QMPTestCase):
 
         # Check setting speed in drive-backup works
         result = self.vm.qmp('drive-backup', device='drive0',
-                             target=target_img, speed=4*1024*1024)
+                             target=target_img, sync='full', speed=4*1024*1024)
         self.assert_qmp(result, 'return', {})
 
         result = self.vm.qmp('query-block-jobs')
@@ -154,13 +154,13 @@ class TestSetSpeed(iotests.QMPTestCase):
         self.assert_no_active_block_jobs()
 
         result = self.vm.qmp('drive-backup', device='drive0',
-                             target=target_img, speed=-1)
+                             target=target_img, sync='full', speed=-1)
         self.assert_qmp(result, 'error/class', 'GenericError')
 
         self.assert_no_active_block_jobs()
 
         result = self.vm.qmp('drive-backup', device='drive0',
-                             target=target_img)
+                             target=target_img, sync='full')
         self.assert_qmp(result, 'return', {})
 
         result = self.vm.qmp('block-job-set-speed', device='drive0', speed=-1)
@@ -196,7 +196,8 @@ class TestSingleTransaction(iotests.QMPTestCase):
         result = self.vm.qmp('transaction', actions=[{
                 'type': 'drive-backup',
                 'data': { 'device': 'drive0',
-                          'target': target_img },
+                          'target': target_img,
+                          'sync': 'full' },
             }
         ])
         self.assert_qmp(result, 'return', {})
@@ -210,7 +211,8 @@ class TestSingleTransaction(iotests.QMPTestCase):
         result = self.vm.qmp('transaction', actions=[{
                 'type': 'drive-backup',
                 'data': { 'device': 'drive0',
-                          'target': target_img },
+                          'target': target_img,
+                          'sync': 'full' },
             }
         ])
         self.assert_qmp(result, 'return', {})
@@ -239,7 +241,8 @@ class TestSingleTransaction(iotests.QMPTestCase):
         result = self.vm.qmp('transaction', actions=[{
                 'type': 'drive-backup',
                 'data': { 'device': 'ide1-cd0',
-                          'target': target_img },
+                          'target': target_img,
+                          'sync': 'full' },
             }
         ])
         self.assert_qmp(result, 'error/class', 'GenericError')
@@ -249,7 +252,8 @@ class TestSingleTransaction(iotests.QMPTestCase):
                 'type': 'drive-backup',
                 'data': { 'device': 'drive0',
                           'mode': 'existing',
-                          'target': target_img },
+                          'target': target_img,
+                          'sync': 'full' },
             }
         ])
         self.assert_qmp(result, 'error/class', 'GenericError')
@@ -259,7 +263,8 @@ class TestSingleTransaction(iotests.QMPTestCase):
                 'type': 'drive-backup',
                 'data': { 'device': 'nonexistent',
                           'mode': 'existing',
-                          'target': target_img },
+                          'target': target_img,
+                          'sync': 'full' },
             }
         ])
         self.assert_qmp(result, 'error/class', 'DeviceNotFound')
@@ -269,7 +274,8 @@ class TestSingleTransaction(iotests.QMPTestCase):
                 'type': 'drive-backup',
                 'data': { 'device': 'nonexistent',
                           'mode': 'existing',
-                          'target': target_img },
+                          'target': target_img,
+                          'sync': 'full' },
             }, {
                 'type': 'Abort',
                 'data': {},
-- 
1.8.1.4

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

* [Qemu-devel] [PULL 2/8] block: add drive_backup HMP command
  2013-07-15 11:16 [Qemu-devel] [PULL 0/8] Block patches Kevin Wolf
  2013-07-15 11:16 ` [Qemu-devel] [PULL 1/8] blockdev: add sync mode to drive-backup QMP command Kevin Wolf
@ 2013-07-15 11:16 ` Kevin Wolf
  2013-07-15 11:16 ` [Qemu-devel] [PULL 3/8] block: Don't parse protocol from file.filename Kevin Wolf
                   ` (5 subsequent siblings)
  7 siblings, 0 replies; 31+ messages in thread
From: Kevin Wolf @ 2013-07-15 11:16 UTC (permalink / raw)
  To: anthony; +Cc: kwolf, qemu-devel

From: Stefan Hajnoczi <stefanha@redhat.com>

Make "drive_backup" available on the HMP monitor:

  drive_backup [-n] [-f] device target [format]

The -n flag requests QEMU to reuse the image found in new-image-file,
instead of recreating it from scratch.

The -f flag requests QEMU to copy the whole disk, so that the result
does not need a backing file.  Note that this flag *must* currently be
passed since the other sync modes ('none' and 'top') have not been
implemented yet.  Requiring it ensures that "drive_backup" behaves like
"drive_mirror".

Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
---
 hmp-commands.hx | 20 ++++++++++++++++++++
 hmp.c           | 28 ++++++++++++++++++++++++++++
 hmp.h           |  1 +
 3 files changed, 49 insertions(+)

diff --git a/hmp-commands.hx b/hmp-commands.hx
index d1cdcfb..8c6b91a 100644
--- a/hmp-commands.hx
+++ b/hmp-commands.hx
@@ -1059,6 +1059,26 @@ using the specified target.
 ETEXI
 
     {
+        .name       = "drive_backup",
+        .args_type  = "reuse:-n,full:-f,device:B,target:s,format:s?",
+        .params     = "[-n] [-f] device target [format]",
+        .help       = "initiates a point-in-time\n\t\t\t"
+                      "copy for a device. The device's contents are\n\t\t\t"
+                      "copied to the new image file, excluding data that\n\t\t\t"
+                      "is written after the command is started.\n\t\t\t"
+                      "The -n flag requests QEMU to reuse the image found\n\t\t\t"
+                      "in new-image-file, instead of recreating it from scratch.\n\t\t\t"
+                      "The -f flag requests QEMU to copy the whole disk,\n\t\t\t"
+                      "so that the result does not need a backing file.\n\t\t\t",
+        .mhandler.cmd = hmp_drive_backup,
+    },
+STEXI
+@item drive_backup
+@findex drive_backup
+Start a point-in-time copy of a block device to a specificed target.
+ETEXI
+
+    {
         .name       = "drive_add",
         .args_type  = "pci_addr:s,opts:s",
         .params     = "[[<domain>:]<bus>:]<slot>\n"
diff --git a/hmp.c b/hmp.c
index 2daed43..dc4d8d4 100644
--- a/hmp.c
+++ b/hmp.c
@@ -907,6 +907,34 @@ void hmp_drive_mirror(Monitor *mon, const QDict *qdict)
     hmp_handle_error(mon, &errp);
 }
 
+void hmp_drive_backup(Monitor *mon, const QDict *qdict)
+{
+    const char *device = qdict_get_str(qdict, "device");
+    const char *filename = qdict_get_str(qdict, "target");
+    const char *format = qdict_get_try_str(qdict, "format");
+    int reuse = qdict_get_try_bool(qdict, "reuse", 0);
+    int full = qdict_get_try_bool(qdict, "full", 0);
+    enum NewImageMode mode;
+    Error *errp = NULL;
+
+    if (!filename) {
+        error_set(&errp, QERR_MISSING_PARAMETER, "target");
+        hmp_handle_error(mon, &errp);
+        return;
+    }
+
+    if (reuse) {
+        mode = NEW_IMAGE_MODE_EXISTING;
+    } else {
+        mode = NEW_IMAGE_MODE_ABSOLUTE_PATHS;
+    }
+
+    qmp_drive_backup(device, filename, !!format, format,
+                     full ? MIRROR_SYNC_MODE_FULL : MIRROR_SYNC_MODE_TOP,
+                     true, mode, false, 0, false, 0, false, 0, &errp);
+    hmp_handle_error(mon, &errp);
+}
+
 void hmp_snapshot_blkdev(Monitor *mon, const QDict *qdict)
 {
     const char *device = qdict_get_str(qdict, "device");
diff --git a/hmp.h b/hmp.h
index 56d2e92..6c3bdcd 100644
--- a/hmp.h
+++ b/hmp.h
@@ -55,6 +55,7 @@ void hmp_balloon(Monitor *mon, const QDict *qdict);
 void hmp_block_resize(Monitor *mon, const QDict *qdict);
 void hmp_snapshot_blkdev(Monitor *mon, const QDict *qdict);
 void hmp_drive_mirror(Monitor *mon, const QDict *qdict);
+void hmp_drive_backup(Monitor *mon, const QDict *qdict);
 void hmp_migrate_cancel(Monitor *mon, const QDict *qdict);
 void hmp_migrate_set_downtime(Monitor *mon, const QDict *qdict);
 void hmp_migrate_set_speed(Monitor *mon, const QDict *qdict);
-- 
1.8.1.4

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

* [Qemu-devel] [PULL 3/8] block: Don't parse protocol from file.filename
  2013-07-15 11:16 [Qemu-devel] [PULL 0/8] Block patches Kevin Wolf
  2013-07-15 11:16 ` [Qemu-devel] [PULL 1/8] blockdev: add sync mode to drive-backup QMP command Kevin Wolf
  2013-07-15 11:16 ` [Qemu-devel] [PULL 2/8] block: add drive_backup HMP command Kevin Wolf
@ 2013-07-15 11:16 ` Kevin Wolf
  2013-07-15 11:16 ` [Qemu-devel] [PULL 4/8] qemu-iotests: Update 051 reference output Kevin Wolf
                   ` (4 subsequent siblings)
  7 siblings, 0 replies; 31+ messages in thread
From: Kevin Wolf @ 2013-07-15 11:16 UTC (permalink / raw)
  To: anthony; +Cc: kwolf, qemu-devel

One of the major reasons for doing something new for -blockdev and
blockdev-add was that the old block layer code parses filenames instead
of just taking them literally. So we should really leave it untouched
when it's passing using the new interfaces (like -drive
file.filename=...).

This allows opening relative file names that contain a colon.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
---
 block.c                    | 17 ++++++++++++-----
 block/sheepdog.c           |  2 +-
 include/block/block.h      |  3 ++-
 qemu-img.c                 |  4 ++--
 tests/qemu-iotests/051     | 12 ++++++++++++
 tests/qemu-iotests/051.out | 14 ++++++++++++++
 6 files changed, 43 insertions(+), 9 deletions(-)

diff --git a/block.c b/block.c
index 183fec8..2df65c8 100644
--- a/block.c
+++ b/block.c
@@ -417,7 +417,7 @@ int bdrv_create_file(const char* filename, QEMUOptionParameter *options)
 {
     BlockDriver *drv;
 
-    drv = bdrv_find_protocol(filename);
+    drv = bdrv_find_protocol(filename, true);
     if (drv == NULL) {
         return -ENOENT;
     }
@@ -482,7 +482,8 @@ static BlockDriver *find_hdev_driver(const char *filename)
     return drv;
 }
 
-BlockDriver *bdrv_find_protocol(const char *filename)
+BlockDriver *bdrv_find_protocol(const char *filename,
+                                bool allow_protocol_prefix)
 {
     BlockDriver *drv1;
     char protocol[128];
@@ -503,9 +504,10 @@ BlockDriver *bdrv_find_protocol(const char *filename)
         return drv1;
     }
 
-    if (!path_has_protocol(filename)) {
+    if (!path_has_protocol(filename) || !allow_protocol_prefix) {
         return bdrv_find_format("file");
     }
+
     p = strchr(filename, ':');
     assert(p != NULL);
     len = p - filename;
@@ -784,6 +786,7 @@ int bdrv_file_open(BlockDriverState **pbs, const char *filename,
     BlockDriverState *bs;
     BlockDriver *drv;
     const char *drvname;
+    bool allow_protocol_prefix = false;
     int ret;
 
     /* NULL means an empty set of options */
@@ -800,6 +803,7 @@ int bdrv_file_open(BlockDriverState **pbs, const char *filename,
         filename = qdict_get_try_str(options, "filename");
     } else if (filename && !qdict_haskey(options, "filename")) {
         qdict_put(options, "filename", qstring_from_str(filename));
+        allow_protocol_prefix = true;
     } else {
         qerror_report(ERROR_CLASS_GENERIC_ERROR, "Can't specify 'file' and "
                       "'filename' options at the same time");
@@ -813,7 +817,10 @@ int bdrv_file_open(BlockDriverState **pbs, const char *filename,
         drv = bdrv_find_whitelisted_format(drvname, !(flags & BDRV_O_RDWR));
         qdict_del(options, "driver");
     } else if (filename) {
-        drv = bdrv_find_protocol(filename);
+        drv = bdrv_find_protocol(filename, allow_protocol_prefix);
+        if (!drv) {
+            qerror_report(ERROR_CLASS_GENERIC_ERROR, "Unknown protocol");
+        }
     } else {
         qerror_report(ERROR_CLASS_GENERIC_ERROR,
                       "Must specify either driver or file");
@@ -4452,7 +4459,7 @@ void bdrv_img_create(const char *filename, const char *fmt,
         return;
     }
 
-    proto_drv = bdrv_find_protocol(filename);
+    proto_drv = bdrv_find_protocol(filename, true);
     if (!proto_drv) {
         error_setg(errp, "Unknown protocol '%s'", filename);
         return;
diff --git a/block/sheepdog.c b/block/sheepdog.c
index b397b5b..6a41ad9 100644
--- a/block/sheepdog.c
+++ b/block/sheepdog.c
@@ -1510,7 +1510,7 @@ static int sd_create(const char *filename, QEMUOptionParameter *options)
         BlockDriver *drv;
 
         /* Currently, only Sheepdog backing image is supported. */
-        drv = bdrv_find_protocol(backing_file);
+        drv = bdrv_find_protocol(backing_file, true);
         if (!drv || strcmp(drv->protocol_name, "sheepdog") != 0) {
             error_report("backing_file must be a sheepdog image");
             ret = -EINVAL;
diff --git a/include/block/block.h b/include/block/block.h
index dd8eca1..eeb4816 100644
--- a/include/block/block.h
+++ b/include/block/block.h
@@ -111,7 +111,8 @@ bool bdrv_io_limits_enabled(BlockDriverState *bs);
 
 void bdrv_init(void);
 void bdrv_init_with_whitelist(void);
-BlockDriver *bdrv_find_protocol(const char *filename);
+BlockDriver *bdrv_find_protocol(const char *filename,
+                                bool allow_protocol_prefix);
 BlockDriver *bdrv_find_format(const char *format_name);
 BlockDriver *bdrv_find_whitelisted_format(const char *format_name,
                                           bool readonly);
diff --git a/qemu-img.c b/qemu-img.c
index f8c97d3..c55ca5c 100644
--- a/qemu-img.c
+++ b/qemu-img.c
@@ -240,7 +240,7 @@ static int print_block_option_help(const char *filename, const char *fmt)
         return 1;
     }
 
-    proto_drv = bdrv_find_protocol(filename);
+    proto_drv = bdrv_find_protocol(filename, true);
     if (!proto_drv) {
         error_report("Unknown protocol '%s'", filename);
         return 1;
@@ -1261,7 +1261,7 @@ static int img_convert(int argc, char **argv)
         goto out;
     }
 
-    proto_drv = bdrv_find_protocol(out_filename);
+    proto_drv = bdrv_find_protocol(out_filename, true);
     if (!proto_drv) {
         error_report("Unknown protocol '%s'", out_filename);
         ret = -1;
diff --git a/tests/qemu-iotests/051 b/tests/qemu-iotests/051
index 8039e23..1cf8bf7 100755
--- a/tests/qemu-iotests/051
+++ b/tests/qemu-iotests/051
@@ -149,6 +149,18 @@ echo
 run_qemu -drive file=$TEST_IMG,file.driver=file
 run_qemu -drive file=$TEST_IMG,file.driver=qcow2
 
+echo
+echo === Parsing protocol from file name ===
+echo
+
+# Protocol strings are supposed to be parsed from traditional option strings,
+# but not when using driver-specific options. We can distinguish them by the
+# error message for non-existing files.
+
+run_qemu -hda foo:bar
+run_qemu -drive file=foo:bar
+run_qemu -drive file.filename=foo:bar
+
 # success, all done
 echo "*** done"
 rm -f $seq.full
diff --git a/tests/qemu-iotests/051.out b/tests/qemu-iotests/051.out
index 3d1ac7b..6b3d636 100644
--- a/tests/qemu-iotests/051.out
+++ b/tests/qemu-iotests/051.out
@@ -169,4 +169,18 @@ Testing: -drive file=TEST_DIR/t.qcow2,file.driver=qcow2
 QEMU_PROG: -drive file=TEST_DIR/t.qcow2,file.driver=qcow2: Can't use 'qcow2' as a block driver for the protocol level
 QEMU_PROG: -drive file=TEST_DIR/t.qcow2,file.driver=qcow2: could not open disk image TEST_DIR/t.qcow2: Invalid argument
 
+
+=== Parsing protocol from file name ===
+
+Testing: -hda foo:bar
+QEMU_PROG: -hda foo:bar: Unknown protocol
+QEMU_PROG: -hda foo:bar: could not open disk image foo:bar: No such file or directory
+
+Testing: -drive file=foo:bar
+QEMU_PROG: -drive file=foo:bar: Unknown protocol
+QEMU_PROG: -drive file=foo:bar: could not open disk image foo:bar: No such file or directory
+
+Testing: -drive file.filename=foo:bar
+QEMU_PROG: -drive file.filename=foo:bar: could not open disk image ide0-hd0: No such file or directory
+
 *** done
-- 
1.8.1.4

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

* [Qemu-devel] [PULL 4/8] qemu-iotests: Update 051 reference output
  2013-07-15 11:16 [Qemu-devel] [PULL 0/8] Block patches Kevin Wolf
                   ` (2 preceding siblings ...)
  2013-07-15 11:16 ` [Qemu-devel] [PULL 3/8] block: Don't parse protocol from file.filename Kevin Wolf
@ 2013-07-15 11:16 ` Kevin Wolf
  2013-07-15 11:16 ` [Qemu-devel] [PULL 5/8] block: Add return value for bdrv_flush_all() Kevin Wolf
                   ` (3 subsequent siblings)
  7 siblings, 0 replies; 31+ messages in thread
From: Kevin Wolf @ 2013-07-15 11:16 UTC (permalink / raw)
  To: anthony; +Cc: kwolf, qemu-devel

This has been broken by commit bd5c51ee.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
---
 tests/qemu-iotests/051.out       | 107 +++++++++++++++++++++++++++------------
 tests/qemu-iotests/common.filter |   2 +-
 2 files changed, 76 insertions(+), 33 deletions(-)

diff --git a/tests/qemu-iotests/051.out b/tests/qemu-iotests/051.out
index 6b3d636..95ff245 100644
--- a/tests/qemu-iotests/051.out
+++ b/tests/qemu-iotests/051.out
@@ -23,10 +23,12 @@ QEMU_PROG: -drive file=TEST_DIR/t.qcow2,format=qcow2,unknown_opt=foo: could not
 === Enable and disable lazy refcounting on the command line, plus some invalid values ===
 
 Testing: -drive file=TEST_DIR/t.qcow2,format=qcow2,lazy_refcounts=on
-q^[[K^[[Dqu^[[K^[[D^[[Dqui^[[K^[[D^[[D^[[Dquit^[[K
+QEMU 1.5.50 monitor - type 'help' for more information
+(qemu) q^[[K^[[Dqu^[[K^[[D^[[Dqui^[[K^[[D^[[D^[[Dquit^[[K
 
 Testing: -drive file=TEST_DIR/t.qcow2,format=qcow2,lazy_refcounts=off
-q^[[K^[[Dqu^[[K^[[D^[[Dqui^[[K^[[D^[[D^[[Dquit^[[K
+QEMU 1.5.50 monitor - type 'help' for more information
+(qemu) q^[[K^[[Dqu^[[K^[[D^[[Dqui^[[K^[[D^[[D^[[Dquit^[[K
 
 Testing: -drive file=TEST_DIR/t.qcow2,format=qcow2,lazy_refcounts=
 QEMU_PROG: -drive file=TEST_DIR/t.qcow2,format=qcow2,lazy_refcounts=: Parameter 'lazy_refcounts' expects 'on' or 'off'
@@ -49,112 +51,152 @@ QEMU_PROG: -drive file=TEST_DIR/t.qcow2,format=qcow2,lazy_refcounts=on: Lazy ref
 QEMU_PROG: -drive file=TEST_DIR/t.qcow2,format=qcow2,lazy_refcounts=on: could not open disk image TEST_DIR/t.qcow2: Invalid argument
 
 Testing: -drive file=TEST_DIR/t.qcow2,format=qcow2,lazy_refcounts=off
-q^[[K^[[Dqu^[[K^[[D^[[Dqui^[[K^[[D^[[D^[[Dquit^[[K
+QEMU 1.5.50 monitor - type 'help' for more information
+(qemu) q^[[K^[[Dqu^[[K^[[D^[[Dqui^[[K^[[D^[[D^[[Dquit^[[K
 
 
 === No medium ===
 
 Testing: -drive if=floppy
-q^[[K^[[Dqu^[[K^[[D^[[Dqui^[[K^[[D^[[D^[[Dquit^[[K
+QEMU 1.5.50 monitor - type 'help' for more information
+(qemu) q^[[K^[[Dqu^[[K^[[D^[[Dqui^[[K^[[D^[[D^[[Dquit^[[K
 
 Testing: -drive if=ide,media=cdrom
-q^[[K^[[Dqu^[[K^[[D^[[Dqui^[[K^[[D^[[D^[[Dquit^[[K
+QEMU 1.5.50 monitor - type 'help' for more information
+(qemu) q^[[K^[[Dqu^[[K^[[D^[[Dqui^[[K^[[D^[[D^[[Dquit^[[K
 
 Testing: -drive if=scsi,media=cdrom
-q^[[K^[[Dqu^[[K^[[D^[[Dqui^[[K^[[D^[[D^[[Dquit^[[K
+QEMU 1.5.50 monitor - type 'help' for more information
+(qemu) q^[[K^[[Dqu^[[K^[[D^[[Dqui^[[K^[[D^[[D^[[Dquit^[[K
 
 Testing: -drive if=ide
-QEMU_PROG: Device needs media, but drive is empty
+QEMU 1.5.50 monitor - type 'help' for more information
+(qemu) QEMU_PROG: Device needs media, but drive is empty
+QEMU_PROG: Device initialization failed.
 QEMU_PROG: Initialization of device ide-hd failed
 
 Testing: -drive if=virtio
-QEMU_PROG: -drive if=virtio: Device needs media, but drive is empty
+QEMU 1.5.50 monitor - type 'help' for more information
+(qemu) QEMU_PROG: -drive if=virtio: Device needs media, but drive is empty
+QEMU_PROG: -drive if=virtio: Device initialization failed.
+QEMU_PROG: -drive if=virtio: Device initialization failed.
 QEMU_PROG: -drive if=virtio: Device 'virtio-blk-pci' could not be initialized
 
 Testing: -drive if=scsi
-QEMU_PROG: -drive if=scsi: Device needs media, but drive is empty
+QEMU 1.5.50 monitor - type 'help' for more information
+(qemu) QEMU_PROG: -drive if=scsi: Device needs media, but drive is empty
+QEMU_PROG: -drive if=scsi: Device initialization failed.
+QEMU_PROG: Device initialization failed.
 QEMU_PROG: Initialization of device lsi53c895a failed
 
 Testing: -drive if=none,id=disk -device ide-cd,drive=disk
-q^[[K^[[Dqu^[[K^[[D^[[Dqui^[[K^[[D^[[D^[[Dquit^[[K
+QEMU 1.5.50 monitor - type 'help' for more information
+(qemu) q^[[K^[[Dqu^[[K^[[D^[[Dqui^[[K^[[D^[[D^[[Dquit^[[K
 
 Testing: -drive if=none,id=disk -device lsi53c895a -device scsi-cd,drive=disk
-q^[[K^[[Dqu^[[K^[[D^[[Dqui^[[K^[[D^[[D^[[Dquit^[[K
+QEMU 1.5.50 monitor - type 'help' for more information
+(qemu) q^[[K^[[Dqu^[[K^[[D^[[Dqui^[[K^[[D^[[D^[[Dquit^[[K
 
 Testing: -drive if=none,id=disk -device ide-drive,drive=disk
-QEMU_PROG: -device ide-drive,drive=disk: Device needs media, but drive is empty
+QEMU 1.5.50 monitor - type 'help' for more information
+(qemu) QEMU_PROG: -device ide-drive,drive=disk: Device needs media, but drive is empty
+QEMU_PROG: -device ide-drive,drive=disk: Device initialization failed.
 QEMU_PROG: -device ide-drive,drive=disk: Device 'ide-drive' could not be initialized
 
 Testing: -drive if=none,id=disk -device ide-hd,drive=disk
-QEMU_PROG: -device ide-hd,drive=disk: Device needs media, but drive is empty
+QEMU 1.5.50 monitor - type 'help' for more information
+(qemu) QEMU_PROG: -device ide-hd,drive=disk: Device needs media, but drive is empty
+QEMU_PROG: -device ide-hd,drive=disk: Device initialization failed.
 QEMU_PROG: -device ide-hd,drive=disk: Device 'ide-hd' could not be initialized
 
 Testing: -drive if=none,id=disk -device lsi53c895a -device scsi-disk,drive=disk
-QEMU_PROG: -device scsi-disk,drive=disk: Device needs media, but drive is empty
+QEMU 1.5.50 monitor - type 'help' for more information
+(qemu) QEMU_PROG: -device scsi-disk,drive=disk: Device needs media, but drive is empty
+QEMU_PROG: -device scsi-disk,drive=disk: Device initialization failed.
 QEMU_PROG: -device scsi-disk,drive=disk: Device 'scsi-disk' could not be initialized
 
 Testing: -drive if=none,id=disk -device lsi53c895a -device scsi-hd,drive=disk
-QEMU_PROG: -device scsi-hd,drive=disk: Device needs media, but drive is empty
+QEMU 1.5.50 monitor - type 'help' for more information
+(qemu) QEMU_PROG: -device scsi-hd,drive=disk: Device needs media, but drive is empty
+QEMU_PROG: -device scsi-hd,drive=disk: Device initialization failed.
 QEMU_PROG: -device scsi-hd,drive=disk: Device 'scsi-hd' could not be initialized
 
 
 === Read-only ===
 
 Testing: -drive file=TEST_DIR/t.qcow2,if=floppy,readonly=on
-q^[[K^[[Dqu^[[K^[[D^[[Dqui^[[K^[[D^[[D^[[Dquit^[[K
+QEMU 1.5.50 monitor - type 'help' for more information
+(qemu) q^[[K^[[Dqu^[[K^[[D^[[Dqui^[[K^[[D^[[D^[[Dquit^[[K
 
 Testing: -drive file=TEST_DIR/t.qcow2,if=ide,media=cdrom,readonly=on
-q^[[K^[[Dqu^[[K^[[D^[[Dqui^[[K^[[D^[[D^[[Dquit^[[K
+QEMU 1.5.50 monitor - type 'help' for more information
+(qemu) q^[[K^[[Dqu^[[K^[[D^[[Dqui^[[K^[[D^[[D^[[Dquit^[[K
 
 Testing: -drive file=TEST_DIR/t.qcow2,if=scsi,media=cdrom,readonly=on
-q^[[K^[[Dqu^[[K^[[D^[[Dqui^[[K^[[D^[[D^[[Dquit^[[K
+QEMU 1.5.50 monitor - type 'help' for more information
+(qemu) q^[[K^[[Dqu^[[K^[[D^[[Dqui^[[K^[[D^[[D^[[Dquit^[[K
 
 Testing: -drive file=TEST_DIR/t.qcow2,if=ide,readonly=on
 QEMU_PROG: -drive file=TEST_DIR/t.qcow2,if=ide,readonly=on: readonly not supported by this bus type
 
 Testing: -drive file=TEST_DIR/t.qcow2,if=virtio,readonly=on
-q^[[K^[[Dqu^[[K^[[D^[[Dqui^[[K^[[D^[[D^[[Dquit^[[K
+QEMU 1.5.50 monitor - type 'help' for more information
+(qemu) q^[[K^[[Dqu^[[K^[[D^[[Dqui^[[K^[[D^[[D^[[Dquit^[[K
 
 Testing: -drive file=TEST_DIR/t.qcow2,if=scsi,readonly=on
-q^[[K^[[Dqu^[[K^[[D^[[Dqui^[[K^[[D^[[D^[[Dquit^[[K
+QEMU 1.5.50 monitor - type 'help' for more information
+(qemu) q^[[K^[[Dqu^[[K^[[D^[[Dqui^[[K^[[D^[[D^[[Dquit^[[K
 
 Testing: -drive file=TEST_DIR/t.qcow2,if=none,id=disk,readonly=on -device ide-cd,drive=disk
-q^[[K^[[Dqu^[[K^[[D^[[Dqui^[[K^[[D^[[D^[[Dquit^[[K
+QEMU 1.5.50 monitor - type 'help' for more information
+(qemu) q^[[K^[[Dqu^[[K^[[D^[[Dqui^[[K^[[D^[[D^[[Dquit^[[K
 
 Testing: -drive file=TEST_DIR/t.qcow2,if=none,id=disk,readonly=on -device lsi53c895a -device scsi-cd,drive=disk
-q^[[K^[[Dqu^[[K^[[D^[[Dqui^[[K^[[D^[[D^[[Dquit^[[K
+QEMU 1.5.50 monitor - type 'help' for more information
+(qemu) q^[[K^[[Dqu^[[K^[[D^[[Dqui^[[K^[[D^[[D^[[Dquit^[[K
 
 Testing: -drive file=TEST_DIR/t.qcow2,if=none,id=disk,readonly=on -device ide-drive,drive=disk
-QEMU_PROG: -device ide-drive,drive=disk: Can't use a read-only drive
+QEMU 1.5.50 monitor - type 'help' for more information
+(qemu) QEMU_PROG: -device ide-drive,drive=disk: Can't use a read-only drive
+QEMU_PROG: -device ide-drive,drive=disk: Device initialization failed.
 QEMU_PROG: -device ide-drive,drive=disk: Device 'ide-drive' could not be initialized
 
 Testing: -drive file=TEST_DIR/t.qcow2,if=none,id=disk,readonly=on -device ide-hd,drive=disk
-QEMU_PROG: -device ide-hd,drive=disk: Can't use a read-only drive
+QEMU 1.5.50 monitor - type 'help' for more information
+(qemu) QEMU_PROG: -device ide-hd,drive=disk: Can't use a read-only drive
+QEMU_PROG: -device ide-hd,drive=disk: Device initialization failed.
 QEMU_PROG: -device ide-hd,drive=disk: Device 'ide-hd' could not be initialized
 
 Testing: -drive file=TEST_DIR/t.qcow2,if=none,id=disk,readonly=on -device lsi53c895a -device scsi-disk,drive=disk
-q^[[K^[[Dqu^[[K^[[D^[[Dqui^[[K^[[D^[[D^[[Dquit^[[K
+QEMU 1.5.50 monitor - type 'help' for more information
+(qemu) q^[[K^[[Dqu^[[K^[[D^[[Dqui^[[K^[[D^[[D^[[Dquit^[[K
 
 Testing: -drive file=TEST_DIR/t.qcow2,if=none,id=disk,readonly=on -device lsi53c895a -device scsi-hd,drive=disk
-q^[[K^[[Dqu^[[K^[[D^[[Dqui^[[K^[[D^[[D^[[Dquit^[[K
+QEMU 1.5.50 monitor - type 'help' for more information
+(qemu) q^[[K^[[Dqu^[[K^[[D^[[Dqui^[[K^[[D^[[D^[[Dquit^[[K
 
 
 === Cache modes ===
 
 Testing: -drive media=cdrom,cache=none
-q^[[K^[[Dqu^[[K^[[D^[[Dqui^[[K^[[D^[[D^[[Dquit^[[K
+QEMU 1.5.50 monitor - type 'help' for more information
+(qemu) q^[[K^[[Dqu^[[K^[[D^[[Dqui^[[K^[[D^[[D^[[Dquit^[[K
 
 Testing: -drive media=cdrom,cache=directsync
-q^[[K^[[Dqu^[[K^[[D^[[Dqui^[[K^[[D^[[D^[[Dquit^[[K
+QEMU 1.5.50 monitor - type 'help' for more information
+(qemu) q^[[K^[[Dqu^[[K^[[D^[[Dqui^[[K^[[D^[[D^[[Dquit^[[K
 
 Testing: -drive media=cdrom,cache=writeback
-q^[[K^[[Dqu^[[K^[[D^[[Dqui^[[K^[[D^[[D^[[Dquit^[[K
+QEMU 1.5.50 monitor - type 'help' for more information
+(qemu) q^[[K^[[Dqu^[[K^[[D^[[Dqui^[[K^[[D^[[D^[[Dquit^[[K
 
 Testing: -drive media=cdrom,cache=writethrough
-q^[[K^[[Dqu^[[K^[[D^[[Dqui^[[K^[[D^[[D^[[Dquit^[[K
+QEMU 1.5.50 monitor - type 'help' for more information
+(qemu) q^[[K^[[Dqu^[[K^[[D^[[Dqui^[[K^[[D^[[D^[[Dquit^[[K
 
 Testing: -drive media=cdrom,cache=unsafe
-q^[[K^[[Dqu^[[K^[[D^[[Dqui^[[K^[[D^[[D^[[Dquit^[[K
+QEMU 1.5.50 monitor - type 'help' for more information
+(qemu) q^[[K^[[Dqu^[[K^[[D^[[Dqui^[[K^[[D^[[D^[[Dquit^[[K
 
 Testing: -drive media=cdrom,cache=invalid_value
 QEMU_PROG: -drive media=cdrom,cache=invalid_value: invalid cache option
@@ -163,7 +205,8 @@ QEMU_PROG: -drive media=cdrom,cache=invalid_value: invalid cache option
 === Specifying the protocol layer ===
 
 Testing: -drive file=TEST_DIR/t.qcow2,file.driver=file
-q^[[K^[[Dqu^[[K^[[D^[[Dqui^[[K^[[D^[[D^[[Dquit^[[K
+QEMU 1.5.50 monitor - type 'help' for more information
+(qemu) q^[[K^[[Dqu^[[K^[[D^[[Dqui^[[K^[[D^[[D^[[Dquit^[[K
 
 Testing: -drive file=TEST_DIR/t.qcow2,file.driver=qcow2
 QEMU_PROG: -drive file=TEST_DIR/t.qcow2,file.driver=qcow2: Can't use 'qcow2' as a block driver for the protocol level
diff --git a/tests/qemu-iotests/common.filter b/tests/qemu-iotests/common.filter
index dcf6391..9dbcae8 100644
--- a/tests/qemu-iotests/common.filter
+++ b/tests/qemu-iotests/common.filter
@@ -155,7 +155,7 @@ _filter_qemu_io()
 # replace occurrences of QEMU_PROG with "qemu"
 _filter_qemu()
 {
-    sed -e "s#^$(basename $QEMU_PROG):#QEMU_PROG:#"
+    sed -e "s#\\(^\\|(qemu) \\)$(basename $QEMU_PROG):#\1QEMU_PROG:#"
 }
 
 # make sure this script returns success
-- 
1.8.1.4

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

* [Qemu-devel] [PULL 5/8] block: Add return value for bdrv_flush_all()
  2013-07-15 11:16 [Qemu-devel] [PULL 0/8] Block patches Kevin Wolf
                   ` (3 preceding siblings ...)
  2013-07-15 11:16 ` [Qemu-devel] [PULL 4/8] qemu-iotests: Update 051 reference output Kevin Wolf
@ 2013-07-15 11:16 ` Kevin Wolf
  2013-07-15 11:16 ` [Qemu-devel] [PULL 6/8] cpus: Add return value for vm_stop() Kevin Wolf
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 31+ messages in thread
From: Kevin Wolf @ 2013-07-15 11:16 UTC (permalink / raw)
  To: anthony; +Cc: kwolf, qemu-devel

bdrv_flush() can fail, and bdrv_flush_all() should return an error as
well if this happens for a block device. It returns the first error
return now, but still at least tries to flush the remaining devices even
in error cases.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
---
 block.c               | 10 ++++++++--
 include/block/block.h |  2 +-
 2 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/block.c b/block.c
index 2df65c8..b560241 100644
--- a/block.c
+++ b/block.c
@@ -2910,13 +2910,19 @@ int bdrv_get_flags(BlockDriverState *bs)
     return bs->open_flags;
 }
 
-void bdrv_flush_all(void)
+int bdrv_flush_all(void)
 {
     BlockDriverState *bs;
+    int result = 0;
 
     QTAILQ_FOREACH(bs, &bdrv_states, list) {
-        bdrv_flush(bs);
+        int ret = bdrv_flush(bs);
+        if (ret < 0 && !result) {
+            result = ret;
+        }
     }
+
+    return result;
 }
 
 int bdrv_has_zero_init_1(BlockDriverState *bs)
diff --git a/include/block/block.h b/include/block/block.h
index eeb4816..b6b9014 100644
--- a/include/block/block.h
+++ b/include/block/block.h
@@ -267,7 +267,7 @@ void bdrv_clear_incoming_migration_all(void);
 /* Ensure contents are flushed to disk.  */
 int bdrv_flush(BlockDriverState *bs);
 int coroutine_fn bdrv_co_flush(BlockDriverState *bs);
-void bdrv_flush_all(void);
+int bdrv_flush_all(void);
 void bdrv_close_all(void);
 void bdrv_drain_all(void);
 
-- 
1.8.1.4

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

* [Qemu-devel] [PULL 6/8] cpus: Add return value for vm_stop()
  2013-07-15 11:16 [Qemu-devel] [PULL 0/8] Block patches Kevin Wolf
                   ` (4 preceding siblings ...)
  2013-07-15 11:16 ` [Qemu-devel] [PULL 5/8] block: Add return value for bdrv_flush_all() Kevin Wolf
@ 2013-07-15 11:16 ` Kevin Wolf
  2013-07-15 11:16 ` [Qemu-devel] [PULL 7/8] migration: Fail migration on bdrv_flush_all() error Kevin Wolf
  2013-07-15 11:16 ` [Qemu-devel] [PULL 8/8] ahci: Fix FLUSH command Kevin Wolf
  7 siblings, 0 replies; 31+ messages in thread
From: Kevin Wolf @ 2013-07-15 11:16 UTC (permalink / raw)
  To: anthony; +Cc: kwolf, qemu-devel

If flushing the block devices fails, return an error. The VM is stopped
anyway.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
---
 cpus.c                  | 20 +++++++++++++-------
 include/sysemu/sysemu.h |  4 ++--
 stubs/vm-stop.c         |  2 +-
 3 files changed, 16 insertions(+), 10 deletions(-)

diff --git a/cpus.c b/cpus.c
index f141428..29277e1 100644
--- a/cpus.c
+++ b/cpus.c
@@ -434,17 +434,21 @@ bool cpu_is_stopped(CPUState *cpu)
     return !runstate_is_running() || cpu->stopped;
 }
 
-static void do_vm_stop(RunState state)
+static int do_vm_stop(RunState state)
 {
+    int ret = 0;
+
     if (runstate_is_running()) {
         cpu_disable_ticks();
         pause_all_vcpus();
         runstate_set(state);
         vm_state_notify(0, state);
         bdrv_drain_all();
-        bdrv_flush_all();
+        ret = bdrv_flush_all();
         monitor_protocol_event(QEVENT_STOP, NULL);
     }
+
+    return ret;
 }
 
 static bool cpu_can_run(CPUState *cpu)
@@ -1070,7 +1074,7 @@ void cpu_stop_current(void)
     }
 }
 
-void vm_stop(RunState state)
+int vm_stop(RunState state)
 {
     if (qemu_in_vcpu_thread()) {
         qemu_system_vmstop_request(state);
@@ -1079,19 +1083,21 @@ void vm_stop(RunState state)
          * vm_stop() has been requested.
          */
         cpu_stop_current();
-        return;
+        return 0;
     }
-    do_vm_stop(state);
+
+    return do_vm_stop(state);
 }
 
 /* does a state transition even if the VM is already stopped,
    current state is forgotten forever */
-void vm_stop_force_state(RunState state)
+int vm_stop_force_state(RunState state)
 {
     if (runstate_is_running()) {
-        vm_stop(state);
+        return vm_stop(state);
     } else {
         runstate_set(state);
+        return 0;
     }
 }
 
diff --git a/include/sysemu/sysemu.h b/include/sysemu/sysemu.h
index d85bdc0..3caeb66 100644
--- a/include/sysemu/sysemu.h
+++ b/include/sysemu/sysemu.h
@@ -35,8 +35,8 @@ void vm_state_notify(int running, RunState state);
 #define VMRESET_REPORT   true
 
 void vm_start(void);
-void vm_stop(RunState state);
-void vm_stop_force_state(RunState state);
+int vm_stop(RunState state);
+int vm_stop_force_state(RunState state);
 
 typedef enum WakeupReason {
     QEMU_WAKEUP_REASON_OTHER = 0,
diff --git a/stubs/vm-stop.c b/stubs/vm-stop.c
index 4568935..f82c897 100644
--- a/stubs/vm-stop.c
+++ b/stubs/vm-stop.c
@@ -1,7 +1,7 @@
 #include "qemu-common.h"
 #include "sysemu/sysemu.h"
 
-void vm_stop(RunState state)
+int vm_stop(RunState state)
 {
     abort();
 }
-- 
1.8.1.4

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

* [Qemu-devel] [PULL 7/8] migration: Fail migration on bdrv_flush_all() error
  2013-07-15 11:16 [Qemu-devel] [PULL 0/8] Block patches Kevin Wolf
                   ` (5 preceding siblings ...)
  2013-07-15 11:16 ` [Qemu-devel] [PULL 6/8] cpus: Add return value for vm_stop() Kevin Wolf
@ 2013-07-15 11:16 ` Kevin Wolf
  2013-07-15 11:16 ` [Qemu-devel] [PULL 8/8] ahci: Fix FLUSH command Kevin Wolf
  7 siblings, 0 replies; 31+ messages in thread
From: Kevin Wolf @ 2013-07-15 11:16 UTC (permalink / raw)
  To: anthony; +Cc: kwolf, qemu-devel

If bdrv_flush_all() returns an error, there is an inconsistency in the
view of an image file between the source and the destination host.
Completing the migration would lead to corruption. Better abort
migration in this case.

To reproduce this case, try the following (ensures that there is
something to flush, and then fails that flush):

$ qemu-img create -f qcow2 test.qcow2 1G
$ cat blkdebug.cfg
[inject-error]
event = "flush_to_os"
errno = "5"
$ qemu-system-x86_64 -hda blkdebug:blkdebug.cfg:test.qcow2 -monitor stdio
(qemu) qemu-io ide0-hd0 "write 0 4k"
(qemu) migrate ...

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
---
 migration.c | 17 ++++++++++++++---
 1 file changed, 14 insertions(+), 3 deletions(-)

diff --git a/migration.c b/migration.c
index 635a7e7..0681d8e 100644
--- a/migration.c
+++ b/migration.c
@@ -527,15 +527,26 @@ static void *migration_thread(void *opaque)
             if (pending_size && pending_size >= max_size) {
                 qemu_savevm_state_iterate(s->file);
             } else {
+                int ret;
+
                 DPRINTF("done iterating\n");
                 qemu_mutex_lock_iothread();
                 start_time = qemu_get_clock_ms(rt_clock);
                 qemu_system_wakeup_request(QEMU_WAKEUP_REASON_OTHER);
                 old_vm_running = runstate_is_running();
-                vm_stop_force_state(RUN_STATE_FINISH_MIGRATE);
-                qemu_file_set_rate_limit(s->file, INT_MAX);
-                qemu_savevm_state_complete(s->file);
+
+                ret = vm_stop_force_state(RUN_STATE_FINISH_MIGRATE);
+                if (ret >= 0) {
+                    qemu_file_set_rate_limit(s->file, INT_MAX);
+                    qemu_savevm_state_complete(s->file);
+                }
                 qemu_mutex_unlock_iothread();
+
+                if (ret < 0) {
+                    migrate_finish_set_state(s, MIG_STATE_ERROR);
+                    break;
+                }
+
                 if (!qemu_file_get_error(s->file)) {
                     migrate_finish_set_state(s, MIG_STATE_COMPLETED);
                     break;
-- 
1.8.1.4

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

* [Qemu-devel] [PULL 8/8] ahci: Fix FLUSH command
  2013-07-15 11:16 [Qemu-devel] [PULL 0/8] Block patches Kevin Wolf
                   ` (6 preceding siblings ...)
  2013-07-15 11:16 ` [Qemu-devel] [PULL 7/8] migration: Fail migration on bdrv_flush_all() error Kevin Wolf
@ 2013-07-15 11:16 ` Kevin Wolf
  7 siblings, 0 replies; 31+ messages in thread
From: Kevin Wolf @ 2013-07-15 11:16 UTC (permalink / raw)
  To: anthony; +Cc: kwolf, qemu-devel

AHCI couldn't cope with asynchronous commands that aren't doing DMA, it
simply wouldn't complete them. Due to the bug fixed in commit f68ec837,
FLUSH commands would seem to have completed immediately even if they
were still running on the host. After the commit, they would simply hang
and never unset the BSY bit, rendering AHCI unusable on any OS sending
flushes.

This patch adds another callback for the completion of asynchronous
commands. This is what AHCI really wants to use for its command
completion logic rather than an DMA completion callback.

Cc: qemu-stable@nongnu.org
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
---
 hw/ide/ahci.c     | 8 +++++++-
 hw/ide/core.c     | 9 +++++++++
 hw/ide/internal.h | 1 +
 3 files changed, 17 insertions(+), 1 deletion(-)

diff --git a/hw/ide/ahci.c b/hw/ide/ahci.c
index 97eddec..1d863b5 100644
--- a/hw/ide/ahci.c
+++ b/hw/ide/ahci.c
@@ -1107,9 +1107,14 @@ static int ahci_dma_add_status(IDEDMA *dma, int status)
 
 static int ahci_dma_set_inactive(IDEDMA *dma)
 {
+    return 0;
+}
+
+static int ahci_async_cmd_done(IDEDMA *dma)
+{
     AHCIDevice *ad = DO_UPCAST(AHCIDevice, dma, dma);
 
-    DPRINTF(ad->port_no, "dma done\n");
+    DPRINTF(ad->port_no, "async cmd done\n");
 
     /* update d2h status */
     ahci_write_fis_d2h(ad, NULL);
@@ -1144,6 +1149,7 @@ static const IDEDMAOps ahci_dma_ops = {
     .set_unit = ahci_dma_set_unit,
     .add_status = ahci_dma_add_status,
     .set_inactive = ahci_dma_set_inactive,
+    .async_cmd_done = ahci_async_cmd_done,
     .restart_cb = ahci_dma_restart_cb,
     .reset = ahci_dma_reset,
 };
diff --git a/hw/ide/core.c b/hw/ide/core.c
index 03d1cfa..a73af72 100644
--- a/hw/ide/core.c
+++ b/hw/ide/core.c
@@ -568,10 +568,18 @@ static void dma_buf_commit(IDEState *s)
     qemu_sglist_destroy(&s->sg);
 }
 
+static void ide_async_cmd_done(IDEState *s)
+{
+    if (s->bus->dma->ops->async_cmd_done) {
+        s->bus->dma->ops->async_cmd_done(s->bus->dma);
+    }
+}
+
 void ide_set_inactive(IDEState *s)
 {
     s->bus->dma->aiocb = NULL;
     s->bus->dma->ops->set_inactive(s->bus->dma);
+    ide_async_cmd_done(s);
 }
 
 void ide_dma_error(IDEState *s)
@@ -804,6 +812,7 @@ static void ide_flush_cb(void *opaque, int ret)
 
     bdrv_acct_done(s->bs, &s->acct);
     s->status = READY_STAT | SEEK_STAT;
+    ide_async_cmd_done(s);
     ide_set_irq(s->bus);
 }
 
diff --git a/hw/ide/internal.h b/hw/ide/internal.h
index 03f1489..048a052 100644
--- a/hw/ide/internal.h
+++ b/hw/ide/internal.h
@@ -433,6 +433,7 @@ struct IDEDMAOps {
     DMAIntFunc *set_unit;
     DMAIntFunc *add_status;
     DMAFunc *set_inactive;
+    DMAFunc *async_cmd_done;
     DMARestartFunc *restart_cb;
     DMAFunc *reset;
 };
-- 
1.8.1.4

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

* Re: [Qemu-devel] [PULL 0/8] Block patches
  2019-06-24 13:15     ` Pino Toscano
@ 2019-06-24 14:49       ` Max Reitz
  0 siblings, 0 replies; 31+ messages in thread
From: Max Reitz @ 2019-06-24 14:49 UTC (permalink / raw)
  To: Pino Toscano; +Cc: Kevin Wolf, Peter Maydell, QEMU Developers, Qemu-block


[-- Attachment #1.1: Type: text/plain, Size: 2635 bytes --]

On 24.06.19 15:15, Pino Toscano wrote:
> On Monday, 24 June 2019 14:20:11 CEST Max Reitz wrote:
>> On 23.06.19 19:18, Peter Maydell wrote:
>>> On Fri, 21 Jun 2019 at 14:23, Max Reitz <mreitz@redhat.com> wrote:
>>>>
>>>> The following changes since commit 33d609990621dea6c7d056c86f707b8811320ac1:
>>>>
>>>>   Merge remote-tracking branch 'remotes/kevin/tags/for-upstream' into staging (2019-06-18 17:00:52 +0100)
>>>>
>>>> are available in the Git repository at:
>>>>
>>>>   https://github.com/XanClic/qemu.git tags/pull-block-2019-06-21
>>>>
>>>> for you to fetch changes up to e2a76186f7948b8b75d1b2b52638de7c2f7f7472:
>>>>
>>>>   iotests: Fix 205 for concurrent runs (2019-06-21 14:40:28 +0200)
>>>>
>>>> ----------------------------------------------------------------
>>>> Block patches:
>>>> - The SSH block driver now uses libssh instead of libssh2
>>>> - The VMDK block driver gets read-only support for the seSparse
>>>>   subformat
>>>> - Various fixes
>>>>
>>>
>>> Hi; this failed to build on my s390 box:
>>>
>>> /home/linux1/qemu/block/ssh.c: In function ‘check_host_key_knownhosts’:
>>> /home/linux1/qemu/block/ssh.c:367:27: error: implicit declaration of
>>> function ‘ssh_get_fingerprint_hash’
>>> [-Werror=implicit-function-declaration]
>>>              fingerprint = ssh_get_fingerprint_hash(SSH_PUBLICKEY_HASH_SHA1,
>>>                            ^
>>> /home/linux1/qemu/block/ssh.c:367:13: error: nested extern declaration
>>> of ‘ssh_get_fingerprint_hash’ [-Werror=nested-externs]
>>>              fingerprint = ssh_get_fingerprint_hash(SSH_PUBLICKEY_HASH_SHA1,
>>>              ^
>>> /home/linux1/qemu/block/ssh.c:367:25: error: assignment makes pointer
>>> from integer without a cast [-Werror=int-conversion]
>>>              fingerprint = ssh_get_fingerprint_hash(SSH_PUBLICKEY_HASH_SHA1,
>>>                          ^
>>>
>>> It looks like that function was introduced in libssh 0.8.3, and this box
>>> has 0.6.3. (configure has correctly not defined HAVE_LIBSSH_0_8
>>> but this usage is inside a bit of code that's compiled even when
>>> that is not defined.)
> 
> Oops, sorry, I did not test the latest versions with that old libssh.
> 
>> Pino, would you be OK with dropping that piece of code for pre-0.8 and
>> just replacing it with the else-error_setg()?
> 
> Some the variables in check_host_key_knownhosts must be moved within
> the HAVE_LIBSSH_0_8 block now; attached fixup patch, please squash with
> my patch (I can submit a v12, if needed/wanted).

Thanks, I’ve squashed it in and sent a v2 for this pull request.

Max


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

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

* Re: [Qemu-devel] [PULL 0/8] Block patches
  2019-06-24 12:20   ` Max Reitz
@ 2019-06-24 13:15     ` Pino Toscano
  2019-06-24 14:49       ` Max Reitz
  0 siblings, 1 reply; 31+ messages in thread
From: Pino Toscano @ 2019-06-24 13:15 UTC (permalink / raw)
  To: Max Reitz; +Cc: Kevin Wolf, Peter Maydell, QEMU Developers, Qemu-block


[-- Attachment #1.1: Type: text/plain, Size: 2519 bytes --]

On Monday, 24 June 2019 14:20:11 CEST Max Reitz wrote:
> On 23.06.19 19:18, Peter Maydell wrote:
> > On Fri, 21 Jun 2019 at 14:23, Max Reitz <mreitz@redhat.com> wrote:
> >>
> >> The following changes since commit 33d609990621dea6c7d056c86f707b8811320ac1:
> >>
> >>   Merge remote-tracking branch 'remotes/kevin/tags/for-upstream' into staging (2019-06-18 17:00:52 +0100)
> >>
> >> are available in the Git repository at:
> >>
> >>   https://github.com/XanClic/qemu.git tags/pull-block-2019-06-21
> >>
> >> for you to fetch changes up to e2a76186f7948b8b75d1b2b52638de7c2f7f7472:
> >>
> >>   iotests: Fix 205 for concurrent runs (2019-06-21 14:40:28 +0200)
> >>
> >> ----------------------------------------------------------------
> >> Block patches:
> >> - The SSH block driver now uses libssh instead of libssh2
> >> - The VMDK block driver gets read-only support for the seSparse
> >>   subformat
> >> - Various fixes
> >>
> > 
> > Hi; this failed to build on my s390 box:
> > 
> > /home/linux1/qemu/block/ssh.c: In function ‘check_host_key_knownhosts’:
> > /home/linux1/qemu/block/ssh.c:367:27: error: implicit declaration of
> > function ‘ssh_get_fingerprint_hash’
> > [-Werror=implicit-function-declaration]
> >              fingerprint = ssh_get_fingerprint_hash(SSH_PUBLICKEY_HASH_SHA1,
> >                            ^
> > /home/linux1/qemu/block/ssh.c:367:13: error: nested extern declaration
> > of ‘ssh_get_fingerprint_hash’ [-Werror=nested-externs]
> >              fingerprint = ssh_get_fingerprint_hash(SSH_PUBLICKEY_HASH_SHA1,
> >              ^
> > /home/linux1/qemu/block/ssh.c:367:25: error: assignment makes pointer
> > from integer without a cast [-Werror=int-conversion]
> >              fingerprint = ssh_get_fingerprint_hash(SSH_PUBLICKEY_HASH_SHA1,
> >                          ^
> > 
> > It looks like that function was introduced in libssh 0.8.3, and this box
> > has 0.6.3. (configure has correctly not defined HAVE_LIBSSH_0_8
> > but this usage is inside a bit of code that's compiled even when
> > that is not defined.)

Oops, sorry, I did not test the latest versions with that old libssh.

> Pino, would you be OK with dropping that piece of code for pre-0.8 and
> just replacing it with the else-error_setg()?

Some the variables in check_host_key_knownhosts must be moved within
the HAVE_LIBSSH_0_8 block now; attached fixup patch, please squash with
my patch (I can submit a v12, if needed/wanted).

-- 
Pino Toscano

[-- Attachment #1.2: fixup.diff --]
[-- Type: text/x-patch, Size: 2209 bytes --]

diff --git a/block/ssh.c b/block/ssh.c
index 048d0cc924..501933b855 100644
--- a/block/ssh.c
+++ b/block/ssh.c
@@ -277,14 +277,14 @@ static void ssh_parse_filename(const char *filename, QDict *options,
 static int check_host_key_knownhosts(BDRVSSHState *s, Error **errp)
 {
     int ret;
+#ifdef HAVE_LIBSSH_0_8
+    enum ssh_known_hosts_e state;
     int r;
     ssh_key pubkey;
     enum ssh_keytypes_e pubkey_type;
     unsigned char *server_hash = NULL;
     size_t server_hash_len;
     char *fingerprint = NULL;
-#ifdef HAVE_LIBSSH_0_8
-    enum ssh_known_hosts_e state;
 
     state = ssh_session_is_known_server(s->session);
     trace_ssh_server_status(state);
@@ -356,30 +356,9 @@ static int check_host_key_knownhosts(BDRVSSHState *s, Error **errp)
         break;
     case SSH_SERVER_KNOWN_CHANGED:
         ret = -EINVAL;
-        r = ssh_get_publickey(s->session, &pubkey);
-        if (r == 0) {
-            r = ssh_get_publickey_hash(pubkey, SSH_PUBLICKEY_HASH_SHA1,
-                                       &server_hash, &server_hash_len);
-            pubkey_type = ssh_key_type(pubkey);
-            ssh_key_free(pubkey);
-        }
-        if (r == 0) {
-            fingerprint = ssh_get_fingerprint_hash(SSH_PUBLICKEY_HASH_SHA1,
-                                                   server_hash,
-                                                   server_hash_len);
-            ssh_clean_pubkey_hash(&server_hash);
-        }
-        if (fingerprint) {
-            error_setg(errp,
-                       "host key (%s key with fingerprint %s) does not match "
-                       "the one in known_hosts; this may be a possible attack",
-                       ssh_key_type_to_char(pubkey_type), fingerprint);
-            ssh_string_free_char(fingerprint);
-        } else  {
-            error_setg(errp,
-                       "host key does not match the one in known_hosts; this "
-                       "may be a possible attack");
-        }
+        error_setg(errp,
+                   "host key does not match the one in known_hosts; this "
+                   "may be a possible attack");
         goto out;
     case SSH_SERVER_FOUND_OTHER:
         ret = -EINVAL;

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

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

* Re: [Qemu-devel] [PULL 0/8] Block patches
  2019-06-23 17:18 ` Peter Maydell
@ 2019-06-24 12:20   ` Max Reitz
  2019-06-24 13:15     ` Pino Toscano
  0 siblings, 1 reply; 31+ messages in thread
From: Max Reitz @ 2019-06-24 12:20 UTC (permalink / raw)
  To: Peter Maydell; +Cc: Kevin Wolf, QEMU Developers, Qemu-block, Pino Toscano


[-- Attachment #1.1: Type: text/plain, Size: 2093 bytes --]

On 23.06.19 19:18, Peter Maydell wrote:
> On Fri, 21 Jun 2019 at 14:23, Max Reitz <mreitz@redhat.com> wrote:
>>
>> The following changes since commit 33d609990621dea6c7d056c86f707b8811320ac1:
>>
>>   Merge remote-tracking branch 'remotes/kevin/tags/for-upstream' into staging (2019-06-18 17:00:52 +0100)
>>
>> are available in the Git repository at:
>>
>>   https://github.com/XanClic/qemu.git tags/pull-block-2019-06-21
>>
>> for you to fetch changes up to e2a76186f7948b8b75d1b2b52638de7c2f7f7472:
>>
>>   iotests: Fix 205 for concurrent runs (2019-06-21 14:40:28 +0200)
>>
>> ----------------------------------------------------------------
>> Block patches:
>> - The SSH block driver now uses libssh instead of libssh2
>> - The VMDK block driver gets read-only support for the seSparse
>>   subformat
>> - Various fixes
>>
> 
> Hi; this failed to build on my s390 box:
> 
> /home/linux1/qemu/block/ssh.c: In function ‘check_host_key_knownhosts’:
> /home/linux1/qemu/block/ssh.c:367:27: error: implicit declaration of
> function ‘ssh_get_fingerprint_hash’
> [-Werror=implicit-function-declaration]
>              fingerprint = ssh_get_fingerprint_hash(SSH_PUBLICKEY_HASH_SHA1,
>                            ^
> /home/linux1/qemu/block/ssh.c:367:13: error: nested extern declaration
> of ‘ssh_get_fingerprint_hash’ [-Werror=nested-externs]
>              fingerprint = ssh_get_fingerprint_hash(SSH_PUBLICKEY_HASH_SHA1,
>              ^
> /home/linux1/qemu/block/ssh.c:367:25: error: assignment makes pointer
> from integer without a cast [-Werror=int-conversion]
>              fingerprint = ssh_get_fingerprint_hash(SSH_PUBLICKEY_HASH_SHA1,
>                          ^
> 
> It looks like that function was introduced in libssh 0.8.3, and this box
> has 0.6.3. (configure has correctly not defined HAVE_LIBSSH_0_8
> but this usage is inside a bit of code that's compiled even when
> that is not defined.)

Pino, would you be OK with dropping that piece of code for pre-0.8 and
just replacing it with the else-error_setg()?

Max


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

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

* Re: [Qemu-devel] [PULL 0/8] Block patches
  2019-06-21 13:23 [Qemu-devel] [PULL 0/8] Block patches Max Reitz
@ 2019-06-23 17:18 ` Peter Maydell
  2019-06-24 12:20   ` Max Reitz
  0 siblings, 1 reply; 31+ messages in thread
From: Peter Maydell @ 2019-06-23 17:18 UTC (permalink / raw)
  To: Max Reitz; +Cc: Kevin Wolf, QEMU Developers, Qemu-block

On Fri, 21 Jun 2019 at 14:23, Max Reitz <mreitz@redhat.com> wrote:
>
> The following changes since commit 33d609990621dea6c7d056c86f707b8811320ac1:
>
>   Merge remote-tracking branch 'remotes/kevin/tags/for-upstream' into staging (2019-06-18 17:00:52 +0100)
>
> are available in the Git repository at:
>
>   https://github.com/XanClic/qemu.git tags/pull-block-2019-06-21
>
> for you to fetch changes up to e2a76186f7948b8b75d1b2b52638de7c2f7f7472:
>
>   iotests: Fix 205 for concurrent runs (2019-06-21 14:40:28 +0200)
>
> ----------------------------------------------------------------
> Block patches:
> - The SSH block driver now uses libssh instead of libssh2
> - The VMDK block driver gets read-only support for the seSparse
>   subformat
> - Various fixes
>

Hi; this failed to build on my s390 box:

/home/linux1/qemu/block/ssh.c: In function ‘check_host_key_knownhosts’:
/home/linux1/qemu/block/ssh.c:367:27: error: implicit declaration of
function ‘ssh_get_fingerprint_hash’
[-Werror=implicit-function-declaration]
             fingerprint = ssh_get_fingerprint_hash(SSH_PUBLICKEY_HASH_SHA1,
                           ^
/home/linux1/qemu/block/ssh.c:367:13: error: nested extern declaration
of ‘ssh_get_fingerprint_hash’ [-Werror=nested-externs]
             fingerprint = ssh_get_fingerprint_hash(SSH_PUBLICKEY_HASH_SHA1,
             ^
/home/linux1/qemu/block/ssh.c:367:25: error: assignment makes pointer
from integer without a cast [-Werror=int-conversion]
             fingerprint = ssh_get_fingerprint_hash(SSH_PUBLICKEY_HASH_SHA1,
                         ^

It looks like that function was introduced in libssh 0.8.3, and this box
has 0.6.3. (configure has correctly not defined HAVE_LIBSSH_0_8
but this usage is inside a bit of code that's compiled even when
that is not defined.)

thanks
-- PMM


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

* [Qemu-devel] [PULL 0/8] Block patches
@ 2019-06-21 13:23 Max Reitz
  2019-06-23 17:18 ` Peter Maydell
  0 siblings, 1 reply; 31+ messages in thread
From: Max Reitz @ 2019-06-21 13:23 UTC (permalink / raw)
  To: qemu-block; +Cc: Kevin Wolf, Peter Maydell, qemu-devel, Max Reitz

The following changes since commit 33d609990621dea6c7d056c86f707b8811320ac1:

  Merge remote-tracking branch 'remotes/kevin/tags/for-upstream' into staging (2019-06-18 17:00:52 +0100)

are available in the Git repository at:

  https://github.com/XanClic/qemu.git tags/pull-block-2019-06-21

for you to fetch changes up to e2a76186f7948b8b75d1b2b52638de7c2f7f7472:

  iotests: Fix 205 for concurrent runs (2019-06-21 14:40:28 +0200)

----------------------------------------------------------------
Block patches:
- The SSH block driver now uses libssh instead of libssh2
- The VMDK block driver gets read-only support for the seSparse
  subformat
- Various fixes

----------------------------------------------------------------
Anton Nefedov (1):
  iotest 134: test cluster-misaligned encrypted write

Klaus Birkelund Jensen (1):
  nvme: do not advertise support for unsupported arbitration mechanism

Max Reitz (1):
  iotests: Fix 205 for concurrent runs

Pino Toscano (1):
  ssh: switch from libssh2 to libssh

Sam Eiderman (3):
  vmdk: Fix comment regarding max l1_size coverage
  vmdk: Reduce the max bound for L1 table size
  vmdk: Add read-only support for seSparse snapshots

Vladimir Sementsov-Ogievskiy (1):
  blockdev: enable non-root nodes for transaction drive-backup source

 configure                                     |  65 +-
 block/Makefile.objs                           |   6 +-
 block/ssh.c                                   | 673 ++++++++++--------
 block/vmdk.c                                  | 372 +++++++++-
 blockdev.c                                    |   2 +-
 hw/block/nvme.c                               |   1 -
 .travis.yml                                   |   4 +-
 block/trace-events                            |  14 +-
 docs/qemu-block-drivers.texi                  |   2 +-
 .../dockerfiles/debian-win32-cross.docker     |   1 -
 .../dockerfiles/debian-win64-cross.docker     |   1 -
 tests/docker/dockerfiles/fedora.docker        |   4 +-
 tests/docker/dockerfiles/ubuntu.docker        |   2 +-
 tests/docker/dockerfiles/ubuntu1804.docker    |   2 +-
 tests/qemu-iotests/059.out                    |   2 +-
 tests/qemu-iotests/134                        |   9 +
 tests/qemu-iotests/134.out                    |  10 +
 tests/qemu-iotests/205                        |   2 +-
 tests/qemu-iotests/207                        |  54 +-
 tests/qemu-iotests/207.out                    |   2 +-
 20 files changed, 844 insertions(+), 384 deletions(-)

-- 
2.21.0



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

* Re: [Qemu-devel] [PULL 0/8] Block patches
  2019-05-10 13:02 Stefan Hajnoczi
@ 2019-05-10 14:24 ` Peter Maydell
  0 siblings, 0 replies; 31+ messages in thread
From: Peter Maydell @ 2019-05-10 14:24 UTC (permalink / raw)
  To: Stefan Hajnoczi
  Cc: Fam Zheng, Kevin Wolf, Qemu-block, QEMU Developers, Max Reitz,
	Paolo Bonzini

On Fri, 10 May 2019 at 14:02, Stefan Hajnoczi <stefanha@redhat.com> wrote:
>
> The following changes since commit 812b835fb4d23dd108b2f9802158472d50b73579:
>
>   Merge remote-tracking branch 'remotes/maxreitz/tags/pull-block-2019-05-07' into staging (2019-05-09 16:31:12 +0100)
>
> are available in the Git repository at:
>
>   https://github.com/stefanha/qemu.git tags/block-pull-request
>
> for you to fetch changes up to e84125761f78919fe63616d9888ea45e72dc956f:
>
>   docs: add Security chapter to the documentation (2019-05-10 10:53:52 +0100)
>
> ----------------------------------------------------------------
> Pull request
>
> ----------------------------------------------------------------



Applied, thanks.

Please update the changelog at https://wiki.qemu.org/ChangeLog/4.1
for any user-visible changes.

-- PMM


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

* [Qemu-devel] [PULL 0/8] Block patches
@ 2019-05-10 13:02 Stefan Hajnoczi
  2019-05-10 14:24 ` Peter Maydell
  0 siblings, 1 reply; 31+ messages in thread
From: Stefan Hajnoczi @ 2019-05-10 13:02 UTC (permalink / raw)
  To: qemu-devel
  Cc: Fam Zheng, Peter Maydell, qemu-block, Max Reitz, Stefan Hajnoczi,
	Paolo Bonzini, Kevin Wolf

The following changes since commit 812b835fb4d23dd108b2f9802158472d50b73579:

  Merge remote-tracking branch 'remotes/maxreitz/tags/pull-block-2019-05-07' into staging (2019-05-09 16:31:12 +0100)

are available in the Git repository at:

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

for you to fetch changes up to e84125761f78919fe63616d9888ea45e72dc956f:

  docs: add Security chapter to the documentation (2019-05-10 10:53:52 +0100)

----------------------------------------------------------------
Pull request

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

Andrey Shinkevich (1):
  block/io.c: fix for the allocation failure

Jules Irenge (3):
  util/readline: add a space to fix errors by checkpatch tool
  util: readline: replace tab indent by four spaces to fix checkpatch
    errors
  util/readline: Add braces to fix checkpatch errors

Nikita Alekseev (1):
  block: Add coroutine_fn to bdrv_check_co_entry

Paolo Bonzini (1):
  aio-posix: ensure poll mode is left when aio_notify is called

Stefan Hajnoczi (2):
  docs: add Secure Coding Practices to developer docs
  docs: add Security chapter to the documentation

 Makefile                               |   2 +-
 block.c                                |   2 +-
 block/io.c                             |   2 +-
 util/aio-posix.c                       |  12 +-
 util/readline.c                        | 174 ++++++++++++++-----------
 docs/devel/index.rst                   |   1 +
 docs/devel/secure-coding-practices.rst | 106 +++++++++++++++
 docs/security.texi                     | 131 +++++++++++++++++++
 qemu-doc.texi                          |   3 +
 9 files changed, 347 insertions(+), 86 deletions(-)
 create mode 100644 docs/devel/secure-coding-practices.rst
 create mode 100644 docs/security.texi

-- 
2.21.0



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

* Re: [Qemu-devel] [PULL 0/8] Block patches
  2018-05-12  9:28 Stefan Hajnoczi
  2018-05-12  9:42 ` no-reply
  2018-05-14 13:15 ` Peter Maydell
@ 2018-05-14 17:53 ` Peter Maydell
  2 siblings, 0 replies; 31+ messages in thread
From: Peter Maydell @ 2018-05-14 17:53 UTC (permalink / raw)
  To: Stefan Hajnoczi; +Cc: QEMU Developers, Qemu-block

On 12 May 2018 at 10:28, Stefan Hajnoczi <stefanha@redhat.com> wrote:
> The following changes since commit e5cd695266c5709308aa95b1baae499e4b5d4544:
>
>   Merge remote-tracking branch 'remotes/cody/tags/block-pull-request' into staging (2018-05-08 17:05:58 +0100)
>
> are available in the Git repository at:
>
>   git://github.com/stefanha/qemu.git tags/block-pull-request
>
> for you to fetch changes up to 31be8a2a97ecba7d31a82932286489cac318e9e9:
>
>   block/file-posix: add x-check-page-cache=on|off option (2018-05-11 16:43:05 +0100)
>
> ----------------------------------------------------------------
> Block pull request
>
>  * Support -drive cache.direct=off live migration for POSIX files
>

Applied, thanks.

-- PMM

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

* Re: [Qemu-devel] [PULL 0/8] Block patches
  2018-05-14 13:15 ` Peter Maydell
@ 2018-05-14 16:02   ` Peter Maydell
  0 siblings, 0 replies; 31+ messages in thread
From: Peter Maydell @ 2018-05-14 16:02 UTC (permalink / raw)
  To: Stefan Hajnoczi; +Cc: QEMU Developers, Qemu-block

On 14 May 2018 at 14:15, Peter Maydell <peter.maydell@linaro.org> wrote:
> On 12 May 2018 at 10:28, Stefan Hajnoczi <stefanha@redhat.com> wrote:
>> The following changes since commit e5cd695266c5709308aa95b1baae499e4b5d4544:
>>
>>   Merge remote-tracking branch 'remotes/cody/tags/block-pull-request' into staging (2018-05-08 17:05:58 +0100)
>>
>> are available in the Git repository at:
>>
>>   git://github.com/stefanha/qemu.git tags/block-pull-request
>>
>> for you to fetch changes up to 31be8a2a97ecba7d31a82932286489cac318e9e9:
>>
>>   block/file-posix: add x-check-page-cache=on|off option (2018-05-11 16:43:05 +0100)
>>
>> ----------------------------------------------------------------
>> Block pull request
>>
>>  * Support -drive cache.direct=off live migration for POSIX files
>>
>> ----------------------------------------------------------------
>
> With this I get test failures for x86-64 Linux host (debug enabled):
>
> MALLOC_PERTURB_=${MALLOC_PERTURB_:-$(( ${RANDOM:-0} % 255 + 1))}
> gtester -k --verbose -m=quick tests/test-replication
> TEST: tests/test-replication... (pid=15016)
>   /replication/primary/read:                                           OK
>   /replication/primary/write:                                          OK
>   /replication/primary/start:                                          OK
>   /replication/primary/stop:                                           OK
>   /replication/primary/do_checkpoint:                                  OK
>   /replication/primary/get_error_all:                                  OK
>   /replication/secondary/read:                                         **
> ERROR:/home/petmay01/linaro/qemu-for-merges/tests/test-replication.c:119:test_blk_write:
> assertion failed: (async_ret == 0)
> FAIL
> GTester: last random seed: R02Sf99d81651223b2fcdd0d7d601245eba3
> (pid=15131)
>   /replication/secondary/write:                                        OK
>   /replication/secondary/start:                                        **
> ERROR:/home/petmay01/linaro/qemu-for-merges/tests/test-replication.c:119:test_blk_write:
> assertion failed: (async_ret == 0)
> FAIL

Sorry, this is a false alarm -- this test fails in this obscure way if the
system has run out of disk space and the write returns ENOSPC.

Ideally we should fix the test to print the errno. In the meantime I've
deleted some large log files and will retest the pull :-)

thanks
-- PMM

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

* Re: [Qemu-devel] [PULL 0/8] Block patches
  2018-05-12  9:28 Stefan Hajnoczi
  2018-05-12  9:42 ` no-reply
@ 2018-05-14 13:15 ` Peter Maydell
  2018-05-14 16:02   ` Peter Maydell
  2018-05-14 17:53 ` Peter Maydell
  2 siblings, 1 reply; 31+ messages in thread
From: Peter Maydell @ 2018-05-14 13:15 UTC (permalink / raw)
  To: Stefan Hajnoczi; +Cc: QEMU Developers, Qemu-block

On 12 May 2018 at 10:28, Stefan Hajnoczi <stefanha@redhat.com> wrote:
> The following changes since commit e5cd695266c5709308aa95b1baae499e4b5d4544:
>
>   Merge remote-tracking branch 'remotes/cody/tags/block-pull-request' into staging (2018-05-08 17:05:58 +0100)
>
> are available in the Git repository at:
>
>   git://github.com/stefanha/qemu.git tags/block-pull-request
>
> for you to fetch changes up to 31be8a2a97ecba7d31a82932286489cac318e9e9:
>
>   block/file-posix: add x-check-page-cache=on|off option (2018-05-11 16:43:05 +0100)
>
> ----------------------------------------------------------------
> Block pull request
>
>  * Support -drive cache.direct=off live migration for POSIX files
>
> ----------------------------------------------------------------

With this I get test failures for x86-64 Linux host (debug enabled):

MALLOC_PERTURB_=${MALLOC_PERTURB_:-$(( ${RANDOM:-0} % 255 + 1))}
gtester -k --verbose -m=quick tests/test-replication
TEST: tests/test-replication... (pid=15016)
  /replication/primary/read:                                           OK
  /replication/primary/write:                                          OK
  /replication/primary/start:                                          OK
  /replication/primary/stop:                                           OK
  /replication/primary/do_checkpoint:                                  OK
  /replication/primary/get_error_all:                                  OK
  /replication/secondary/read:                                         **
ERROR:/home/petmay01/linaro/qemu-for-merges/tests/test-replication.c:119:test_blk_write:
assertion failed: (async_ret == 0)
FAIL
GTester: last random seed: R02Sf99d81651223b2fcdd0d7d601245eba3
(pid=15131)
  /replication/secondary/write:                                        OK
  /replication/secondary/start:                                        **
ERROR:/home/petmay01/linaro/qemu-for-merges/tests/test-replication.c:119:test_blk_write:
assertion failed: (async_ret == 0)
FAIL
GTester: last random seed: R02S3e753c59c58d385aa2ea07c974c2e384
(pid=15309)
  /replication/secondary/stop:                                         **
ERROR:/home/petmay01/linaro/qemu-for-merges/tests/test-replication.c:119:test_blk_write:
assertion failed: (async_ret == 0)
FAIL
GTester: last random seed: R02Sb6a8459edfa78efa369da3920846afa7
(pid=15439)
  /replication/secondary/do_checkpoint:                                **
ERROR:/home/petmay01/linaro/qemu-for-merges/tests/test-replication.c:119:test_blk_write:
assertion failed: (async_ret == 0)
FAIL
GTester: last random seed: R02S4b2e6aa4e33bba4c5bdea0b9073ee966
(pid=15580)
  /replication/secondary/get_error_all:                                OK
FAIL: tests/test-replication
/home/petmay01/linaro/qemu-for-merges/tests/Makefile.include:892:
recipe for target 'check-tests/test-replication' failed


thanks
-- PMM

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

* Re: [Qemu-devel] [PULL 0/8] Block patches
  2018-05-12  9:28 Stefan Hajnoczi
@ 2018-05-12  9:42 ` no-reply
  2018-05-14 13:15 ` Peter Maydell
  2018-05-14 17:53 ` Peter Maydell
  2 siblings, 0 replies; 31+ messages in thread
From: no-reply @ 2018-05-12  9:42 UTC (permalink / raw)
  To: stefanha; +Cc: famz, qemu-devel, peter.maydell, qemu-block

Hi,

This series seems to have some coding style problems. See output below for
more information:

Type: series
Message-id: 20180512092824.13848-1-stefanha@redhat.com
Subject: [Qemu-devel] [PULL 0/8] Block patches

=== TEST SCRIPT BEGIN ===
#!/bin/bash

BASE=base
n=1
total=$(git log --oneline $BASE.. | wc -l)
failed=0

git config --local diff.renamelimit 0
git config --local diff.renames True
git config --local diff.algorithm histogram

commits="$(git log --format=%H --reverse $BASE..)"
for c in $commits; do
    echo "Checking PATCH $n/$total: $(git log -n 1 --format=%s $c)..."
    if ! git show $c --format=email | ./scripts/checkpatch.pl --mailback -; then
        failed=1
        echo
    fi
    n=$((n+1))
done

exit $failed
=== TEST SCRIPT END ===

Updating 3c8cf5a9c21ff8782164d1def7f44bd888713384
From https://github.com/patchew-project/qemu
 * [new tag]               patchew/20180512092824.13848-1-stefanha@redhat.com -> patchew/20180512092824.13848-1-stefanha@redhat.com
 t [tag update]            patchew/cover.1526081108.git.alistair.francis@wdc.com -> patchew/cover.1526081108.git.alistair.francis@wdc.com
Switched to a new branch 'test'
a35067253e block/file-posix: add x-check-page-cache=on|off option
c6c991d81f block/file-posix: implement bdrv_co_invalidate_cache() on Linux
3b9d04939d checkpatch: reduce MAINTAINERS update message frequency
92c27dd7e6 checkpatch: emit a warning on file add/move/delete
82e1381f3f checkpatch: ignore email headers better
63d8deac11 checkpatch: check utf-8 content from a commit log when it's missing from charset
7ecaae4f83 checkpatch: add a --strict check for utf-8 in commit logs
ca525fa2f4 blockjob: drop block_job_pause/resume_all()

=== OUTPUT BEGIN ===
Checking PATCH 1/8: blockjob: drop block_job_pause/resume_all()...
Checking PATCH 2/8: checkpatch: add a --strict check for utf-8 in commit logs...
WARNING: line over 80 characters
#109: FILE: scripts/checkpatch.pl:1420:
+			WARN("8-bit UTF-8 used in possible commit log\n" . $herecurr);

total: 0 errors, 1 warnings, 66 lines checked

Your patch has style problems, please review.  If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.
Checking PATCH 3/8: checkpatch: check utf-8 content from a commit log when it's missing from charset...
Checking PATCH 4/8: checkpatch: ignore email headers better...
Checking PATCH 5/8: checkpatch: emit a warning on file add/move/delete...
WARNING: line over 80 characters
#51: FILE: scripts/checkpatch.pl:1397:
+		     ($line =~ /\{\s*([\w\/\.\-]*)\s*\=\>\s*([\w\/\.\-]*)\s*\}/ &&

ERROR: line over 90 characters
#54: FILE: scripts/checkpatch.pl:1400:
+			WARN("added, moved or deleted file(s), does MAINTAINERS need updating?\n" . $herecurr);

total: 1 errors, 1 warnings, 24 lines checked

Your patch has style problems, please review.  If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.

Checking PATCH 6/8: checkpatch: reduce MAINTAINERS update message frequency...
Checking PATCH 7/8: block/file-posix: implement bdrv_co_invalidate_cache() on Linux...
WARNING: architecture specific defines should be avoided
#52: FILE: block/file-posix.c:2255:
+#if defined(__linux__)

total: 0 errors, 1 warnings, 70 lines checked

Your patch has style problems, please review.  If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.
Checking PATCH 8/8: block/file-posix: add x-check-page-cache=on|off option...
WARNING: line over 80 characters
#47: FILE: block/file-posix.c:423:
+            .help = "check that page cache was dropped on live migration (default: off)"

WARNING: architecture specific defines should be avoided
#120: FILE: block/file-posix.c:2264:
+#if defined(__linux__)

total: 0 errors, 2 warnings, 185 lines checked

Your patch has style problems, please review.  If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.
=== OUTPUT END ===

Test command exited with code: 1


---
Email generated automatically by Patchew [http://patchew.org/].
Please send your feedback to patchew-devel@redhat.com

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

* [Qemu-devel] [PULL 0/8] Block patches
@ 2018-05-12  9:28 Stefan Hajnoczi
  2018-05-12  9:42 ` no-reply
                   ` (2 more replies)
  0 siblings, 3 replies; 31+ messages in thread
From: Stefan Hajnoczi @ 2018-05-12  9:28 UTC (permalink / raw)
  To: qemu-devel; +Cc: qemu-block, Peter Maydell

The following changes since commit e5cd695266c5709308aa95b1baae499e4b5d4544:

  Merge remote-tracking branch 'remotes/cody/tags/block-pull-request' into staging (2018-05-08 17:05:58 +0100)

are available in the Git repository at:

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

for you to fetch changes up to 31be8a2a97ecba7d31a82932286489cac318e9e9:

  block/file-posix: add x-check-page-cache=on|off option (2018-05-11 16:43:05 +0100)

----------------------------------------------------------------
Block pull request

 * Support -drive cache.direct=off live migration for POSIX files

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

Joe Perches (4):
  checkpatch: add a --strict check for utf-8 in commit logs
  checkpatch: ignore email headers better
  checkpatch: emit a warning on file add/move/delete
  checkpatch: reduce MAINTAINERS update message frequency

Pasi Savanainen (1):
  checkpatch: check utf-8 content from a commit log when it's missing
    from charset

Stefan Hajnoczi (3):
  blockjob: drop block_job_pause/resume_all()
  block/file-posix: implement bdrv_co_invalidate_cache() on Linux
  block/file-posix: add x-check-page-cache=on|off option

 qapi/block-core.json         |   7 +-
 include/block/blockjob_int.h |  14 ----
 block/file-posix.c           | 146 ++++++++++++++++++++++++++++++++++-
 blockjob.c                   |  27 -------
 scripts/checkpatch.pl        |  56 +++++++++++++-
 5 files changed, 202 insertions(+), 48 deletions(-)

-- 
2.17.0

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

* Re: [Qemu-devel] [PULL 0/8] Block patches
  2016-07-18 16:59 Stefan Hajnoczi
@ 2016-07-19  8:01 ` Peter Maydell
  0 siblings, 0 replies; 31+ messages in thread
From: Peter Maydell @ 2016-07-19  8:01 UTC (permalink / raw)
  To: Stefan Hajnoczi; +Cc: QEMU Developers

On 18 July 2016 at 17:59, Stefan Hajnoczi <stefanha@redhat.com> wrote:
> The following changes since commit 3913d3707e3debfbf0d2d014a1a793394993b088:
>
>   Merge remote-tracking branch 'remotes/dgibson/tags/ppc-for-2.7-20160718' into staging (2016-07-18 11:24:15 +0100)
>
> are available in the git repository at:
>
>   git://github.com/stefanha/qemu.git tags/block-pull-request
>
> for you to fetch changes up to e1029ae26d96d5de78c2d9af5eddcea92e73a46a:
>
>   MAINTAINERS: Add include/block/aio.h to block I/O path section (2016-07-18 15:10:52 +0100)
>
> ----------------------------------------------------------------
>
> This is not quite a v2 because I have added more patches.  "linux-aio: share
> one LinuxAioState within an AioContext" is now fixed under mingw.
>
> ----------------------------------------------------------------

Applied, thanks.

-- PMM

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

* [Qemu-devel] [PULL 0/8] Block patches
@ 2016-07-18 16:59 Stefan Hajnoczi
  2016-07-19  8:01 ` Peter Maydell
  0 siblings, 1 reply; 31+ messages in thread
From: Stefan Hajnoczi @ 2016-07-18 16:59 UTC (permalink / raw)
  To: qemu-devel; +Cc: Peter Maydell, Stefan Hajnoczi

The following changes since commit 3913d3707e3debfbf0d2d014a1a793394993b088:

  Merge remote-tracking branch 'remotes/dgibson/tags/ppc-for-2.7-20160718' into staging (2016-07-18 11:24:15 +0100)

are available in the git repository at:

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

for you to fetch changes up to e1029ae26d96d5de78c2d9af5eddcea92e73a46a:

  MAINTAINERS: Add include/block/aio.h to block I/O path section (2016-07-18 15:10:52 +0100)

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

This is not quite a v2 because I have added more patches.  "linux-aio: share
one LinuxAioState within an AioContext" is now fixed under mingw.

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

Cao jin (3):
  aio_ctx_check: follow CODING_STYLE
  aio-posix: remove useless parameter
  virtio-blk: dataplane cleanup

Fam Zheng (1):
  MAINTAINERS: Add include/block/aio.h to block I/O path section

Paolo Bonzini (1):
  linux-aio: share one LinuxAioState within an AioContext

Roman Pen (1):
  linux-aio: prevent submitting more than MAX_EVENTS

Stefan Hajnoczi (1):
  checkpatch: consider git extended headers valid patches

Vladimir Sementsov-Ogievskiy (1):
  spec/parallels: fix a mistake

 MAINTAINERS                     |   1 +
 aio-posix.c                     |   3 +-
 aio-win32.c                     |   2 +-
 async.c                         |  33 ++++++++---
 block/linux-aio.c               |  36 +++++++-----
 block/raw-aio.h                 |  68 -----------------------
 block/raw-posix.c               | 119 +++++-----------------------------------
 block/raw-win32.c               |   2 +-
 block/win32-aio.c               |   2 +-
 docs/specs/parallels.txt        |   2 +-
 hw/block/dataplane/virtio-blk.c |   6 +-
 include/block/aio.h             |  15 ++++-
 include/block/raw-aio.h         |  68 +++++++++++++++++++++++
 scripts/checkpatch.pl           |   5 ++
 14 files changed, 158 insertions(+), 204 deletions(-)
 delete mode 100644 block/raw-aio.h
 create mode 100644 include/block/raw-aio.h

-- 
2.7.4

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

* Re: [Qemu-devel] [PULL 0/8] Block patches
  2014-01-31 21:19 Stefan Hajnoczi
@ 2014-02-05 16:38 ` Peter Maydell
  0 siblings, 0 replies; 31+ messages in thread
From: Peter Maydell @ 2014-02-05 16:38 UTC (permalink / raw)
  To: Stefan Hajnoczi; +Cc: QEMU Developers, Anthony Liguori

On 31 January 2014 21:19, Stefan Hajnoczi <stefanha@redhat.com> wrote:
> The following changes since commit 89e4a51ca9546a7bbe1998c4e3d4a3ac3a0c19be:
>
>   Merge remote-tracking branch 'stefanha/tags/tracing-pull-request' into staging (2014-01-31 11:13:08 +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 1b7650ef2f63d53cf89af25a9f323323cf2423a7:
>
>   qemu-iotests: only run 071 on qcow2 (2014-01-31 22:05:03 +0100)

Applied, thanks.

-- PMM

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

* [Qemu-devel] [PULL 0/8] Block patches
@ 2014-01-31 21:19 Stefan Hajnoczi
  2014-02-05 16:38 ` Peter Maydell
  0 siblings, 1 reply; 31+ messages in thread
From: Stefan Hajnoczi @ 2014-01-31 21:19 UTC (permalink / raw)
  To: qemu-devel; +Cc: Peter Maydell, Anthony Liguori

The following changes since commit 89e4a51ca9546a7bbe1998c4e3d4a3ac3a0c19be:

  Merge remote-tracking branch 'stefanha/tags/tracing-pull-request' into staging (2014-01-31 11:13:08 +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 1b7650ef2f63d53cf89af25a9f323323cf2423a7:

  qemu-iotests: only run 071 on qcow2 (2014-01-31 22:05:03 +0100)

----------------------------------------------------------------
Block pull request

----------------------------------------------------------------
Daniel P. Berrange (1):
      Describe flaws in qcow/qcow2 encryption in the docs

Fam Zheng (1):
      qemu-iotests: Drop assert_no_active_commit in case 040

Jeff Cody (2):
      block: remove QED .bdrv_make_empty implementation
      block: remove qcow2 .bdrv_make_empty implementation

Markus Armbruster (2):
      block/vhdx: Error checking fixes
      dataplane: Comment fix

Peter Lieven (1):
      block/vmdk: add basic .bdrv_check support

Stefan Hajnoczi (1):
      qemu-iotests: only run 071 on qcow2

 block/qcow2.c                   | 21 ------------------
 block/qed.c                     |  6 ------
 block/vhdx-log.c                |  4 ++--
 block/vhdx.c                    |  8 +++----
 block/vmdk.c                    | 48 +++++++++++++++++++++++++++++++++++++++++
 hw/block/dataplane/virtio-blk.c |  2 +-
 qemu-doc.texi                   | 23 +++++++++++++++++---
 qemu-img.texi                   | 23 +++++++++++++++++---
 tests/qemu-iotests/040          | 28 +++++++++++-------------
 tests/qemu-iotests/071          |  2 +-
 10 files changed, 108 insertions(+), 57 deletions(-)

-- 
1.8.5.3

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

* [Qemu-devel] [PULL 0/8] Block patches
@ 2013-10-07 11:28 Stefan Hajnoczi
  0 siblings, 0 replies; 31+ messages in thread
From: Stefan Hajnoczi @ 2013-10-07 11:28 UTC (permalink / raw)
  To: qemu-devel; +Cc: Stefan Hajnoczi, Anthony Liguori

The following changes since commit a684f3cf9b9b9c3cb82be87aafc463de8974610c:

  Merge remote-tracking branch 'kraxel/seabios-1.7.3.2' into staging (2013-09-30 17:15:27 -0500)

are available in the git repository at:


  git://github.com/stefanha/qemu.git block

for you to fetch changes up to d4cea8dfb99153803164915c7a1109549ad3da9c:

  block: use correct filename (2013-10-07 13:23:19 +0200)

----------------------------------------------------------------
Dunrong Huang (2):
      block: use correct filename for error report
      block: use correct filename

Jeff Cody (1):
      block: vhdx - add migration blocker

Max Reitz (5):
      qcow2: Correct endianness in overlap check
      qcow2: CHECK_OFLAG_COPIED is obsolete
      qcow2: Switch L1 table in a single sequence
      qcow2: Free allocated L2 cluster on error
      qemu-iotests: Correct 026 output

 block.c                            |  8 ++++----
 block/qcow2-cluster.c              | 11 +++++++++--
 block/qcow2-refcount.c             |  8 +++-----
 block/vhdx.c                       | 10 ++++++++++
 tests/qemu-iotests/026.out         | 32 ++++++++------------------------
 tests/qemu-iotests/026.out.nocache | 32 ++++++++------------------------
 6 files changed, 42 insertions(+), 59 deletions(-)

-- 
1.8.3.1

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

* [Qemu-devel] [PULL 0/8] Block patches
@ 2013-04-05 13:28 Kevin Wolf
  0 siblings, 0 replies; 31+ messages in thread
From: Kevin Wolf @ 2013-04-05 13:28 UTC (permalink / raw)
  To: anthony; +Cc: kwolf, qemu-devel

The following changes since commit 162cbbd1736de2bca43fdefa7e98c54a361ee60d:

  Merge remote-tracking branch 'luiz/queue/qmp' into staging (2013-04-02 14:07:35 -0500)

are available in the git repository at:


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

for you to fetch changes up to 094e751448359417c712ed1395d151c79ccd2538:

  qcow2: Fix L1 write error handling in qcow2_update_snapshot_refcount (2013-04-05 13:17:49 +0200)

----------------------------------------------------------------
KONRAD Frederic (1):
      virtio-blk-x: fix configuration synchronization.

Kevin Wolf (3):
      usb-storage: Forward serial number to scsi-disk
      qcow2: Return real error in qcow2_update_snapshot_refcount
      qcow2: Fix L1 write error handling in qcow2_update_snapshot_refcount

Stefan Hajnoczi (4):
      block: fix I/O throttling accounting blind spot
      block: keep I/O throttling slice time constant
      block: drop duplicated slice extension code
      block: clean up I/O throttling wait_time code

 block.c                    | 49 +++++++++++++++++++++-------------------------
 block/qcow2-refcount.c     | 25 +++++++++++------------
 blockdev.c                 |  1 -
 hw/pci/pci-hotplug.c       |  2 +-
 hw/s390x/s390-virtio-bus.c |  4 ++--
 hw/s390x/s390-virtio-bus.h |  1 -
 hw/s390x/virtio-ccw.c      |  4 ++--
 hw/s390x/virtio-ccw.h      |  1 -
 hw/scsi-bus.c              |  8 ++++++--
 hw/scsi.h                  |  3 ++-
 hw/usb/dev-storage.c       |  2 +-
 hw/virtio-blk.c            |  7 -------
 hw/virtio-blk.h            |  2 --
 hw/virtio-pci.c            |  7 ++++---
 hw/virtio-pci.h            |  1 -
 include/block/block_int.h  |  3 +--
 16 files changed, 54 insertions(+), 66 deletions(-)

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

* Re: [Qemu-devel] [PULL 0/8] Block patches
  2011-07-06 14:21 Kevin Wolf
  2011-07-12  9:14 ` Kevin Wolf
@ 2011-07-12 13:16 ` Anthony Liguori
  1 sibling, 0 replies; 31+ messages in thread
From: Anthony Liguori @ 2011-07-12 13:16 UTC (permalink / raw)
  To: Kevin Wolf; +Cc: qemu-devel

On 07/06/2011 09:21 AM, Kevin Wolf wrote:
> The following changes since commit 9312805d33e8b106bae356d13a8071fb37d75554:
>
>    pxa2xx_lcd: add proper rotation support (2011-07-04 22:12:21 +0200)

Pulled.  Thanks.

Regards,

Anthony Liguori

>
> are available in the git repository at:
>    git://repo.or.cz/qemu/kevin.git for-anthony
>
> Federico Simoncelli (1):
>        qemu-img: Add cache command line option
>
> Johannes Stezenbach (1):
>        block/raw-posix: Linux compat-ioctl warning workaround
>
> Kevin Wolf (3):
>        Documentation: Remove outdated host_device note
>        ide: Ignore reads during PIO in and writes during PIO out
>        ide: Initialise buffers with zeros
>
> Luiz Capitulino (2):
>        block: drive_init(): Simplify interface type setting
>        block: drive_init(): Improve CHS setting error message
>
> Markus Armbruster (1):
>        virtio-blk: Turn drive serial into a qdev property
>
>   block/raw-posix.c    |   14 +++++++++
>   blockdev.c           |   14 +++-----
>   hw/ide/core.c        |   50 +++++++++++++++++++++++++-----
>   hw/s390-virtio-bus.c |    4 ++-
>   hw/s390-virtio-bus.h |    1 +
>   hw/virtio-blk.c      |   29 ++++++++++++------
>   hw/virtio-blk.h      |    2 +
>   hw/virtio-pci.c      |    4 ++-
>   hw/virtio-pci.h      |    1 +
>   hw/virtio.h          |    3 +-
>   qemu-img-cmds.hx     |    6 ++--
>   qemu-img.c           |   80 +++++++++++++++++++++++++++++++++++++++++--------
>   qemu-img.texi        |    6 ----
>   13 files changed, 161 insertions(+), 53 deletions(-)
>
>

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

* Re: [Qemu-devel] [PULL 0/8] Block patches
  2011-07-06 14:21 Kevin Wolf
@ 2011-07-12  9:14 ` Kevin Wolf
  2011-07-12 13:16 ` Anthony Liguori
  1 sibling, 0 replies; 31+ messages in thread
From: Kevin Wolf @ 2011-07-12  9:14 UTC (permalink / raw)
  To: Kevin Wolf; +Cc: qemu-devel

Am 06.07.2011 16:21, schrieb Kevin Wolf:
> The following changes since commit 9312805d33e8b106bae356d13a8071fb37d75554:
> 
>   pxa2xx_lcd: add proper rotation support (2011-07-04 22:12:21 +0200)
> 
> are available in the git repository at:
>   git://repo.or.cz/qemu/kevin.git for-anthony
> 
> Federico Simoncelli (1):
>       qemu-img: Add cache command line option
> 
> Johannes Stezenbach (1):
>       block/raw-posix: Linux compat-ioctl warning workaround
> 
> Kevin Wolf (3):
>       Documentation: Remove outdated host_device note
>       ide: Ignore reads during PIO in and writes during PIO out
>       ide: Initialise buffers with zeros
> 
> Luiz Capitulino (2):
>       block: drive_init(): Simplify interface type setting
>       block: drive_init(): Improve CHS setting error message
> 
> Markus Armbruster (1):
>       virtio-blk: Turn drive serial into a qdev property
> 
>  block/raw-posix.c    |   14 +++++++++
>  blockdev.c           |   14 +++-----
>  hw/ide/core.c        |   50 +++++++++++++++++++++++++-----
>  hw/s390-virtio-bus.c |    4 ++-
>  hw/s390-virtio-bus.h |    1 +
>  hw/virtio-blk.c      |   29 ++++++++++++------
>  hw/virtio-blk.h      |    2 +
>  hw/virtio-pci.c      |    4 ++-
>  hw/virtio-pci.h      |    1 +
>  hw/virtio.h          |    3 +-
>  qemu-img-cmds.hx     |    6 ++--
>  qemu-img.c           |   80 +++++++++++++++++++++++++++++++++++++++++--------
>  qemu-img.texi        |    6 ----
>  13 files changed, 161 insertions(+), 53 deletions(-)

Ping?

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

* [Qemu-devel] [PULL 0/8] Block patches
@ 2011-07-06 14:21 Kevin Wolf
  2011-07-12  9:14 ` Kevin Wolf
  2011-07-12 13:16 ` Anthony Liguori
  0 siblings, 2 replies; 31+ messages in thread
From: Kevin Wolf @ 2011-07-06 14:21 UTC (permalink / raw)
  To: anthony; +Cc: kwolf, qemu-devel

The following changes since commit 9312805d33e8b106bae356d13a8071fb37d75554:

  pxa2xx_lcd: add proper rotation support (2011-07-04 22:12:21 +0200)

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

Federico Simoncelli (1):
      qemu-img: Add cache command line option

Johannes Stezenbach (1):
      block/raw-posix: Linux compat-ioctl warning workaround

Kevin Wolf (3):
      Documentation: Remove outdated host_device note
      ide: Ignore reads during PIO in and writes during PIO out
      ide: Initialise buffers with zeros

Luiz Capitulino (2):
      block: drive_init(): Simplify interface type setting
      block: drive_init(): Improve CHS setting error message

Markus Armbruster (1):
      virtio-blk: Turn drive serial into a qdev property

 block/raw-posix.c    |   14 +++++++++
 blockdev.c           |   14 +++-----
 hw/ide/core.c        |   50 +++++++++++++++++++++++++-----
 hw/s390-virtio-bus.c |    4 ++-
 hw/s390-virtio-bus.h |    1 +
 hw/virtio-blk.c      |   29 ++++++++++++------
 hw/virtio-blk.h      |    2 +
 hw/virtio-pci.c      |    4 ++-
 hw/virtio-pci.h      |    1 +
 hw/virtio.h          |    3 +-
 qemu-img-cmds.hx     |    6 ++--
 qemu-img.c           |   80 +++++++++++++++++++++++++++++++++++++++++--------
 qemu-img.texi        |    6 ----
 13 files changed, 161 insertions(+), 53 deletions(-)

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

* [Qemu-devel] [PULL 0/8] Block patches
@ 2010-05-20 13:10 Kevin Wolf
  0 siblings, 0 replies; 31+ messages in thread
From: Kevin Wolf @ 2010-05-20 13:10 UTC (permalink / raw)
  To: anthony; +Cc: kwolf, qemu-devel

Hi Anthony,

this bunch of patches contains some fixes that I think qualify for stable,
especially the first two. Please cherry-pick them into stable-0.12 when you
have pulled:

468f932 block: fix sector comparism in multiwrite_req_compare
49eb7b7 virtio-blk: fix barrier support
5fdf2a6 block: fix aio_flush segfaults for read-only protocols (e.g. curl)

Kevin


The following changes since commit 5a4bb580cdb10b066f9fd67658b31cac4a4ea5e5:
  Richard Henderson (1):
        target-sparc: Simplify ICC generation.

are available in the git repository at:

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

Avi Kivity (1):
      block: fix aio_flush segfaults for read-only protocols (e.g. curl)

Christoph Hellwig (2):
      virtio-blk: fix barrier support
      block: fix sector comparism in multiwrite_req_compare

Kevin Wolf (1):
      vvfat: More build fixes with DEBUG

Nicholas Bellinger (2):
      block: Make find_image_format() return 'raw' BlockDriver for SG_IO devices
      block: Add SG_IO device check in refresh_total_sectors()

Riccardo Magliocchetti (1):
      vvfat: Fix compilation with DEBUG defined

Stefan Hajnoczi (1):
      virtio-blk: Avoid zeroing every request structure

 aio.c           |    4 +++-
 block.c         |   23 ++++++++++++++++++++++-
 block/vvfat.c   |   10 +++++++---
 hw/virtio-blk.c |   19 ++++++++++++++++---
 4 files changed, 48 insertions(+), 8 deletions(-)

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

end of thread, other threads:[~2019-06-24 14:52 UTC | newest]

Thread overview: 31+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-07-15 11:16 [Qemu-devel] [PULL 0/8] Block patches Kevin Wolf
2013-07-15 11:16 ` [Qemu-devel] [PULL 1/8] blockdev: add sync mode to drive-backup QMP command Kevin Wolf
2013-07-15 11:16 ` [Qemu-devel] [PULL 2/8] block: add drive_backup HMP command Kevin Wolf
2013-07-15 11:16 ` [Qemu-devel] [PULL 3/8] block: Don't parse protocol from file.filename Kevin Wolf
2013-07-15 11:16 ` [Qemu-devel] [PULL 4/8] qemu-iotests: Update 051 reference output Kevin Wolf
2013-07-15 11:16 ` [Qemu-devel] [PULL 5/8] block: Add return value for bdrv_flush_all() Kevin Wolf
2013-07-15 11:16 ` [Qemu-devel] [PULL 6/8] cpus: Add return value for vm_stop() Kevin Wolf
2013-07-15 11:16 ` [Qemu-devel] [PULL 7/8] migration: Fail migration on bdrv_flush_all() error Kevin Wolf
2013-07-15 11:16 ` [Qemu-devel] [PULL 8/8] ahci: Fix FLUSH command Kevin Wolf
  -- strict thread matches above, loose matches on Subject: below --
2019-06-21 13:23 [Qemu-devel] [PULL 0/8] Block patches Max Reitz
2019-06-23 17:18 ` Peter Maydell
2019-06-24 12:20   ` Max Reitz
2019-06-24 13:15     ` Pino Toscano
2019-06-24 14:49       ` Max Reitz
2019-05-10 13:02 Stefan Hajnoczi
2019-05-10 14:24 ` Peter Maydell
2018-05-12  9:28 Stefan Hajnoczi
2018-05-12  9:42 ` no-reply
2018-05-14 13:15 ` Peter Maydell
2018-05-14 16:02   ` Peter Maydell
2018-05-14 17:53 ` Peter Maydell
2016-07-18 16:59 Stefan Hajnoczi
2016-07-19  8:01 ` Peter Maydell
2014-01-31 21:19 Stefan Hajnoczi
2014-02-05 16:38 ` Peter Maydell
2013-10-07 11:28 Stefan Hajnoczi
2013-04-05 13:28 Kevin Wolf
2011-07-06 14:21 Kevin Wolf
2011-07-12  9:14 ` Kevin Wolf
2011-07-12 13:16 ` Anthony Liguori
2010-05-20 13:10 Kevin Wolf

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.