Re: [Qemu-block] [Qemu-devel] [RFC PATCH 32/56] hmp: Make block_set_io_throttle's arguments unsigned

2017-08-08 Thread Markus Armbruster
"Dr. David Alan Gilbert" writes: > * Markus Armbruster (arm...@redhat.com) wrote: >> The previous commit made them unsigned in QMP. Switch HMP's args_type >> from 'l' to 'o'. Loses support for expressions (QEMU pocket >> calculator), gains support for unit suffixes. Negative values are no >> l

Re: [Qemu-block] [Qemu-devel] [RFC PATCH 27/56] block/dirty-bitmap: Clean up signed vs. unsigned dirty counts

2017-08-08 Thread Markus Armbruster
Eric Blake writes: > On 08/07/2017 09:45 AM, Markus Armbruster wrote: >> hbitmap_count() returns uint64_t. >> >> Clean up test-hbitmap.c to check its value with g_assert_cmpuint() >> instead of g_assert_cmpint(). >> >> bdrv_get_dirty_count() and bdrv_get_meta_dirty_count() return its >> value c

Re: [Qemu-block] [Qemu-devel] [RFC PATCH 10/56] hmp: Make balloon's argument unsigned

2017-08-08 Thread Markus Armbruster
"Dr. David Alan Gilbert" writes: > * Markus Armbruster (arm...@redhat.com) wrote: >> The previous commit made it unsigned in QMP. Switch HMP's args_type >> from 'M' to 'o'. Loses support for expressions (QEMU pocket >> calculator), gains support for units other than mebibytes. Negative >> valu

Re: [Qemu-block] [Qemu-devel] [RFC PATCH 09/56] balloon: Make balloon size unsigned in QAPI/QMP

2017-08-08 Thread Markus Armbruster
"Dr. David Alan Gilbert" writes: > * Markus Armbruster (arm...@redhat.com) wrote: >> Sizes should use QAPI type 'size' (uint64_t). balloon parameter >> @value is 'int' (int64_t). qmp_balloon() implicitly converts to >> ram_addr_t, i.e. uint64_t. BALLOON_CHANGE parameter @actual and >> BalloonI

Re: [Qemu-block] [Qemu-devel] [RFC PATCH 03/56] monitor: Rewrite comment describing HMP .args_type

2017-08-08 Thread Markus Armbruster
"Dr. David Alan Gilbert" writes: > * Markus Armbruster (arm...@redhat.com) wrote: >> "Dr. David Alan Gilbert" writes: >> >> > * Markus Armbruster (arm...@redhat.com) wrote: >> >> Signed-off-by: Markus Armbruster >> >> --- >> >> monitor.c | 75 >> >> +++

Re: [Qemu-block] [Qemu-devel] [PATCH 0/9] IDE: replace printfs with tracing

2017-08-08 Thread no-reply
Hi, This series seems to have some coding style problems. See output below for more information: Message-id: 20170808183306.27474-1-js...@redhat.com Subject: [Qemu-devel] [PATCH 0/9] IDE: replace printfs with tracing Type: series === TEST SCRIPT BEGIN === #!/bin/bash BASE=base n=1 total=$(git l

Re: [Qemu-block] [Qemu-devel] [PATCH v2 10/13] vvfat: correctly generate numeric-tail of short file names

2017-08-08 Thread Pranith Kumar
On Mon, Aug 7, 2017 at 7:07 AM, Eric Blake wrote: > On 08/05/2017 01:52 PM, Pranith Kumar wrote: >> FYI, >> >> This commit breaks the build with gcc-7: >> >> CC block/vvfat.o >> qemu/block/vvfat.c: In function ‘read_directory’: >> qemu/block/vvfat.c:605:37: error: ‘__builtin___sprintf_chk’

Re: [Qemu-block] [Qemu-devel] [PATCH 1/9] IDE: replace DEBUG_IDE with tracing system

2017-08-08 Thread Philippe Mathieu-Daudé
On 08/08/2017 05:00 PM, Eric Blake wrote: On 08/08/2017 01:32 PM, John Snow wrote: Out with the old, in with the new. Signed-off-by: John Snow --- hw/ide/piix.c | 11 hw/ide/trace-events | 33 hw/ide/via.c | 10 +++-

Re: [Qemu-block] [Qemu-devel] [PATCH 4/9] ATAPI: Replace DEBUG_IDE_ATAPI with tracing events

2017-08-08 Thread Eric Blake
On 08/08/2017 01:33 PM, John Snow wrote: > Goodbye, printfs. > Hello, fancy printfs. > > Signed-off-by: John Snow > --- > hw/ide/atapi.c| 64 > +-- > hw/ide/trace-events | 19 ++ > include/hw/ide/internal.h | 1 - > 3 fi

Re: [Qemu-block] [PATCH v4] tests: Avoid non-portable 'echo -ARG'

2017-08-08 Thread Eric Blake
On 08/08/2017 09:48 AM, Kevin Wolf wrote: >>> Not completely sure why, but this broke the test with whitespace changes >>> like this: >>> >>> -=== Running test case: mmap.elf -m 1.1M === >>> +=== Running test case: mmap.elf -m1.1M === >> >> I guess that means I'm not regularly running tests/multib

Re: [Qemu-block] [Qemu-devel] [PATCH 3/9] IDE: add tracing for data ports

2017-08-08 Thread John Snow
On 08/08/2017 04:30 PM, Eric Blake wrote: > On 08/08/2017 01:33 PM, John Snow wrote: >> To be used sparingly, but still interesting in the case of small >> firmwares designed to reproduce bugs in QEMU IDE. > > Is that because the trace would fire so frequently in normal usage that > it will drow

Re: [Qemu-block] [Qemu-devel] [PATCH 3/9] IDE: add tracing for data ports

2017-08-08 Thread Eric Blake
On 08/08/2017 03:30 PM, Eric Blake wrote: > On 08/08/2017 01:33 PM, John Snow wrote: >> To be used sparingly, but still interesting in the case of small >> firmwares designed to reproduce bugs in QEMU IDE. > > Is that because the trace would fire so frequently in normal usage that > it will drown

