All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [PULL 00/12] Block layer patches for 2.8.0-rc0
@ 2016-11-11 16:54 Kevin Wolf
  2016-11-11 16:55 ` [Qemu-devel] [PULL 01/12] block/nbd: Fix the leaked visitor Kevin Wolf
                   ` (11 more replies)
  0 siblings, 12 replies; 13+ messages in thread
From: Kevin Wolf @ 2016-11-11 16:54 UTC (permalink / raw)
  To: qemu-block; +Cc: kwolf, stefanha, qemu-devel

The following changes since commit 6bbcb76301a72dc80c8d29af13d40bb9a759c9c6:

  MAINTAINERS: Remove obsolete stable branches (2016-11-10 15:29:59 +0000)

are available in the git repository at:

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

for you to fetch changes up to ff569b9424d1e6c7144dbe7d76ea50f5c11d4a1c:

  Merge remote-tracking branch 'mreitz/tags/pull-block-2016-11-11' into queue-block (2016-11-11 15:58:12 +0100)

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

Block layer patches for 2.8.0-rc0

----------------------------------------------------------------
Alberto Garcia (2):
      hmp: Make block_stream set an explicit job ID
      qcow2: Remove stale FIXME comment

Ashijeet Acharya (2):
      block/nbd: Fix the leaked visitor
      block/ssh: Code cleanup for unused parameter

Fam Zheng (1):
      raw-posix: Rename 'raw_s' to 'rs'

Kevin Wolf (2):
      nfs: Fix memory leak in nfs_file_create()
      Merge remote-tracking branch 'mreitz/tags/pull-block-2016-11-11' into queue-block

Max Reitz (4):
      block: Fix bdrv_iterate_format() sorting
      block: Emit modules in bdrv_iterate_format()
      iotests: Skip test 162 if there is no SSH support
      iotests: Always use -machine accel=qtest

Tomáš Golembiovský (2):
      raw_bsd: move check to prevent overflow
      raw_bsd: don't check size alignment when only offset is set

 block.c                        | 20 ++++++++++++++-
 block/nbd.c                    |  1 +
 block/nfs.c                    |  1 +
 block/qcow2.h                  |  2 --
 block/raw-posix.c              | 56 +++++++++++++++++++++---------------------
 block/raw_bsd.c                | 12 +++++++--
 block/ssh.c                    |  5 ++--
 hmp.c                          |  2 +-
 tests/qemu-iotests/162         |  3 +++
 tests/qemu-iotests/common      |  2 +-
 tests/qemu-iotests/common.qemu | 12 ++++-----
 11 files changed, 71 insertions(+), 45 deletions(-)

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

* [Qemu-devel] [PULL 01/12] block/nbd: Fix the leaked visitor
  2016-11-11 16:54 [Qemu-devel] [PULL 00/12] Block layer patches for 2.8.0-rc0 Kevin Wolf
@ 2016-11-11 16:55 ` Kevin Wolf
  2016-11-11 16:55 ` [Qemu-devel] [PULL 02/12] block/ssh: Code cleanup for unused parameter Kevin Wolf
                   ` (10 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: Kevin Wolf @ 2016-11-11 16:55 UTC (permalink / raw)
  To: qemu-block; +Cc: kwolf, stefanha, qemu-devel

From: Ashijeet Acharya <ashijeetacharya@gmail.com>

This patch frees the leaked visitor in nbd_refresh_filename() and uses
visit_free() to fix it. The leak was introduced by the commit 491d6c7.

Signed-off-by: Ashijeet Acharya <ashijeetacharya@gmail.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
---
 block/nbd.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/block/nbd.c b/block/nbd.c
index 9cff839..35f24be 100644
--- a/block/nbd.c
+++ b/block/nbd.c
@@ -536,6 +536,7 @@ static void nbd_refresh_filename(BlockDriverState *bs, QDict *options)
     ov = qobject_output_visitor_new(&saddr_qdict);
     visit_type_SocketAddress(ov, NULL, &s->saddr, &error_abort);
     visit_complete(ov, &saddr_qdict);
+    visit_free(ov);
     assert(qobject_type(saddr_qdict) == QTYPE_QDICT);
 
     qdict_put_obj(opts, "server", saddr_qdict);
-- 
1.8.3.1

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

* [Qemu-devel] [PULL 02/12] block/ssh: Code cleanup for unused parameter
  2016-11-11 16:54 [Qemu-devel] [PULL 00/12] Block layer patches for 2.8.0-rc0 Kevin Wolf
  2016-11-11 16:55 ` [Qemu-devel] [PULL 01/12] block/nbd: Fix the leaked visitor Kevin Wolf
