qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PULL 0/6] Block patches for 2.5.0-rc2
@ 2015-11-25 14:10 Kevin Wolf
  2015-11-25 14:10 ` [Qemu-devel] [PULL 1/6] tests/Makefile: Add more dependencies for test-timed-average Kevin Wolf
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: Kevin Wolf @ 2015-11-25 14:10 UTC (permalink / raw)
  To: qemu-block; +Cc: kwolf, qemu-devel

The following changes since commit 1aae36df4b8ed884c6ef6995e70c67fad79b49df:

  Merge remote-tracking branch 'remotes/armbru/tags/pull-ivshmem-2015-11-25' into staging (2015-11-25 11:38:03 +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 8c34d891b1594840d8394a3c9b92236c13254fd8:

  Merge remote-tracking branch 'mreitz/tags/pull-block-for-kevin-2015-11-25' into queue-block (2015-11-25 14:33:01 +0100)

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

Block layer patches

----------------------------------------------------------------
Fam Zheng (1):
      qemu-iotests: Add -nographic when starting QEMU in 119 and 120

Kevin Wolf (3):
      tests/Makefile: Add more dependencies for test-timed-average
      test-aio: Fix event notifier cleanup
      Merge remote-tracking branch 'mreitz/tags/pull-block-for-kevin-2015-11-25' into queue-block

Markus Armbruster (1):
      block/qapi: Plug memory leak on query-block error path

Programmingkid (1):
      raw-posix.c: Make GetBSDPath() handle caching options

Ricard Wanderlof (1):
      nand: fix flash erase when oob is in memory

 block/qapi.c           |  8 +++-----
 block/raw-posix.c      | 15 +++++++++------
 hw/block/nand.c        |  2 +-
 tests/Makefile         |  3 +--
 tests/qemu-iotests/119 |  2 +-
 tests/qemu-iotests/120 |  2 +-
 tests/test-aio.c       |  1 +
 7 files changed, 17 insertions(+), 16 deletions(-)

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

* [Qemu-devel] [PULL 1/6] tests/Makefile: Add more dependencies for test-timed-average
  2015-11-25 14:10 [Qemu-devel] [PULL 0/6] Block patches for 2.5.0-rc2 Kevin Wolf
@ 2015-11-25 14:10 ` Kevin Wolf
  2015-11-25 14:10 ` [Qemu-devel] [PULL 2/6] test-aio: Fix event notifier cleanup Kevin Wolf
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: Kevin Wolf @ 2015-11-25 14:10 UTC (permalink / raw)
  To: qemu-block; +Cc: kwolf, qemu-devel

'make check' failed to compile the test case for mingw because of
undefined references. Pull in a few more dependencies so that it builds.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
---
 tests/Makefile | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/tests/Makefile b/tests/Makefile
index b937984..0ef00a1 100644
--- a/tests/Makefile
+++ b/tests/Makefile
@@ -415,8 +415,7 @@ tests/test-vmstate$(EXESUF): tests/test-vmstate.o \
         migration/qemu-file-unix.o qjson.o \
 	$(test-qom-obj-y)
 tests/test-timed-average$(EXESUF): tests/test-timed-average.o qemu-timer.o \
-	libqemuutil.a stubs/clock-warp.o stubs/cpu-get-icount.o \
-	stubs/notify-event.o stubs/replay.o
+	$(test-util-obj-y)
 
 tests/test-qapi-types.c tests/test-qapi-types.h :\
 $(SRC_PATH)/tests/qapi-schema/qapi-schema-test.json $(SRC_PATH)/scripts/qapi-types.py $(qapi-py)
-- 
1.8.3.1

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

* [Qemu-devel] [PULL 2/6] test-aio: Fix event notifier cleanup
  2015-11-25 14:10 [Qemu-devel] [PULL 0/6] Block patches for 2.5.0-rc2 Kevin Wolf
  2015-11-25 14:10 ` [Qemu-devel] [PULL 1/6] tests/Makefile: Add more dependencies for test-timed-average Kevin Wolf