Re: [Qemu-block] [Qemu-devel] [PATCH 3/9] IDE: add tracing for data ports

2017-08-08 Thread Eric Blake
On 08/08/2017 01:33 PM, John Snow wrote: > To be used sparingly, but still interesting in the case of small > firmwares designed to reproduce bugs in QEMU IDE. Is that because the trace would fire so frequently in normal usage that it will drown the user in noise? > > Signed-off-by: John Snow >

Re: [Qemu-block] [Qemu-devel] [PATCH 3/9] IDE: add tracing for data ports

2017-08-08 Thread John Snow
On 08/08/2017 04:10 PM, Eric Blake wrote: > On 08/08/2017 01:33 PM, John Snow wrote: >> To be used sparingly, but still interesting in the case of small >> firmwares designed to reproduce bugs in QEMU IDE. >> >> Signed-off-by: John Snow >> --- >> hw/ide/core.c | 12 +++- >> 1 file chang

Re: [Qemu-block] [Qemu-devel] [PATCH 1/9] IDE: replace DEBUG_IDE with tracing system

2017-08-08 Thread John Snow
On 08/08/2017 04:00 PM, Eric Blake wrote: > On 08/08/2017 01:32 PM, John Snow wrote: >> Out with the old, in with the new. >> >> Signed-off-by: John Snow >> --- > >> hw/ide/piix.c | 11 >> hw/ide/trace-events | 33 >> hw/ide/via.c

Re: [Qemu-block] [Qemu-devel] [PATCH 3/9] IDE: add tracing for data ports

2017-08-08 Thread Eric Blake
On 08/08/2017 01:33 PM, John Snow wrote: > To be used sparingly, but still interesting in the case of small > firmwares designed to reproduce bugs in QEMU IDE. > > Signed-off-by: John Snow > --- > hw/ide/core.c | 12 +++- > 1 file changed, 11 insertions(+), 1 deletion(-) > > diff --git

Re: [Qemu-block] [Qemu-devel] [PATCH 2/9] IDE: Add register hints to tracing

2017-08-08 Thread Eric Blake
On 08/08/2017 01:32 PM, John Snow wrote: > Name the registers for tracing purposes. > > Signed-off-by: John Snow > --- > hw/ide/core.c | 88 > + > hw/ide/trace-events | 4 +-- > 2 files changed, 70 insertions(+), 22 deletions(-) > -

Re: [Qemu-block] [Qemu-devel] [PATCH 1/9] IDE: replace DEBUG_IDE with tracing system

2017-08-08 Thread Eric Blake
On 08/08/2017 01:32 PM, John Snow wrote: > Out with the old, in with the new. > > Signed-off-by: John Snow > --- > hw/ide/piix.c | 11 > hw/ide/trace-events | 33 > hw/ide/via.c | 10 +++- Hmm - should we tweak scripts/git.ord

Re: [Qemu-block] [Qemu-devel] [PATCH 2/4] IDE: test flush on empty CDROM

2017-08-08 Thread John Snow
On 08/08/2017 03:20 PM, Eric Blake wrote: > On 08/08/2017 12:57 PM, John Snow wrote: >> From: Kevin Wolf >> >> Signed-off-by: Kevin Wolf >> Signed-off-by: John Snow >> --- >> tests/ide-test.c | 19 +++ >> 1 file changed, 19 insertions(+) >> > >> +static void test_flush_empty_

Re: [Qemu-block] [Qemu-devel] [PATCH 2/4] IDE: test flush on empty CDROM