@ 2016-11-11 16:55 ` Kevin Wolf
  2016-11-11 16:55 ` [Qemu-devel] [PULL 03/12] hmp: Make block_stream set an explicit job ID Kevin Wolf
                   ` (9 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: Kevin Wolf @ 2016-11-11 16:55 UTC (permalink / raw)
  To: qemu-block; +Cc: kwolf, stefanha, qemu-devel

From: Ashijeet Acharya <ashijeetacharya@gmail.com>

This patch drops the unused parameter "BDRVSSHState" being passed into
the ssh_config() function and does code cleanup. The unused parameter
was introduced by the commit c322712.

Signed-off-by: Ashijeet Acharya <ashijeetacharya@gmail.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
---
 block/ssh.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/block/ssh.c b/block/ssh.c
index ca071c5..15ed281 100644
--- a/block/ssh.c
+++ b/block/ssh.c
@@ -582,8 +582,7 @@ static bool ssh_process_legacy_socket_options(QDict *output_opts,
     return true;
 }
 
-static InetSocketAddress *ssh_config(BDRVSSHState *s, QDict *options,
-                                     Error **errp)
+static InetSocketAddress *ssh_config(QDict *options, Error **errp)
 {
     InetSocketAddress *inet = NULL;
     QDict *addr = NULL;
@@ -661,7 +660,7 @@ static int connect_to_ssh(BDRVSSHState *s, QDict *options,
     }
 
     /* Pop the config into our state object, Exit if invalid */
-    s->inet = ssh_config(s, options, errp);
+    s->inet = ssh_config(options, errp);
     if (!s->inet) {
         ret = -EINVAL;
         goto err;
-- 
1.8.3.1

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

* [Qemu-devel] [PULL 03/12] hmp: Make block_stream set an explicit job ID
  2016-11-11 16:54 [Qemu-devel] [PULL 00/12] Block layer patches for 2.8.0-rc0 Kevin Wolf
  2016-11-11 16:55 ` [Qemu-devel] [PULL 01/12] block/nbd: Fix the leaked visitor Kevin Wolf
  2016-11-11 16:55 ` [Qemu-devel] [PULL 02/12] block/ssh: Code cleanup for unused parameter Kevin Wolf
@ 2016-11-11 16:55 ` Kevin Wolf
  2016-11-11 16:55 ` [Qemu-devel] [PULL 04/12] raw_bsd: move check to prevent overflow Kevin Wolf
                   ` (8 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: Kevin Wolf @ 2016-11-11 16:55 UTC (permalink / raw)
  To: qemu-block; +Cc: kwolf, stefanha, qemu-devel

From: Alberto Garcia <berto@igalia.com>

A job ID is always required in order to create a block job on a
non-root node. The default ID (obtained with bdrv_get_device_name())
is otherwise empty in this scenario and the job cannot be created.

The HMP block_stream command doesn't set a job ID and therefore it
doesn't allow streaming to intermediate nodes. One solution is to add
an extra parameter to set a job ID. The other solution is to simply
use the node name passed to block_stream as job ID. This won't work
if it's automatically generated (because it contains a '#') but is
otherwise simple enough for all other cases.

This way 'block_stream node3' will create a job with the ID 'node3'
and the good old 'block_stream virtio0' will keep the previous
behaviour and use 'virtio0' for the job ID.

Signed-off-by: Alberto Garcia <berto@igalia.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
---
 hmp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/hmp.c b/hmp.c
index b5e3f54..819166d 100644
--- a/hmp.c
+++ b/hmp.c
@@ -1570,7 +1570,7 @@ void hmp_block_stream(Monitor *mon, const QDict *qdict)
     const char *base = qdict_get_try_str(qdict, "base");
     int64_t speed = qdict_get_try_int(qdict, "speed", 0);
 
-    qmp_block_stream(false, NULL, device, base != NULL, base, false, NULL,
+    qmp_block_stream(true, device, device, base != NULL, base, false, NULL,
                      false, NULL, qdict_haskey(qdict, "speed"), speed,
                      true, BLOCKDEV_ON_ERROR_REPORT, &error);
 
-- 
1.8.3.1

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

* [Qemu-devel] [PULL 04/12] raw_bsd: move check to prevent overflow
  2016-11-11 16:54 [Qemu-devel] [PULL 00/12] Block layer patches for 2.8.0-rc0 Kevin Wolf
                   ` (2 preceding siblings ...)
  2016-11-11 16:55 ` [Qemu-devel] [PULL 03/12] hmp: Make block_stream set an explicit job ID Kevin Wolf
@ 2016-11-11 16:55 ` Kevin Wolf
  2016-11-11 16:55 ` [Qemu-devel] [PULL 05/12] raw_bsd: don't check size alignment when only offset is set Kevin Wolf
                   ` (7 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: Kevin Wolf @ 2016-11-11 16:55 UTC (permalink / raw)
  To: qemu-block; +Cc: kwolf, stefanha, qemu-devel

From: Tomáš Golembiovský <tgolembi@redhat.com>

When only offset is specified but no size and the offset is greater than
the real size of the containing device an overflow occurs when parsing
the options. This overflow is harmless because we do check for this
exact situation little bit later, but it leads to an error message with
weird values. It is better to do the check is sooner and prevent the
overflow.

Signed-off-by: Tomáš Golembiovský <tgolembi@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
---
 block/raw_bsd.c | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/block/raw_bsd.c b/block/raw_bsd.c
index 7c9bebb..cf7a560 100644
--- a/block/raw_bsd.c
+++ b/block/raw_bsd.c
@@ -91,6 +91,14 @@ static int raw_read_options(QDict *options, BlockDriverState *bs,
     }
 
     s->offset = qemu_opt_get_size(opts, "offset", 0);
+    if (s->offset > real_size) {
+        error_setg(errp, "Offset (%" PRIu64 ") cannot be greater than "
+            "size of the containing file (%" PRId64 ")",
+            s->offset, real_size);
+        ret = -EINVAL;
+        goto end;
+    }
+
     if (qemu_opt_find(opts, "size") != NULL) {
         s->size = qemu_opt_get_size(opts, "size", 0);
         s->has_size = true;
@@ -100,7 +108,7 @@ static int raw_read_options(QDict *options, BlockDriverState *bs,
     }
 
     /* Check size and offset */
-    if (real_size < s->offset || (real_size - s->offset) < s->size) {
+    if ((real_size - s->offset) < s->size) {
         error_setg(errp, "The sum of offset (%" PRIu64 ") and size "
             "(%" PRIu64 ") has to be smaller or equal to the "
             " actual size of the containing file (%" PRId64 ")",
-- 
1.8.3.1

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

* [Qemu-devel] [PULL 05/12] raw_bsd: don't check size alignment when only offset is set
  2016-11-11 16:54 [Qemu-devel] [PULL 00/12] Block layer patches for 2.8.0-rc0 Kevin Wolf
                   ` (3 preceding siblings ...)
  2016-11-11 16:55 ` [Qemu-devel] [PULL 04/12] raw_bsd: move check to prevent overflow Kevin Wolf
@ 2016-11-11 16:55 ` Kevin Wolf
  2016-11-11 16:55 ` [Qemu-devel] [PULL 06/12] qcow2: Remove stale FIXME comment Kevin Wolf
                   ` (6 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: Kevin Wolf @ 2016-11-11 16:55 UTC (permalink / raw)
  To: qemu-block; +Cc: kwolf, stefanha, qemu-devel

From: Tomáš Golembiovský <tgolembi@redhat.com>

We make sure that the size is aligned to sector length to prevent any
round ups. Otherwise we could end up reading/writing data outside the
area specified by user. This is only needed when user supplies the size
option to avoid any surprises. It is not necessary when only offset is
set.

More over, the check made it difficult to use the offset option without
size option. The check puts unneeded restriction on the offset which had
to be aligned too. Because bdrv_getlength() returns aligned value having
unaligned offset would make the check fail.

Signed-off-by: Tomáš Golembiovský <tgolembi@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
---
 block/raw_bsd.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/block/raw_bsd.c b/block/raw_bsd.c
index cf7a560..8a5b9b0 100644
--- a/block/raw_bsd.c
+++ b/block/raw_bsd.c
@@ -119,7 +119,7 @@ static int raw_read_options(QDict *options, BlockDriverState *bs,
 
     /* Make sure size is multiple of BDRV_SECTOR_SIZE to prevent rounding
      * up and leaking out of the specified area. */
-    if (!QEMU_IS_ALIGNED(s->size, BDRV_SECTOR_SIZE)) {
+    if (s->has_size && !QEMU_IS_ALIGNED(s->size, BDRV_SECTOR_SIZE)) {
         error_setg(errp, "Specified size is not multiple of %llu",
             BDRV_SECTOR_SIZE);
         ret = -EINVAL;
-- 
1.8.3.1

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

* [Qemu-devel] [PULL 06/12] qcow2: Remove stale FIXME comment
  2016-11-11 16:54 [Qemu-devel] [PULL 00/12] Block layer patches for 2.8.0-rc0 Kevin Wolf
                   ` (4 preceding siblings ...)
  2016-11-11 16:55 ` [Qemu-devel] [PULL 05/12] raw_bsd: don't check size alignment when only offset is set Kevin Wolf
@ 2016-11-11 16:55 ` Kevin Wolf
  2016-11-11 16:55 ` [Qemu-devel] [PULL 07/12] nfs: Fix memory leak in nfs_file_create() Kevin Wolf
                   ` (5 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: Kevin Wolf @ 2016-11-11 16:55 UTC (permalink / raw)
  To: qemu-block; +Cc: kwolf, stefanha, qemu-devel

From: Alberto Garcia <berto@igalia.com>

It was from the time when none of the global functions had a qcow2_
prefix.

Signed-off-by: Alberto Garcia <berto@igalia.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
---
 block/qcow2.h | 2 --
 1 file changed, 2 deletions(-)

diff --git a/block/qcow2.h b/block/qcow2.h
index 92203a8..1823414 100644
--- a/block/qcow2.h
+++ b/block/qcow2.h
@@ -473,8 +473,6 @@ static inline uint64_t refcount_diff(uint64_t r1, uint64_t r2)
     return r1 > r2 ? r1 - r2 : r2 - r1;
 }
 
-// FIXME Need qcow2_ prefix to global functions
-
 /* qcow2.c functions */
 int qcow2_backing_read1(BlockDriverState *bs, QEMUIOVector *qiov,
                   int64_t sector_num, int nb_sectors);
-- 
1.8.3.1

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

* [Qemu-devel] [PULL 07/12] nfs: Fix memory leak in nfs_file_create()
  2016-11-11 16:54 [Qemu-devel] [PULL 00/12] Block layer patches for 2.8.0-rc0 Kevin Wolf
                   ` (5 preceding siblings ...)
  2016-11-11 16:55 ` [Qemu-devel] [PULL 06/12] qcow2: Remove stale FIXME comment Kevin Wolf
@ 2016-11-11 16:55 ` Kevin Wolf
  2016-11-11 16:55 ` [Qemu-devel] [PULL 08/12] block: Fix bdrv_iterate_format() sorting Kevin Wolf
                   ` (4 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: Kevin Wolf @ 2016-11-11 16:55 UTC (permalink / raw)
  To: qemu-block; +Cc: kwolf, stefanha, qemu-devel

The leak was introduced in commit 94d6a7a7.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
---
 block/nfs.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/block/nfs.c b/block/nfs.c
index 55c4e0b..d082783 100644
--- a/block/nfs.c
+++ b/block/nfs.c
@@ -676,6 +676,7 @@ static int nfs_file_create(const char *url, QemuOpts *opts, Error **errp)
     ret = nfs_ftruncate(client->context, client->fh, total_size);
     nfs_client_close(client);
 out:
+    QDECREF(options);
     g_free(client);
     return ret;
 }
-- 
1.8.3.1

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

* [Qemu-devel] [PULL 08/12] block: Fix bdrv_iterate_format() sorting
  2016-11-11 16:54 [Qemu-devel] [PULL 00/12] Block layer patches for 2.8.0-rc0 Kevin Wolf
                   ` (6 preceding siblings ...)
  2016-11-11 16:55 ` [Qemu-devel] [PULL 07/12] nfs: Fix memory leak in nfs_file_create() Kevin Wolf
@ 2016-11-11 16:55 ` Kevin Wolf
  2016-11-11 16:55 ` [Qemu-devel] [PULL 09/12] block: Emit modules in bdrv_iterate_format() Kevin Wolf
                   ` (3 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: Kevin Wolf @ 2016-11-11 16:55 UTC (permalink / raw)
  To: qemu-block; +Cc: kwolf, stefanha, qemu-devel

From: Max Reitz <mreitz@redhat.com>

bdrv_iterate_format() did not actually sort the formats by name but by
"pointer interpreted as string". That is probably not what we intended
to do, so fix it (by changing qsort_strcmp() so it matches the example
from qsort()'s manual page).

Signed-off-by: Max Reitz <mreitz@redhat.com>
Message-id: 20161012204907.25941-2-mreitz@redhat.com
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Max Reitz <mreitz@redhat.com>
---
 block.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/block.c b/block.c
index c19c6c6..67c70c1 100644
--- a/block.c
+++ b/block.c
@@ -2796,7 +2796,7 @@ const char *bdrv_get_format_name(BlockDriverState *bs)
 
 static int qsort_strcmp(const void *a, const void *b)
 {
-    return strcmp(a, b);
+    return strcmp(*(char *const *)a, *(char *const *)b);
 }
 
 void bdrv_iterate_format(void (*it)(void *opaque, const char *name),
-- 
1.8.3.1

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

* [Qemu-devel] [PULL 09/12] block: Emit modules in bdrv_iterate_format()
  2016-11-11 16:54 [Qemu-devel] [PULL 00/12] Block layer patches for 2.8.0-rc0 Kevin Wolf
                   ` (7 preceding siblings ...)
  2016-11-11 16:55 ` [Qemu-devel] [PULL 08/12] block: Fix bdrv_iterate_format() sorting Kevin Wolf
@ 2016-11-11 16:55 ` Kevin Wolf
  2016-11-11 16:55 ` [Qemu-devel] [PULL 10/12] iotests: Skip test 162 if there is no SSH support Kevin Wolf
                   ` (2 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: Kevin Wolf @ 2016-11-11 16:55 UTC (permalink / raw)
  To: qemu-block; +Cc: kwolf, stefanha, qemu-devel

From: Max Reitz <mreitz@redhat.com>

Some block drivers may not be loaded yet, but qemu supports them
nonetheless. bdrv_iterate_format() should report them, too.

Signed-off-by: Max Reitz <mreitz@redhat.com>
Message-id: 20161012204907.25941-3-mreitz@redhat.com
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Max Reitz <mreitz@redhat.com>
---
 block.c | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

diff --git a/block.c b/block.c
index 67c70c1..39ddea3 100644
--- a/block.c
+++ b/block.c
@@ -2822,6 +2822,24 @@ void bdrv_iterate_format(void (*it)(void *opaque, const char *name),
         }
     }
 
+    for (i = 0; i < (int)ARRAY_SIZE(block_driver_modules); i++) {
+        const char *format_name = block_driver_modules[i].format_name;
+
+        if (format_name) {
+            bool found = false;
+            int j = count;
+
+            while (formats && j && !found) {
+                found = !strcmp(formats[--j], format_name);
+            }
+
+            if (!found) {
+                formats = g_renew(const char *, formats, count + 1);
+                formats[count++] = format_name;
+            }
+        }
+    }
+
     qsort(formats, count, sizeof(formats[0]), qsort_strcmp);
 
     for (i = 0; i < count; i++) {
-- 
1.8.3.1

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

* [Qemu-devel] [PULL 10/12] iotests: Skip test 162 if there is no SSH support
  2016-11-11 16:54 [Qemu-devel] [PULL 00/12] Block layer patches for 2.8.0-rc0 Kevin Wolf
                   ` (8 preceding siblings ...)
  2016-11-11 16:55 ` [Qemu-devel] [PULL 09/12] block: Emit modules in bdrv_iterate_format() Kevin Wolf
@ 2016-11-11 16:55 ` Kevin Wolf
  2016-11-11 16:55 ` [Qemu-devel] [PULL 11/12] iotests: Always use -machine accel=qtest Kevin Wolf
  2016-11-11 16:55 ` [Qemu-devel] [PULL 12/12] raw-posix: Rename 'raw_s' to 'rs' Kevin Wolf
  11 siblings, 0 replies; 13+ messages in thread
From: Kevin Wolf @ 2016-11-11 16:55 UTC (permalink / raw)
  To: qemu-block; +Cc: kwolf, stefanha, qemu-devel

From: Max Reitz <mreitz@redhat.com>

Signed-off-by: Max Reitz <mreitz@redhat.com>
Message-id: 20161012204907.25941-4-mreitz@redhat.com
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Max Reitz <mreitz@redhat.com>
---
 tests/qemu-iotests/162 | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/tests/qemu-iotests/162 b/tests/qemu-iotests/162
index f8eecb3..cad2bd7 100755
--- a/tests/qemu-iotests/162
+++ b/tests/qemu-iotests/162
@@ -35,6 +35,9 @@ status=1	# failure is the default!
 _supported_fmt generic
 _supported_os Linux
 
+test_ssh=$($QEMU_IMG --help | grep '^Supported formats:.* ssh\( \|$\)')
+[ "$test_ssh" = "" ] && _notrun "ssh support required"
+
 echo
 echo '=== NBD ==='
 # NBD expects all of its arguments to be strings
-- 
1.8.3.1

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

* [Qemu-devel] [PULL 11/12] iotests: Always use -machine accel=qtest
  2016-11-11 16:54 [Qemu-devel] [PULL 00/12] Block layer patches for 2.8.0-rc0 Kevin Wolf
                   ` (9 preceding siblings ...)
  2016-11-11 16:55 ` [Qemu-devel] [PULL 10/12] iotests: Skip test 162 if there is no SSH support Kevin Wolf
@ 2016-11-11 16:55 ` Kevin Wolf
  2016-11-11 16:55 ` [Qemu-devel] [PULL 12/12] raw-posix: Rename 'raw_s' to 'rs' Kevin Wolf
  11 siblings, 0 replies; 13+ messages in thread
From: Kevin Wolf @ 2016-11-11 16:55 UTC (permalink / raw)
  To: qemu-block; +Cc: kwolf, stefanha, qemu-devel

From: Max Reitz <mreitz@redhat.com>

Currently, we only use -machine accel=qtest when qemu is invoked through
the common.qemu functions. However, we always want to use it, so move it
from common.qemu directly into QEMU_OPTIONS.

Signed-off-by: Max Reitz <mreitz@redhat.com>
Message-id: 20161017183917.8837-1-mreitz@redhat.com
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Max Reitz <mreitz@redhat.com>
---
 tests/qemu-iotests/common      |  2 +-
 tests/qemu-iotests/common.qemu | 12 +++++-------
 2 files changed, 6 insertions(+), 8 deletions(-)

diff --git a/tests/qemu-iotests/common b/tests/qemu-iotests/common
index d60ea2c..b6274be 100644
--- a/tests/qemu-iotests/common
+++ b/tests/qemu-iotests/common
@@ -51,7 +51,7 @@ export IMGOPTS=""
 export CACHEMODE="writeback"
 export QEMU_IO_OPTIONS=""
 export CACHEMODE_IS_DEFAULT=true
-export QEMU_OPTIONS="-nodefaults"
+export QEMU_OPTIONS="-nodefaults -machine accel=qtest"
 export VALGRIND_QEMU=
 export IMGKEYSECRET=
 export IMGOPTSSYNTAX=false
diff --git a/tests/qemu-iotests/common.qemu b/tests/qemu-iotests/common.qemu
index 2548a87..e657361 100644
--- a/tests/qemu-iotests/common.qemu
+++ b/tests/qemu-iotests/common.qemu
@@ -155,15 +155,13 @@ function _launch_qemu()
 
     if [ -z "$keep_stderr" ]; then
         QEMU_NEED_PID='y'\
-        ${QEMU} -nographic -serial none ${comm} -machine accel=qtest "${@}" \
-                                                                >"${fifo_out}" \
-                                                                2>&1 \
-                                                                <"${fifo_in}" &
+        ${QEMU} -nographic -serial none ${comm} "${@}" >"${fifo_out}" \
+                                                       2>&1 \
+                                                       <"${fifo_in}" &
     elif [ "$keep_stderr" = "y" ]; then
         QEMU_NEED_PID='y'\
-        ${QEMU} -nographic -serial none ${comm} -machine accel=qtest "${@}" \
-                                                                >"${fifo_out}" \
-                                                                <"${fifo_in}" &
+        ${QEMU} -nographic -serial none ${comm} "${@}" >"${fifo_out}" \
+                                                       <"${fifo_in}" &
     else
         exit 1
     fi
-- 
1.8.3.1

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

* [Qemu-devel] [PULL 12/12] raw-posix: Rename 'raw_s' to 'rs'
  2016-11-11 16:54 [Qemu-devel] [PULL 00/12] Block layer patches for 2.8.0-rc0 Kevin Wolf
                   ` (10 preceding siblings ...)
  2016-11-11 16:55 ` [Qemu-devel] [PULL 11/12] iotests: Always use -machine accel=qtest Kevin Wolf
@ 2016-11-11 16:55 ` Kevin Wolf
  11 siblings, 0 replies; 13+ messages in thread
From: Kevin Wolf @ 2016-11-11 16:55 UTC (permalink / raw)
  To: qemu-block; +Cc: kwolf, stefanha, qemu-devel

From: Fam Zheng <famz@redhat.com>

It is too confusing because it sounds like a BDRVRawState variable.

Suggested-by: Max Reitz <mreitz@redhat.com>
Signed-off-by: Fam Zheng <famz@redhat.com>
Message-id: 1477565117-17230-1-git-send-email-famz@redhat.com
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Max Reitz <mreitz@redhat.com>
---
 block/raw-posix.c | 56 +++++++++++++++++++++++++++----------------------------
 1 file changed, 28 insertions(+), 28 deletions(-)

diff --git a/block/raw-posix.c b/block/raw-posix.c
index 247e47b..28b47d9 100644
--- a/block/raw-posix.c
+++ b/block/raw-posix.c
@@ -542,7 +542,7 @@ static int raw_reopen_prepare(BDRVReopenState *state,
                               BlockReopenQueue *queue, Error **errp)
 {
     BDRVRawState *s;
-    BDRVRawReopenState *raw_s;
+    BDRVRawReopenState *rs;
     int ret = 0;
     Error *local_err = NULL;
 
@@ -552,15 +552,15 @@ static int raw_reopen_prepare(BDRVReopenState *state,
     s = state->bs->opaque;
 
     state->opaque = g_new0(BDRVRawReopenState, 1);
-    raw_s = state->opaque;
+    rs = state->opaque;
 
     if (s->type == FTYPE_CD) {
-        raw_s->open_flags |= O_NONBLOCK;
+        rs->open_flags |= O_NONBLOCK;
     }
 
-    raw_parse_flags(state->flags, &raw_s->open_flags);
+    raw_parse_flags(state->flags, &rs->open_flags);
 
-    raw_s->fd = -1;
+    rs->fd = -1;
 
     int fcntl_flags = O_APPEND | O_NONBLOCK;
 #ifdef O_NOATIME
@@ -569,35 +569,35 @@ static int raw_reopen_prepare(BDRVReopenState *state,
 
 #ifdef O_ASYNC
     /* Not all operating systems have O_ASYNC, and those that don't
-     * will not let us track the state into raw_s->open_flags (typically
+     * will not let us track the state into rs->open_flags (typically
      * you achieve the same effect with an ioctl, for example I_SETSIG
      * on Solaris). But we do not use O_ASYNC, so that's fine.
      */
     assert((s->open_flags & O_ASYNC) == 0);
 #endif
 
-    if ((raw_s->open_flags & ~fcntl_flags) == (s->open_flags & ~fcntl_flags)) {
+    if ((rs->open_flags & ~fcntl_flags) == (s->open_flags & ~fcntl_flags)) {
         /* dup the original fd */
-        raw_s->fd = qemu_dup(s->fd);
-        if (raw_s->fd >= 0) {
-            ret = fcntl_setfl(raw_s->fd, raw_s->open_flags);
+        rs->fd = qemu_dup(s->fd);
+        if (rs->fd >= 0) {
+            ret = fcntl_setfl(rs->fd, rs->open_flags);
             if (ret) {
-                qemu_close(raw_s->fd);
-                raw_s->fd = -1;
+                qemu_close(rs->fd);
+                rs->fd = -1;
             }
         }
     }
 
     /* If we cannot use fcntl, or fcntl failed, fall back to qemu_open() */
-    if (raw_s->fd == -1) {
+    if (rs->fd == -1) {
         const char *normalized_filename = state->bs->filename;
         ret = raw_normalize_devicepath(&normalized_filename);
         if (ret < 0) {
             error_setg_errno(errp, -ret, "Could not normalize device path");
         } else {
-            assert(!(raw_s->open_flags & O_CREAT));
-            raw_s->fd = qemu_open(normalized_filename, raw_s->open_flags);
-            if (raw_s->fd == -1) {
+            assert(!(rs->open_flags & O_CREAT));
+            rs->fd = qemu_open(normalized_filename, rs->open_flags);
+            if (rs->fd == -1) {
                 error_setg_errno(errp, errno, "Could not reopen file");
                 ret = -1;
             }
@@ -606,11 +606,11 @@ static int raw_reopen_prepare(BDRVReopenState *state,
 
     /* Fail already reopen_prepare() if we can't get a working O_DIRECT
      * alignment with the new fd. */
-    if (raw_s->fd != -1) {
-        raw_probe_alignment(state->bs, raw_s->fd, &local_err);
+    if (rs->fd != -1) {
+        raw_probe_alignment(state->bs, rs->fd, &local_err);
         if (local_err) {
-            qemu_close(raw_s->fd);
-            raw_s->fd = -1;
+            qemu_close(rs->fd);
+            rs->fd = -1;
             error_propagate(errp, local_err);
             ret = -EINVAL;
         }
@@ -621,13 +621,13 @@ static int raw_reopen_prepare(BDRVReopenState *state,
 
 static void raw_reopen_commit(BDRVReopenState *state)
 {
-    BDRVRawReopenState *raw_s = state->opaque;
+    BDRVRawReopenState *rs = state->opaque;
     BDRVRawState *s = state->bs->opaque;
 
-    s->open_flags = raw_s->open_flags;
+    s->open_flags = rs->open_flags;
 
     qemu_close(s->fd);
-    s->fd = raw_s->fd;
+    s->fd = rs->fd;
 
     g_free(state->opaque);
     state->opaque = NULL;
@@ -636,16 +636,16 @@ static void raw_reopen_commit(BDRVReopenState *state)
 
 static void raw_reopen_abort(BDRVReopenState *state)
 {
-    BDRVRawReopenState *raw_s = state->opaque;
+    BDRVRawReopenState *rs = state->opaque;
 
      /* nothing to do if NULL, we didn't get far enough */
-    if (raw_s == NULL) {
+    if (rs == NULL) {
         return;
     }
 
-    if (raw_s->fd >= 0) {
-        qemu_close(raw_s->fd);
-        raw_s->fd = -1;
+    if (rs->fd >= 0) {
+        qemu_close(rs->fd);
+        rs->fd = -1;
     }
     g_free(state->opaque);
     state->opaque = NULL;
-- 
1.8.3.1

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

end of thread, other threads:[~2016-11-11 16:55 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-11-11 16:54 [Qemu-devel] [PULL 00/12] Block layer patches for 2.8.0-rc0 Kevin Wolf
2016-11-11 16:55 ` [Qemu-devel] [PULL 01/12] block/nbd: Fix the leaked visitor Kevin Wolf
2016-11-11 16:55 ` [Qemu-devel] [PULL 02/12] block/ssh: Code cleanup for unused parameter Kevin Wolf
2016-11-11 16:55 ` [Qemu-devel] [PULL 03/12] hmp: Make block_stream set an explicit job ID Kevin Wolf
2016-11-11 16:55 ` [Qemu-devel] [PULL 04/12] raw_bsd: move check to prevent overflow Kevin Wolf
2016-11-11 16:55 ` [Qemu-devel] [PULL 05/12] raw_bsd: don't check size alignment when only offset is set Kevin Wolf
2016-11-11 16:55 ` [Qemu-devel] [PULL 06/12] qcow2: Remove stale FIXME comment Kevin Wolf
2016-11-11 16:55 ` [Qemu-devel] [PULL 07/12] nfs: Fix memory leak in nfs_file_create() Kevin Wolf
2016-11-11 16:55 ` [Qemu-devel] [PULL 08/12] block: Fix bdrv_iterate_format() sorting Kevin Wolf
2016-11-11 16:55 ` [Qemu-devel] [PULL 09/12] block: Emit modules in bdrv_iterate_format() Kevin Wolf
2016-11-11 16:55 ` [Qemu-devel] [PULL 10/12] iotests: Skip test 162 if there is no SSH support Kevin Wolf
2016-11-11 16:55 ` [Qemu-devel] [PULL 11/12] iotests: Always use -machine accel=qtest Kevin Wolf
2016-11-11 16:55 ` [Qemu-devel] [PULL 12/12] raw-posix: Rename 'raw_s' to 'rs' 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.