@ 2015-11-25 14:10 ` Kevin Wolf
  2015-11-25 14:10 ` [Qemu-devel] [PULL 3/6] nand: fix flash erase when oob is in memory Kevin Wolf
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: Kevin Wolf @ 2015-11-25 14:10 UTC (permalink / raw)
  To: qemu-block; +Cc: kwolf, qemu-devel

One test case closed an event notifier (event_notifier_cleanup())
without first disabling it (set_event_notifier(..., NULL)). This
resulted in a leftover handle 0 that was added to each subsequent
WaitForMultipleObjects() call, causing the function to fail (invalid
handle).

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
---
 tests/test-aio.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/tests/test-aio.c b/tests/test-aio.c
index 1623803..e188d8c 100644
--- a/tests/test-aio.c
+++ b/tests/test-aio.c
@@ -393,6 +393,7 @@ static void test_aio_external_client(void)
             aio_enable_external(ctx);
         }
         assert(aio_poll(ctx, false));
+        set_event_notifier(ctx, &data.e, NULL);
         event_notifier_cleanup(&data.e);
     }
 }
-- 
1.8.3.1

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

* [Qemu-devel] [PULL 3/6] nand: fix flash erase when oob is in memory
  2015-11-25 14:10 [Qemu-devel] [PULL 0/6] Block patches for 2.5.0-rc2 Kevin Wolf
  2015-11-25 14:10 ` [Qemu-devel] [PULL 1/6] tests/Makefile: Add more dependencies for test-timed-average Kevin Wolf
  2015-11-25 14:10 ` [Qemu-devel] [PULL 2/6] test-aio: Fix event notifier cleanup Kevin Wolf
@ 2015-11-25 14:10 ` Kevin Wolf
  2015-11-25 14:10 ` [Qemu-devel] [PULL 4/6] raw-posix.c: Make GetBSDPath() handle caching options Kevin Wolf
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: Kevin Wolf @ 2015-11-25 14:10 UTC (permalink / raw)
  To: qemu-block; +Cc: kwolf, qemu-devel

From: Ricard Wanderlof <ricard.wanderlof@axis.com>

For the "main area on file, oob in memory" case, fix the shifts so that
we erase the correct number of pages.

Signed-off-by: Ricard Wanderlöf <ricardw@axis.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
---
 hw/block/nand.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/hw/block/nand.c b/hw/block/nand.c
index a68266f..f0e3413 100644
--- a/hw/block/nand.c
+++ b/hw/block/nand.c
@@ -712,7 +712,7 @@ static void glue(nand_blk_erase_, PAGE_SIZE)(NANDFlashState *s)
         memset(s->storage + (PAGE(addr) << OOB_SHIFT),
                         0xff, OOB_SIZE << s->erase_shift);
         i = SECTOR(addr);