2017-08-08 Thread Eric Blake
On 08/08/2017 12:57 PM, John Snow wrote: > From: Kevin Wolf > > Signed-off-by: Kevin Wolf > Signed-off-by: John Snow > --- > tests/ide-test.c | 19 +++ > 1 file changed, 19 insertions(+) > > +static void test_flush_empty_drive(void) > +{ > +QPCIDevice *dev; > +QPCIBar

Re: [Qemu-block] [Qemu-devel] [PATCH 1/4] IDE: Do not flush empty CDROM drives

2017-08-08 Thread Eric Blake
On 08/08/2017 12:57 PM, John Snow wrote: > The block backend changed in a way that flushing empty CDROM drives > is now an error. Amend IDE to avoid doing so until the root problem > can be addressed for 2.11. > > Reported-by: Kieron Shorrock > Signed-off-by: John Snow > --- > hw/ide/core.c | 1

Re: [Qemu-block] [Qemu-devel] [PATCH 3/4] block-backend: shift in-flight counter to BB from BDS

2017-08-08 Thread John Snow
On 08/08/2017 02:34 PM, Paolo Bonzini wrote: > > > - Original Message - >> From: "John Snow" >> To: qemu-block@nongnu.org >> Cc: kw...@redhat.com, qemu-de...@nongnu.org, dgilb...@redhat.com, >> stefa...@redhat.com, pbonz...@redhat.com, >> p...@redhat.com, "John Snow" >> Sent: Tuesday

Re: [Qemu-block] [PATCH 3/4] block-backend: shift in-flight counter to BB from BDS

2017-08-08 Thread Paolo Bonzini
- Original Message - > From: "John Snow" > To: qemu-block@nongnu.org > Cc: kw...@redhat.com, qemu-de...@nongnu.org, dgilb...@redhat.com, > stefa...@redhat.com, pbonz...@redhat.com, > p...@redhat.com, "John Snow" > Sent: Tuesday, August 8, 2017 7:57:10 PM > Subject: [PATCH 3/4] block-ba

[Qemu-block] [PATCH 6/9] AHCI: Replace DPRINTF with trace-events

2017-08-08 Thread John Snow
There are a few hangers-on that will be dealt with individually in forthcoming patches. Signed-off-by: John Snow --- hw/ide/ahci.c | 157 +++- hw/ide/trace-events | 52 - 2 files changed, 119 insertions(+), 90 deletions(-) d

[Qemu-block] [PATCH 8/9] AHCI: pretty-print FIS to buffer instead of stderr

2017-08-08 Thread John Snow
The current FIS printing routines dump the FIS to screen. adjust this such that it dumps to buffer instead, then use this ability to have FIS dump mechanisms via trace-events instead of compiled defines. Signed-off-by: John Snow --- hw/ide/ahci.c | 54 ++

[Qemu-block] [PATCH 9/9] AHCI: remove DPRINTF macro

2017-08-08 Thread John Snow
Signed-off-by: John Snow --- hw/ide/ahci.c | 9 - 1 file changed, 9 deletions(-) diff --git a/hw/ide/ahci.c b/hw/ide/ahci.c index 1a4d4db..ce2010c 100644 --- a/hw/ide/ahci.c +++ b/hw/ide/ahci.c @@ -34,17 +34,8 @@ #include "hw/ide/pci.h" #include "hw/ide/ahci_internal.h" -#define DEBU

[Qemu-block] [PATCH 7/9] AHCI: Rework IRQ constants

2017-08-08 Thread John Snow
Create a new enum so that we can name the IRQ bits, which will make debugging them a little nicer if we can print them out. Not handled in this patch, but this will make it possible to get a nice debug printf detailing exactly which status bits are set, as it can be multiple at any given time. As

[Qemu-block] [PATCH 5/9] IDE: replace DEBUG_AIO with trace events

2017-08-08 Thread John Snow
Signed-off-by: John Snow --- hw/ide/atapi.c| 5 + hw/ide/core.c | 17 ++--- hw/ide/trace-events | 3 +++ include/hw/ide/internal.h | 7 +-- 4 files changed, 19 insertions(+), 13 deletions(-) diff --git a/hw/ide/atapi.c b/hw/ide/atapi.c index 3

[Qemu-block] [PATCH 4/9] ATAPI: Replace DEBUG_IDE_ATAPI with tracing events

2017-08-08 Thread John Snow
Goodbye, printfs. Hello, fancy printfs. Signed-off-by: John Snow --- hw/ide/atapi.c| 64 +-- hw/ide/trace-events | 19 ++ include/hw/ide/internal.h | 1 - 3 files changed, 42 insertions(+), 42 deletions(-) diff --git a/h

[Qemu-block] [PATCH 3/9] IDE: add tracing for data ports

2017-08-08 Thread John Snow
To be used sparingly, but still interesting in the case of small firmwares designed to reproduce bugs in QEMU IDE. Signed-off-by: John Snow --- hw/ide/core.c | 12 +++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/hw/ide/core.c b/hw/ide/core.c index 6235bdf..29848ff 1006

[Qemu-block] [PATCH 0/9] IDE: replace printfs with tracing

2017-08-08 Thread John Snow
Wherever possible, replace all printfs with proper tracing. In most places I've tried to do a straight replacement, but forthcoming patches may calibrate the tracing to be a little nicer. For now, it's nice to just remove the all-or-nothing tracing. John Snow (9): IDE: replace DEBUG_IDE with tr

[Qemu-block] [PATCH 1/9] IDE: replace DEBUG_IDE with tracing system

2017-08-08 Thread John Snow
Out with the old, in with the new. Signed-off-by: John Snow --- Makefile.objs | 1 + hw/ide/cmd646.c | 10 +++- hw/ide/core.c | 65 +++ hw/ide/pci.c | 17 - hw/ide/piix.c | 11

[Qemu-block] [PATCH 2/9] IDE: Add register hints to tracing

2017-08-08 Thread John Snow
Name the registers for tracing purposes. Signed-off-by: John Snow --- hw/ide/core.c | 88 + hw/ide/trace-events | 4 +-- 2 files changed, 70 insertions(+), 22 deletions(-) diff --git a/hw/ide/core.c b/hw/ide/core.c index 53fa084..6235bd

[Qemu-block] [PATCH 4/4] block-backend: test flush op on empty backend

2017-08-08 Thread John Snow
From: Kevin Wolf Signed-off-by: Kevin Wolf Signed-off-by: John Snow --- tests/Makefile.include | 2 ++ tests/test-block-backend.c | 62 ++ 2 files changed, 64 insertions(+) create mode 100644 tests/test-block-backend.c diff --git a/tests/Makef

[Qemu-block] [PATCH 3/4] block-backend: shift in-flight counter to BB from BDS

2017-08-08 Thread John Snow
From: Kevin Wolf This allows us to detect errors in cache flushing (ENOMEDIUM) without choking on a null dereference because we assume that blk_bs(bb) is always defined. Signed-off-by: Kevin Wolf Signed-off-by: John Snow --- block.c | 2 +- block/block-backend.c | 40 ++

[Qemu-block] [PATCH 2/4] IDE: test flush on empty CDROM

2017-08-08 Thread John Snow
From: Kevin Wolf Signed-off-by: Kevin Wolf Signed-off-by: John Snow --- tests/ide-test.c | 19 +++ 1 file changed, 19 insertions(+) diff --git a/tests/ide-test.c b/tests/ide-test.c index bfd79dd..ffbfb04 100644 --- a/tests/ide-test.c +++ b/tests/ide-test.c @@ -689,6 +689,24 @@

[Qemu-block] [PATCH 0/4] IDE: Do not flush empty drives

2017-08-08 Thread John Snow
Patches one and two here are a 2.10 bandaid that avoids a crash. Patches three and four are a more comprehensive fix as written by Kevin in another discussion and are being posted here for the sake of a discussion. Patch three as written causes hangs in iotests 20, 39, 97, 98, 129, 153, 176, and 1

[Qemu-block] [PATCH 1/4] IDE: Do not flush empty CDROM drives

2017-08-08 Thread John Snow
The block backend changed in a way that flushing empty CDROM drives is now an error. Amend IDE to avoid doing so until the root problem can be addressed for 2.11. Reported-by: Kieron Shorrock Signed-off-by: John Snow --- hw/ide/core.c | 11 +++ 1 file changed, 7 insertions(+), 4 deletio

Re: [Qemu-block] [Qemu-devel] [PATCH] iotests: fix 185

2017-08-08 Thread Eric Blake
On 08/08/2017 10:16 AM, Kevin Wolf wrote: is sleep for ms portable? >>> Sadly, sub-second sleep is a GNU coreutils feature; I suspect the BSD >>> machines may fail to parse it. (Of course, we could do some sort of >>> 'sleep $SMALL', where $SMALL is 0.5 if sleep supports it, and 1 otherwise)

Re: [Qemu-block] [Qemu-devel] [RFC PATCH 03/56] monitor: Rewrite comment describing HMP .args_type

2017-08-08 Thread Dr. David Alan Gilbert
* Markus Armbruster (arm...@redhat.com) wrote: > "Dr. David Alan Gilbert" writes: > > > * Markus Armbruster (arm...@redhat.com) wrote: > >> Signed-off-by: Markus Armbruster > >> --- > >> monitor.c | 75 > >> +++ > >> 1 file changed, 4

Re: [Qemu-block] [Qemu-devel] [RFC PATCH 29/56] block: Make BlockDirtyInfo byte count unsigned in QAPI/QMP

2017-08-08 Thread Markus Armbruster
John Snow writes: > On 08/07/2017 10:45 AM, Markus Armbruster wrote: >> Byte counts should use QAPI type 'size' (uint64_t). BlockDirtyInfo >> member @count is 'int' (int64_t). bdrv_query_dirty_bitmaps() computes >> @count from bdrv_get_dirty_count() in uint64_t, then implicitly >> converts to i

Re: [Qemu-block] [Qemu-devel] [RFC PATCH 28/56] block: Widen dirty bitmap granularity to uint64_t for safety

2017-08-08 Thread Markus Armbruster
John Snow writes: > On 08/07/2017 10:45 AM, Markus Armbruster wrote: >> Block dirty bitmaps represent granularity in bytes as uint32_t. It >> must be a power of two and a multiple of BDRV_SECTOR_SIZE. >> >> The trouble with uint32_t is computations like this one in >> mirror_do_read(): >> >>

Re: [Qemu-block] [Qemu-devel] [RFC PATCH 15/56] migration: Make XBZRLE cache size unsigned in QAPI/QMP

2017-08-08 Thread Markus Armbruster
Juan Quintela writes: > Markus Armbruster wrote: >> Sizes should use QAPI type 'size' (uint64_t). migrate-set-cache-size >> parameter @value is 'int' (int64_t). qmp_migrate_set_cache_size() >> ensures it fits into size_t. page_cache.c implicitly converts the >> signed size to unsigned types (

Re: [Qemu-block] [PULL 00/18] Block layer patches for 2.10.0-rc2

2017-08-08 Thread Peter Maydell
On 8 August 2017 at 14:58, Kevin Wolf wrote: > The following changes since commit b4174c4b08a719e7df7e4f35c29f44b7c2517237: > > Merge remote-tracking branch 'remotes/mst/tags/for_upstream' into staging > (2017-08-08 10:01:49 +0100) > > are available in the git repository at: > > git://repo.or

Re: [Qemu-block] [Qemu-devel] [RFC PATCH 07/56] cpus: Make memsave, pmemsave sizes, addresses unsigned in QAPI/QMP

2017-08-08 Thread Markus Armbruster
"Dr. David Alan Gilbert" writes: > * Markus Armbruster (arm...@redhat.com) wrote: >> Sizes, virtual and physical addresses should use QAPI type 'size' >> (uint64_t). memsave, pmemsave parameters @val, @size are 'int' >> (int64_t). qmp_memsave() and qmp_pmemsave() implicitly convert to >> target

Re: [Qemu-block] [Qemu-devel] [RFC PATCH 03/56] monitor: Rewrite comment describing HMP .args_type

2017-08-08 Thread Markus Armbruster
"Dr. David Alan Gilbert" writes: > * Markus Armbruster (arm...@redhat.com) wrote: >> Signed-off-by: Markus Armbruster >> --- >> monitor.c | 75 >> +++ >> 1 file changed, 47 insertions(+), 28 deletions(-) >> >> diff --git a/monitor.c

Re: [Qemu-block] [RFC PATCH 32/56] hmp: Make block_set_io_throttle's arguments unsigned

2017-08-08 Thread Dr. David Alan Gilbert
* Markus Armbruster (arm...@redhat.com) wrote: > The previous commit made them unsigned in QMP. Switch HMP's args_type > from 'l' to 'o'. Loses support for expressions (QEMU pocket > calculator), gains support for unit suffixes. Negative values are no > longer accepted and interpreted modulo 2^6

[Qemu-block] [PATCH v2 for 2.10] block/nbd-client: always return EIO on and after the first io channel error

2017-08-08 Thread Vladimir Sementsov-Ogievskiy
Do not communicate after the first error to avoid communicating throught broken channel. The only exclusion is try to send NBD_CMD_DISC anyway on in nbd_client_close. Signed-off-by: Vladimir Sementsov-Ogievskiy --- Hi all. Here is a patch, fixing a problem noted in [PATCH 06/17] block/nbd-client

Re: [Qemu-block] [Qemu-devel] [PATCH for-2.10] throttle: Make LeakyBucket.avg and LeakyBucket.max integer types

2017-08-08 Thread Alberto Garcia
On Tue 08 Aug 2017 05:11:27 PM CEST, Eric Blake wrote: >> Why is this marked for-2.10? Does it fix a bug? > > Theoretically, converting between int64_t and double loses precision > on any values larger than 2^53. In all practicality, though, if you > expect throttling to be precise through 2^53 (

Re: [Qemu-block] [RFC PATCH 11/56] monitor: Drop unused HMP .args_type 'M'

2017-08-08 Thread Dr. David Alan Gilbert
* Markus Armbruster (arm...@redhat.com) wrote: > The previous commit switched balloon from 'M' to 'o', rendering 'M' > unused. It was never used for anything else. Drop it. > > Signed-off-by: Markus Armbruster Reviewed-by: Dr. David Alan Gilbert > --- > monitor.c | 11 +-- > 1 file

Re: [Qemu-block] [Qemu-devel] [PATCH] iotests: fix 185

2017-08-08 Thread Kevin Wolf
Am 08.08.2017 um 17:10 hat Vladimir Sementsov-Ogievskiy geschrieben: > 08.08.2017 18:07, Eric Blake wrote: > > On 08/08/2017 04:04 AM, Vladimir Sementsov-Ogievskiy wrote: > > > > > > > > Throttling "guaranties" that there will not be more than one > > > > > > request. But > > > > > > what prevent

Re: [Qemu-block] [Qemu-devel] [PATCH for-2.10] throttle: Make LeakyBucket.avg and LeakyBucket.max integer types

2017-08-08 Thread Eric Blake
On 08/08/2017 05:00 AM, Stefan Hajnoczi wrote: > On Mon, Aug 07, 2017 at 07:15:29PM +0300, Alberto Garcia wrote: >> Both the throttling limits set with the throttling.iops-* and >> throttling.bps-* options and their QMP equivalents defined in the >> BlockIOThrottle struct are integer values. >> >>

Re: [Qemu-block] [Qemu-devel] [PATCH] iotests: fix 185

2017-08-08 Thread Vladimir Sementsov-Ogievskiy
08.08.2017 18:07, Eric Blake wrote: On 08/08/2017 04:04 AM, Vladimir Sementsov-Ogievskiy wrote: Throttling "guaranties" that there will not be more than one request. But what prevent less than one, i.e. zero, like in my reproduction? Yes, I understand. Can we somehow make sure that at least on

Re: [Qemu-block] [RFC PATCH 10/56] hmp: Make balloon's argument unsigned

2017-08-08 Thread Dr. David Alan Gilbert
* Markus Armbruster (arm...@redhat.com) wrote: > The previous commit made it unsigned in QMP. Switch HMP's args_type > from 'M' to 'o'. Loses support for expressions (QEMU pocket > calculator), gains support for units other than mebibytes. Negative > values are no longer accepted and interpreted

Re: [Qemu-block] [Qemu-devel] [PATCH] iotests: fix 185

2017-08-08 Thread Eric Blake
On 08/08/2017 04:04 AM, Vladimir Sementsov-Ogievskiy wrote: Throttling "guaranties" that there will not be more than one request. But what prevent less than one, i.e. zero, like in my reproduction? >>> Yes, I understand. Can we somehow make sure that at least one iteration >>> is ma

Re: [Qemu-block] [PATCH v3 5/7] block: add throttle block filter driver

2017-08-08 Thread Alberto Garcia
On Tue 08 Aug 2017 04:56:20 PM CEST, Manos Pitsidianakis wrote: >>> So basically if we have anonymous groups, we accept limits in the >>> driver options but only without a group-name. >> >>In the commit message you do however have limits and a group name, is >>that a mistake? >> >>-drive driver

Re: [Qemu-block] [PATCH] block: document semanatics of bdrv_co_preadv|pwritev

2017-08-08 Thread Eric Blake
On 08/08/2017 04:13 AM, Daniel P. Berrange wrote: > On Tue, Aug 08, 2017 at 10:39:29AM +0800, Fam Zheng wrote: >> On Fri, 08/04 16:49, Daniel P. Berrange wrote: >>> This is odd. In the bdrv_aligned_readv() it looks very much like >>> we'll reference qiov->niov, if bytes != 0, so if qiov was NULL w

Re: [Qemu-block] [PATCH for 2.10] block/nbd-client: always return EIO on and after the first io channel error

2017-08-08 Thread Vladimir Sementsov-Ogievskiy
08.08.2017 17:44, Eric Blake wrote: On 08/08/2017 09:29 AM, Vladimir Sementsov-Ogievskiy wrote: Do not communicate after the first error to avoid communicating throught broken channel. The only exclusion is try to send NBD_CMD_DISC anyway on in nbd_client_close. Signed-off-by: Vladimir Sementso

Re: [Qemu-block] [RFC PATCH 09/56] balloon: Make balloon size unsigned in QAPI/QMP

2017-08-08 Thread Dr. David Alan Gilbert
* Markus Armbruster (arm...@redhat.com) wrote: > Sizes should use QAPI type 'size' (uint64_t). balloon parameter > @value is 'int' (int64_t). qmp_balloon() implicitly converts to > ram_addr_t, i.e. uint64_t. BALLOON_CHANGE parameter @actual and > BalloonInfo member @actual are also 'int'. > virt

Re: [Qemu-block] [PATCH v3 5/7] block: add throttle block filter driver

2017-08-08 Thread Manos Pitsidianakis
On Tue, Aug 08, 2017 at 04:53:08PM +0200, Alberto Garcia wrote: On Tue 08 Aug 2017 03:45:44 PM CEST, Manos Pitsidianakis wrote: On Tue, Aug 08, 2017 at 03:13:36PM +0200, Alberto Garcia wrote: On Mon 31 Jul 2017 11:54:41 AM CEST, Manos Pitsidianakis wrote: block/throttle.c uses existing I/O thr

Re: [Qemu-block] [RFC PATCH 27/56] block/dirty-bitmap: Clean up signed vs. unsigned dirty counts

2017-08-08 Thread Eric Blake
On 08/07/2017 09:45 AM, Markus Armbruster wrote: > hbitmap_count() returns uint64_t. > > Clean up test-hbitmap.c to check its value with g_assert_cmpuint() > instead of g_assert_cmpint(). > > bdrv_get_dirty_count() and bdrv_get_meta_dirty_count() return its > value converted to int64_t. Clean th

Re: [Qemu-block] [Qemu-devel] [RFC PATCH 28/56] block: Widen dirty bitmap granularity to uint64_t for safety

2017-08-08 Thread Eric Blake
On 08/07/2017 08:55 PM, John Snow wrote: > > > On 08/07/2017 10:45 AM, Markus Armbruster wrote: >> Block dirty bitmaps represent granularity in bytes as uint32_t. It >> must be a power of two and a multiple of BDRV_SECTOR_SIZE. >> >> The trouble with uint32_t is computations like this one in >>

Re: [Qemu-block] [PATCH v3 5/7] block: add throttle block filter driver

2017-08-08 Thread Alberto Garcia
On Tue 08 Aug 2017 03:45:44 PM CEST, Manos Pitsidianakis wrote: > On Tue, Aug 08, 2017 at 03:13:36PM +0200, Alberto Garcia wrote: >>On Mon 31 Jul 2017 11:54:41 AM CEST, Manos Pitsidianakis wrote: >>> block/throttle.c uses existing I/O throttle infrastructure inside a >>> block filter driver. I/O op

Re: [Qemu-block] [Qemu-devel] [PATCH 0/3] build configuration query tool and conditional (qemu-io)test skip

2017-08-08 Thread Markus Armbruster
Stefan Hajnoczi writes: > On Tue, Aug 08, 2017 at 10:06:04AM +0200, Markus Armbruster wrote: >> Stefan Hajnoczi writes: >> >> > On Wed, Jul 26, 2017 at 02:24:02PM -0400, Cleber Rosa wrote: >> >> >> >> >> >> On 07/26/2017 01:58 PM, Stefan Hajnoczi wrote: >> >> > On Tue, Jul 25, 2017 at 12:16:1

Re: [Qemu-block] [PATCH v4] tests: Avoid non-portable 'echo -ARG'

2017-08-08 Thread Kevin Wolf
Am 08.08.2017 um 16:29 hat Eric Blake geschrieben: > On 08/08/2017 08:54 AM, Kevin Wolf wrote: > > Am 03.07.2017 um 20:09 hat Eric Blake geschrieben: > >> POSIX says that backslashes in the arguments to 'echo', as well as > >> any use of 'echo -n' and 'echo -e', are non-portable; it recommends > >>

Re: [Qemu-block] [RFC PATCH 03/56] monitor: Rewrite comment describing HMP .args_type

2017-08-08 Thread Dr. David Alan Gilbert
* Paolo Bonzini (pbonz...@redhat.com) wrote: > On 08/08/2017 13:20, Dr. David Alan Gilbert wrote: > > * Markus Armbruster (arm...@redhat.com) wrote: > >> Signed-off-by: Markus Armbruster > >> --- > >> monitor.c | 75 > >> +++ > >> 1 fil

Re: [Qemu-block] [PATCH for 2.10] block/nbd-client: always return EIO on and after the first io channel error

2017-08-08 Thread Eric Blake
On 08/08/2017 09:29 AM, Vladimir Sementsov-Ogievskiy wrote: > Do not communicate after the first error to avoid communicating throught > broken channel. The only exclusion is try to send NBD_CMD_DISC anyway on > in nbd_client_close. > > Signed-off-by: Vladimir Sementsov-Ogievskiy > --- > > Hi al

Re: [Qemu-block] [PATCH for 2.10] block/nbd-client: always return EIO on and after the first io channel error

2017-08-08 Thread Vladimir Sementsov-Ogievskiy
08.08.2017 17:29, Vladimir Sementsov-Ogievskiy wrote: Do not communicate after the first error to avoid communicating throught broken channel. The only exclusion is try to send NBD_CMD_DISC anyway on in nbd_client_close. worth add: To simplify things, return -EIO in case of disconnect too. (re

[Qemu-block] [PATCH for-2.10] tests/multiboot: Fix whitespace failure

2017-08-08 Thread Eric Blake
Commit b43671f8 accidentally broke run_test.sh within tests/multiboot; due to a subtle change in whitespace. These two commands produce theh same output (at least, for sane $IFS of space-tab-newline): echo -e "...$@..." echo -e "...$*..." But that's only because echo inserts spaces between multi

Re: [Qemu-block] [RFC PATCH 07/56] cpus: Make memsave, pmemsave sizes, addresses unsigned in QAPI/QMP

2017-08-08 Thread Dr. David Alan Gilbert
* Markus Armbruster (arm...@redhat.com) wrote: > Sizes, virtual and physical addresses should use QAPI type 'size' > (uint64_t). memsave, pmemsave parameters @val, @size are 'int' > (int64_t). qmp_memsave() and qmp_pmemsave() implicitly convert to > target_ulong or hwaddr. > > Change the paramet

Re: [Qemu-block] [Qemu-devel] [PATCH] virtio-blk: handle blk_getlength() errors

2017-08-08 Thread Fam Zheng
On Tue, 08/08 13:22, Stefan Hajnoczi wrote: > If blk_getlength() fails in virtio_blk_update_config() consider the disk > image length to be 0 bytes. > > Signed-off-by: Stefan Hajnoczi > --- > hw/block/virtio-blk.c | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) > > diff --git a/hw/bl

[Qemu-block] [PATCH for 2.10] block/nbd-client: always return EIO on and after the first io channel error

2017-08-08 Thread Vladimir Sementsov-Ogievskiy
Do not communicate after the first error to avoid communicating throught broken channel. The only exclusion is try to send NBD_CMD_DISC anyway on in nbd_client_close. Signed-off-by: Vladimir Sementsov-Ogievskiy --- Hi all. Here is a patch, fixing a problem noted in [PATCH 06/17] block/nbd-client

Re: [Qemu-block] [PATCH v4] tests: Avoid non-portable 'echo -ARG'

2017-08-08 Thread Eric Blake
On 08/08/2017 08:54 AM, Kevin Wolf wrote: > Am 03.07.2017 um 20:09 hat Eric Blake geschrieben: >> POSIX says that backslashes in the arguments to 'echo', as well as >> any use of 'echo -n' and 'echo -e', are non-portable; it recommends >> people should favor 'printf' instead. This is definitely tr

Re: [Qemu-block] [RFC PATCH 03/56] monitor: Rewrite comment describing HMP .args_type

2017-08-08 Thread Paolo Bonzini
On 08/08/2017 13:20, Dr. David Alan Gilbert wrote: > * Markus Armbruster (arm...@redhat.com) wrote: >> Signed-off-by: Markus Armbruster >> --- >> monitor.c | 75 >> +++ >> 1 file changed, 47 insertions(+), 28 deletions(-) >> >> diff --g

Re: [Qemu-block] [PATCH 2/4] qcow: Check failure of bdrv_getlength() and bdrv_truncate()

2017-08-08 Thread Eric Blake
On 08/08/2017 03:28 AM, Kevin Wolf wrote: > Am 07.08.2017 um 22:30 hat Eric Blake geschrieben: >> This also requires changing the return type of get_cluster_offset() >> and adjusting all callers. >> >> Use osdep.h macros instead of open-coded rounding while in the >> area. >> >> Reported-by: Markus

Re: [Qemu-block] [PATCH v3 for-2.10 0/4] improved --version/--help tweaks

2017-08-08 Thread Jeff Cody
On Tue, Aug 08, 2017 at 08:50:55AM -0500, Eric Blake wrote: > On 08/07/2017 07:08 PM, John Snow wrote: > > > > > > On 08/03/2017 12:33 PM, Eric Blake wrote: > >> Not sure if this should go through Kevin's block tree, Paolo's > >> miscellaneous patches, or if I should just do a pull request > >> m

[Qemu-block] [PULL 17/18] qemu-iotests: Test reopen between read-only and read-write

2017-08-08 Thread Kevin Wolf
This serves as a regression test for the bugs that were just fixed for bdrv_reopen() between read-only and read-write mode. Signed-off-by: Kevin Wolf Reviewed-by: Eric Blake Reviewed-by: Jeff Cody Reviewed-by: John Snow --- tests/qemu-iotests/187 | 69 +

[Qemu-block] [PULL 18/18] block/nfs: fix mutex assertion in nfs_file_close()

2017-08-08 Thread Kevin Wolf
From: Jeff Cody Commit c096358e747e88fc7364e40e3c354ee0bb683960 introduced assertion checks for when qemu_mutex() functions are called without the corresponding qemu_mutex_init() having initialized the mutex. This uncovered a latent bug in qemu's nfs driver - in nfs_client_close(), the NFSClient

[Qemu-block] [PULL 14/18] block: Allow reopen rw without BDRV_O_ALLOW_RDWR

2017-08-08 Thread Kevin Wolf
BDRV_O_ALLOW_RDWR is a flag that tells whether qemu can internally reopen a node read-write temporarily because the user requested read-write for the top-level image, but qemu decided that read-only is enough for this node (a backing file). bdrv_reopen() is different, it is also used for cases whe

[Qemu-block] [PULL 16/18] qemu-io: Allow reopen read-write

2017-08-08 Thread Kevin Wolf
This allows qemu-iotests to test the switch between read-only and read-write mode for block devices. Signed-off-by: Kevin Wolf Reviewed-by: Eric Blake Reviewed-by: Jeff Cody Reviewed-by: John Snow --- qemu-io-cmds.c | 19 +-- 1 file changed, 17 insertions(+), 2 deletions(-) d

[Qemu-block] [PULL 13/18] block: Fix order in bdrv_replace_child()

2017-08-08 Thread Kevin Wolf
Commit 8ee03995 refactored the code incorrectly and broke the release of permissions on the old BDS. Instead of changing the permissions to the new required values after removing the old BDS from the list of children, it only re-obtains the permissions it already had. Change the order of operation

[Qemu-block] [PULL 15/18] block: Set BDRV_O_ALLOW_RDWR during rw reopen

2017-08-08 Thread Kevin Wolf
Reopening an image should be consistent with opening it, so we should set BDRV_O_ALLOW_RDWR for any image that is reopened read-write like in bdrv_open_inherit(). Signed-off-by: Kevin Wolf Reviewed-by: Eric Blake Reviewed-by: Jeff Cody Reviewed-by: John Snow --- block.c | 5 - 1 file chan

[Qemu-block] [PULL 12/18] parallels: drop check that bdrv_truncate() is working

2017-08-08 Thread Kevin Wolf
From: "Denis V. Lunev" This would be actually strange and error prone. If truncate() nowadays will fail, there is something fatally wrong. Let's check for that during the actual work. The only fallback case is when the file is not zero initialized. In this case we should switch to preallocation

[Qemu-block] [PULL 10/18] block: respect error code from bdrv_getlength in handle_aiocb_write_zeroes

2017-08-08 Thread Kevin Wolf
From: "Denis V. Lunev" Original idea beyond the code in question was the following: we have failed to write zeroes with fallocate(FALLOC_FL_ZERO_RANGE) as the simplest approach and via fallocate(FALLOC_FL_PUNCH_HOLE)/fallocate(0). We have the only chance now: if the request comes beyond end of th

[Qemu-block] [PULL 09/18] vmdk: Fix error handling/reporting of vmdk_check

2017-08-08 Thread Kevin Wolf
From: Fam Zheng Errors from the callees must be captured and propagated to our caller, ensure this for both find_extent() and bdrv_getlength(). Reported-by: Markus Armbruster Signed-off-by: Fam Zheng Reviewed-by: Eric Blake Signed-off-by: Kevin Wolf --- block/vmdk.c | 26 ++-

[Qemu-block] [PULL 08/18] block/null: Remove 'filename' option

2017-08-08 Thread Kevin Wolf
This option was only added to allow 'null-co://' and 'null-aio://' as filenames, its value never served any actual purpose and was ignored. Nevertheless it was accepted as '-drive driver=null,filename=foo'. The correct way to enable the protocol prefixes (and that without adding a useless -drive o

[Qemu-block] [PULL 07/18] block: drop bdrv_set_key from BlockDriver

2017-08-08 Thread Kevin Wolf
From: Paolo Bonzini This is not used anymore since c01c214b69 ("block: remove all encryption handling APIs", 2017-07-11). Signed-off-by: Paolo Bonzini Reviewed-by: Stefan Hajnoczi Reviewed-by: Eric Blake Signed-off-by: Kevin Wolf --- include/block/block_int.h | 1 - 1 file changed, 1 deleti

[Qemu-block] [PULL 06/18] block/vhdx: check error return of bdrv_truncate()

2017-08-08 Thread Kevin Wolf
From: Jeff Cody Signed-off-by: Jeff Cody Reviewed-by: Eric Blake Signed-off-by: Kevin Wolf --- block/vhdx-log.c | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/block/vhdx-log.c b/block/vhdx-log.c index a27dc059cd..14b724ef7b 100644 --- a/block/vhdx-log.c +++ b/block/v

[Qemu-block] [PULL 11/18] parallels: respect error code of bdrv_getlength() in allocate_clusters()

2017-08-08 Thread Kevin Wolf
From: "Denis V. Lunev" If we can not get the file length, the state of BDS is broken completely. Return error to the caller. Signed-off-by: Denis V. Lunev CC: Markus Armbruster CC: Kevin Wolf CC: Max Reitz CC: Stefan Hajnoczi Signed-off-by: Kevin Wolf Reviewed-by: Eric Blake --- block/pa

[Qemu-block] [PULL 03/18] block/vhdx: check error return of bdrv_getlength()

2017-08-08 Thread Kevin Wolf
From: Jeff Cody Calls to bdrv_getlength() were not checking for error. In vhdx.c, this can lead to truncating an image file, so it is a definite bug. In vhdx-log.c, the path for improper behavior is less clear, but it is best to check in any case. Some minor code movement of the log_guid intia

[Qemu-block] [PULL 04/18] block/vhdx: check for offset overflow to bdrv_truncate()

2017-08-08 Thread Kevin Wolf
From: Jeff Cody VHDX uses uint64_t types for most offsets, following the VHDX spec. However, bdrv_truncate() takes an int64_t value for the truncating offset. Check for overflow before calling bdrv_truncate(). While we are here, replace the bit shifting with QEMU_ALIGN_UP as well. N.B.: For a

[Qemu-block] [PULL 05/18] block/vhdx: check error return of bdrv_flush()

2017-08-08 Thread Kevin Wolf
From: Jeff Cody Reported-by: Kevin Wolf Signed-off-by: Jeff Cody Reviewed-by: Eric Blake Signed-off-by: Kevin Wolf --- block/vhdx-log.c | 17 ++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/block/vhdx-log.c b/block/vhdx-log.c index 95972230f0..a27dc059cd 1006

[Qemu-block] [PULL 01/18] qemu-iotests/109: Fix lock race condition

2017-08-08 Thread Kevin Wolf
From: Cleber Rosa A race condition is currently present between the clean up attempt of the QEMU process and the execution of qemu-img. The actual (bad) output is: -Warning: Image size mismatch! -Images are identical. +qemu-img: Could not open '/tests/qemu-iotests/scratch/t.raw': Failed to

[Qemu-block] [PULL 00/18] Block layer patches for 2.10.0-rc2

2017-08-08 Thread Kevin Wolf
The following changes since commit b4174c4b08a719e7df7e4f35c29f44b7c2517237: Merge remote-tracking branch 'remotes/mst/tags/for_upstream' into staging (2017-08-08 10:01:49 +0100) are available in the git repository at: git://repo.or.cz/qemu/kevin.git tags/for-upstream for you to fetch chan

[Qemu-block] [PULL 02/18] quorum: Set sectors-count to 0 when reporting a flush error

2017-08-08 Thread Kevin Wolf
From: Alberto Garcia The QUORUM_REPORT_BAD event has fields to report the sector in which the error was detected and the number of affected sectors starting from that one. This is important for read and write errors, but not for flush errors. For flush errors the current code reports the total s

Re: [Qemu-block] [PATCH v4] tests: Avoid non-portable 'echo -ARG'

2017-08-08 Thread Kevin Wolf
Am 03.07.2017 um 20:09 hat Eric Blake geschrieben: > POSIX says that backslashes in the arguments to 'echo', as well as > any use of 'echo -n' and 'echo -e', are non-portable; it recommends > people should favor 'printf' instead. This is definitely true where > we do not control which shell is run

Re: [Qemu-block] [PATCH v3 for-2.10 0/4] improved --version/--help tweaks

2017-08-08 Thread Eric Blake
On 08/07/2017 07:08 PM, John Snow wrote: > > > On 08/03/2017 12:33 PM, Eric Blake wrote: >> Not sure if this should go through Kevin's block tree, Paolo's >> miscellaneous patches, or if I should just do a pull request >> myself (since patch 4 includes a change to qemu-nbd) >> > > Nothing to ke

Re: [Qemu-block] [PATCH v3 5/7] block: add throttle block filter driver

2017-08-08 Thread Manos Pitsidianakis
On Tue, Aug 08, 2017 at 03:13:36PM +0200, Alberto Garcia wrote: On Mon 31 Jul 2017 11:54:41 AM CEST, Manos Pitsidianakis wrote: block/throttle.c uses existing I/O throttle infrastructure inside a block filter driver. I/O operations are intercepted in the filter's read/write coroutines, and refer

[Qemu-block] [PATCH for-2.11 2/7] block/ssh: make compliant with coding guidelines

2017-08-08 Thread Jeff Cody
Signed-off-by: Jeff Cody --- block/ssh.c | 32 ++-- 1 file changed, 18 insertions(+), 14 deletions(-) diff --git a/block/ssh.c b/block/ssh.c index cbb0e34..97f7673 100644 --- a/block/ssh.c +++ b/block/ssh.c @@ -241,7 +241,7 @@ static int parse_uri(const char *filename

[Qemu-block] [PATCH for-2.11 4/7] block/sheepdog: code beautification

2017-08-08 Thread Jeff Cody
No functional changes, just whitespace manipulation. Signed-off-by: Jeff Cody --- block/sheepdog.c | 162 +++ 1 file changed, 81 insertions(+), 81 deletions(-) diff --git a/block/sheepdog.c b/block/sheepdog.c index bbbfa72..ad461f1 100644 ---

  1   2   >