-        page = SECTOR(addr + (ADDR_SHIFT + s->erase_shift));
+        page = SECTOR(addr + (1 << (ADDR_SHIFT + s->erase_shift)));
         for (; i < page; i ++)
             if (blk_write(s->blk, i, iobuf, 1) < 0) {
                 printf("%s: write error in sector %" PRIu64 "\n", __func__, i);
-- 
1.8.3.1

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

* [Qemu-devel] [PULL 4/6] raw-posix.c: Make GetBSDPath() handle caching options
  2015-11-25 14:10 [Qemu-devel] [PULL 0/6] Block patches for 2.5.0-rc2 Kevin Wolf
                   ` (2 preceding siblings ...)
  2015-11-25 14:10 ` [Qemu-devel] [PULL 3/6] nand: fix flash erase when oob is in memory Kevin Wolf
@ 2015-11-25 14:10 ` Kevin Wolf
  2015-11-25 14:10 ` [Qemu-devel] [PULL 5/6] block/qapi: Plug memory leak on query-block error path Kevin Wolf
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: Kevin Wolf @ 2015-11-25 14:10 UTC (permalink / raw)
  To: qemu-block; +Cc: kwolf, qemu-devel

From: Programmingkid <programmingkidx@gmail.com>

Add support for caching options that can be specified from the command
line.

The CD-ROM raw char device bypasses the host page cache and therefore
has alignment requirements.  Alignment probing is necessary so only use
the raw char device if BDRV_O_NOCACHE is set.

This patch fixes -cdrom /dev/cdrom on Mac OS X hosts, where bdrv_read()
used to fail due to misaligned requests during image format probing.

Signed-off-by: John Arbuckle <programmingkidx@gmail.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
---
 block/raw-posix.c | 15 +++++++++------
 1 file changed, 9 insertions(+), 6 deletions(-)

diff --git a/block/raw-posix.c b/block/raw-posix.c
index aec9ec6..d9162fd 100644
--- a/block/raw-posix.c
+++ b/block/raw-posix.c
@@ -1976,8 +1976,8 @@ BlockDriver bdrv_file = {
 
 #if defined(__APPLE__) && defined(__MACH__)
 static kern_return_t FindEjectableCDMedia( io_iterator_t *mediaIterator );
-static kern_return_t GetBSDPath( io_iterator_t mediaIterator, char *bsdPath, CFIndex maxPathSize );
-
+static kern_return_t GetBSDPath(io_iterator_t mediaIterator, char *bsdPath,
+                                CFIndex maxPathSize, int flags);
 kern_return_t FindEjectableCDMedia( io_iterator_t *mediaIterator )
 {
     kern_return_t       kernResult;
@@ -2004,7 +2004,8 @@ kern_return_t FindEjectableCDMedia( io_iterator_t *mediaIterator )
     return kernResult;
 }
 
-kern_return_t GetBSDPath( io_iterator_t mediaIterator, char *bsdPath, CFIndex maxPathSize )
+kern_return_t GetBSDPath(io_iterator_t mediaIterator, char *bsdPath,
+                         CFIndex maxPathSize, int flags)
 {
     io_object_t     nextMedia;
     kern_return_t   kernResult = KERN_FAILURE;
@@ -2017,7 +2018,9 @@ kern_return_t GetBSDPath( io_iterator_t mediaIterator, char *bsdPath, CFIndex ma
         if ( bsdPathAsCFString ) {
             size_t devPathLength;
             strcpy( bsdPath, _PATH_DEV );
-            strcat( bsdPath, "r" );
+            if (flags & BDRV_O_NOCACHE) {
+                strcat(bsdPath, "r");
+            }
             devPathLength = strlen( bsdPath );
             if ( CFStringGetCString( bsdPathAsCFString, bsdPath + devPathLength, maxPathSize - devPathLength, kCFStringEncodingASCII ) ) {
                 kernResult = KERN_SUCCESS;
@@ -2129,8 +2132,8 @@ static int hdev_open(BlockDriverState *bs, QDict *options, int flags,
         int fd;
 
         kernResult = FindEjectableCDMedia( &mediaIterator );
-        kernResult = GetBSDPath( mediaIterator, bsdPath, sizeof( bsdPath ) );
-
+        kernResult = GetBSDPath(mediaIterator, bsdPath, sizeof(bsdPath),
+                                flags);
         if ( bsdPath[ 0 ] != '\0' ) {
             strcat(bsdPath,"s0");
             /* some CDs don't have a partition 0 */
-- 
1.8.3.1

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

* [Qemu-devel] [PULL 5/6] block/qapi: Plug memory leak on query-block error path
  2015-11-25 14:10 [Qemu-devel] [PULL 0/6] Block patches for 2.5.0-rc2 Kevin Wolf
                   ` (3 preceding siblings ...)
  2015-11-25 14:10 ` [Qemu-devel] [PULL 4/6] raw-posix.c: Make GetBSDPath() handle caching options Kevin Wolf
@ 2015-11-25 14:10 ` Kevin Wolf
  2015-11-25 14:10 ` [Qemu-devel] [PULL 6/6] qemu-iotests: Add -nographic when starting QEMU in 119 and 120 Kevin Wolf
  2015-11-25 16:20 ` [Qemu-devel] [PULL 0/6] Block patches for 2.5.0-rc2 Peter Maydell
  6 siblings, 0 replies; 8+ messages in thread
From: Kevin Wolf @ 2015-11-25 14:10 UTC (permalink / raw)
  To: qemu-block; +Cc: kwolf, qemu-devel

From: Markus Armbruster <armbru@redhat.com>

Spotted by Coverity.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
---
 block/qapi.c | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/block/qapi.c b/block/qapi.c
index d20262d..267f147 100644
--- a/block/qapi.c
+++ b/block/qapi.c
@@ -436,7 +436,9 @@ BlockInfoList *qmp_query_block(Error **errp)
         bdrv_query_info(blk, &info->value, &local_err);
         if (local_err) {
             error_propagate(errp, local_err);
-            goto err;
+            g_free(info);
+            qapi_free_BlockInfoList(head);
+            return NULL;
         }
 
         *p_next = info;
@@ -444,10 +446,6 @@ BlockInfoList *qmp_query_block(Error **errp)
     }
 
     return head;
-
- err:
-    qapi_free_BlockInfoList(head);
-    return NULL;
 }
 
 BlockStatsList *qmp_query_blockstats(bool has_query_nodes,
-- 
1.8.3.1

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

* [Qemu-devel] [PULL 6/6] qemu-iotests: Add -nographic when starting QEMU in 119 and 120
  2015-11-25 14:10 [Qemu-devel] [PULL 0/6] Block patches for 2.5.0-rc2 Kevin Wolf
                   ` (4 preceding siblings ...)
  2015-11-25 14:10 ` [Qemu-devel] [PULL 5/6] block/qapi: Plug memory leak on query-block error path Kevin Wolf
@ 2015-11-25 14:10 ` Kevin Wolf
  2015-11-25 16:20 ` [Qemu-devel] [PULL 0/6] Block patches for 2.5.0-rc2 Peter Maydell
  6 siblings, 0 replies; 8+ messages in thread
From: Kevin Wolf @ 2015-11-25 14:10 UTC (permalink / raw)
  To: qemu-block; +Cc: kwolf, qemu-devel

From: Fam Zheng <famz@redhat.com>

Otherwise, a window flashes on my desktop (built with SDL). Add this as
other cases have it.

Signed-off-by: Fam Zheng <famz@redhat.com>
Message-id: 1448245930-15031-1-git-send-email-famz@redhat.com
Signed-off-by: Max Reitz <mreitz@redhat.com>
---
 tests/qemu-iotests/119 | 2 +-
 tests/qemu-iotests/120 | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/tests/qemu-iotests/119 b/tests/qemu-iotests/119
index 9a11f1b..cc6ec07 100755
--- a/tests/qemu-iotests/119
+++ b/tests/qemu-iotests/119
@@ -49,7 +49,7 @@ echo "{'execute': 'qmp_capabilities'}
       {'execute': 'human-monitor-command',
        'arguments': {'command-line': 'qemu-io drv \"read -P 0 0 64k\"'}}
       {'execute': 'quit'}" \
-    | $QEMU -drive id=drv,if=none,file="$TEST_IMG",driver=nbd \
+    | $QEMU -nographic -drive id=drv,if=none,file="$TEST_IMG",driver=nbd \
             -qmp stdio -nodefaults \
     | _filter_qmp | _filter_qemu_io
 
diff --git a/tests/qemu-iotests/120 b/tests/qemu-iotests/120
index 9f13078..d899a3f 100755
--- a/tests/qemu-iotests/120
+++ b/tests/qemu-iotests/120
@@ -49,7 +49,7 @@ echo "{'execute': 'qmp_capabilities'}
       {'execute': 'human-monitor-command',
        'arguments': {'command-line': 'qemu-io drv \"write -P 42 0 64k\"'}}
       {'execute': 'quit'}" \
-    | $QEMU -qmp stdio -nodefaults \
+    | $QEMU -qmp stdio -nographic -nodefaults \
             -drive id=drv,if=none,file="$TEST_IMG",driver=raw,file.driver=$IMGFMT \
     | _filter_qmp | _filter_qemu_io
 $QEMU_IO -c 'read -P 42 0 64k' "$TEST_IMG" | _filter_qemu_io
-- 
1.8.3.1

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

* Re: [Qemu-devel] [PULL 0/6] Block patches for 2.5.0-rc2
  2015-11-25 14:10 [Qemu-devel] [PULL 0/6] Block patches for 2.5.0-rc2 Kevin Wolf
                   ` (5 preceding siblings ...)
  2015-11-25 14:10 ` [Qemu-devel] [PULL 6/6] qemu-iotests: Add -nographic when starting QEMU in 119 and 120 Kevin Wolf
@ 2015-11-25 16:20 ` Peter Maydell
  6 siblings, 0 replies; 8+ messages in thread
From: Peter Maydell @ 2015-11-25 16:20 UTC (permalink / raw)
  To: Kevin Wolf; +Cc: QEMU Developers, Qemu-block

On 25 November 2015 at 14:10, Kevin Wolf <kwolf@redhat.com> wrote:
> The following changes since commit 1aae36df4b8ed884c6ef6995e70c67fad79b49df:
>
>   Merge remote-tracking branch 'remotes/armbru/tags/pull-ivshmem-2015-11-25' into staging (2015-11-25 11:38:03 +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 8c34d891b1594840d8394a3c9b92236c13254fd8:
>
>   Merge remote-tracking branch 'mreitz/tags/pull-block-for-kevin-2015-11-25' into queue-block (2015-11-25 14:33:01 +0100)
>
> ----------------------------------------------------------------
>
> Block layer patches
>
> ----------------------------------------------------------------
> Fam Zheng (1):
>       qemu-iotests: Add -nographic when starting QEMU in 119 and 120
>
> Kevin Wolf (3):
>       tests/Makefile: Add more dependencies for test-timed-average
>       test-aio: Fix event notifier cleanup
>       Merge remote-tracking branch 'mreitz/tags/pull-block-for-kevin-2015-11-25' into queue-block
>
> Markus Armbruster (1):
>       block/qapi: Plug memory leak on query-block error path
>
> Programmingkid (1):
>       raw-posix.c: Make GetBSDPath() handle caching options
>
> Ricard Wanderlof (1):
>       nand: fix flash erase when oob is in memory
>
>  block/qapi.c           |  8 +++-----
>  block/raw-posix.c      | 15 +++++++++------
>  hw/block/nand.c        |  2 +-
>  tests/Makefile         |  3 +--
>  tests/qemu-iotests/119 |  2 +-
>  tests/qemu-iotests/120 |  2 +-
>  tests/test-aio.c       |  1 +
>  7 files changed, 17 insertions(+), 16 deletions(-)

Applied, thanks.

-- PMM

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

end of thread, other threads:[~2015-11-25 16:21 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-11-25 14:10 [Qemu-devel] [PULL 0/6] Block patches for 2.5.0-rc2 Kevin Wolf
2015-11-25 14:10 ` [Qemu-devel] [PULL 1/6] tests/Makefile: Add more dependencies for test-timed-average Kevin Wolf
2015-11-25 14:10 ` [Qemu-devel] [PULL 2/6] test-aio: Fix event notifier cleanup Kevin Wolf
2015-11-25 14:10 ` [Qemu-devel] [PULL 3/6] nand: fix flash erase when oob is in memory Kevin Wolf
2015-11-25 14:10 ` [Qemu-devel] [PULL 4/6] raw-posix.c: Make GetBSDPath() handle caching options Kevin Wolf
2015-11-25 14:10 ` [Qemu-devel] [PULL 5/6] block/qapi: Plug memory leak on query-block error path Kevin Wolf
2015-11-25 14:10 ` [Qemu-devel] [PULL 6/6] qemu-iotests: Add -nographic when starting QEMU in 119 and 120 Kevin Wolf
2015-11-25 16:20 ` [Qemu-devel] [PULL 0/6] Block patches for 2.5.0-rc2 Peter Maydell

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