Re: [Qemu-block] [PATCH 3/9] nbd: BLOCK_STATUS for standard get_block_status function: server part

2018-02-15 Thread Eric Blake
On 02/15/2018 07:51 AM, Vladimir Sementsov-Ogievskiy wrote: Minimal realization: only one extent in server answer is supported. Signed-off-by: Vladimir Sementsov-Ogievskiy --- include/block/nbd.h | 33 ++ nbd/common.c| 10 ++ nbd/server.c|

Re: [Qemu-block] [PATCH 2/9] nbd: change indenting in nbd.h

2018-02-15 Thread Eric Blake
On 02/15/2018 07:51 AM, Vladimir Sementsov-Ogievskiy wrote: Prepared indenting for the following patch. Signed-off-by: Vladimir Sementsov-Ogievskiy --- include/block/nbd.h | 22 +++--- 1 file changed, 11 insertions(+), 11 deletions(-) -#define

Re: [Qemu-block] [PATCH 1/9] nbd/server: add nbd_opt_invalid helper

2018-02-15 Thread Eric Blake
On 02/15/2018 07:51 AM, Vladimir Sementsov-Ogievskiy wrote: NBD_REP_ERR_INVALID is often parameter to nbd_opt_drop and it would be used more in following patches. So, let's add a helper. Signed-off-by: Vladimir Sementsov-Ogievskiy --- nbd/server.c | 50

[Qemu-block] [PATCH 5/6] ahci-test: fix opts leak of skip tests

2018-02-15 Thread Marc-André Lureau
Fixes the following ASAN report: Direct leak of 128 byte(s) in 8 object(s) allocated from: #0 0x7fefce311850 in malloc (/lib64/libasan.so.4+0xde850) #1 0x7fefcdd5ef0c in g_malloc ../glib/gmem.c:94 #2 0x559b976faff0 in create_ahci_io_test /home/elmarco/src/qemu/tests/ahci-test.c:1810

Re: [Qemu-block] [PATCH 11/27] block: x-blockdev-create QMP command

2018-02-15 Thread Eric Blake
On 02/08/2018 01:23 PM, Kevin Wolf wrote: This adds a synchronous x-blockdev-create QMP command that can create qcow2 images on a given node name. We don't want to block while creating an image, so this is not the final interface in all aspects, but BlockdevCreateOptionsQcow2 and

Re: [Qemu-block] [PATCH 10/27] qcow2: Use visitor for options in qcow2_create()

2018-02-15 Thread Eric Blake
On 02/08/2018 01:23 PM, Kevin Wolf wrote: Signed-off-by: Kevin Wolf --- block/qcow2.c | 219 - tests/qemu-iotests/049.out | 8 +- tests/qemu-iotests/112.out | 4 +- 3 files changed, 84 insertions(+), 147

Re: [Qemu-block] [PATCH 09/27] qdict: Introduce qdict_rename_keys()

2018-02-15 Thread Eric Blake
On 02/08/2018 01:23 PM, Kevin Wolf wrote: A few block drivers will need to rename .bdrv_create options for their QAPIfication, so let's have a helper function for that. Signed-off-by: Kevin Wolf --- include/qapi/qmp/qdict.h | 6 ++ qobject/qdict.c | 30

Re: [Qemu-block] [PATCH 08/27] util: Add qemu_opts_to_qdict_filtered()

2018-02-15 Thread Eric Blake
On 02/08/2018 01:23 PM, Kevin Wolf wrote: This allows, given a QemuOpts for a QemuOptsList that was merged from multiple QemuOptsList, to only consider those options that exist in one specific list. Block drivers need this to separate format-layer create options from protocol-level options.

[Qemu-block] [PATCH 5/6] vxhs: Switch to byte-based callbacks

2018-02-15 Thread Eric Blake
We are gradually moving away from sector-based interfaces, towards byte-based. Make the change for the last few sector-based callbacks in the vxhs driver. Note that the driver was already using byte-based calls for performing actual I/O, so this just gets rid of a round trip of scaling; however,

[Qemu-block] [PATCH 4/6] rbd: Switch to byte-based callbacks

2018-02-15 Thread Eric Blake
We are gradually moving away from sector-based interfaces, towards byte-based. Make the change for the last few sector-based callbacks in the rbd driver. Note that the driver was already using byte-based calls for performing actual I/O, so this just gets rid of a round trip of scaling; however,

[Qemu-block] [PATCH 2/6] file-win32: Switch to byte-based callbacks

2018-02-15 Thread Eric Blake
We are gradually moving away from sector-based interfaces, towards byte-based. Make the change for the last few sector-based callbacks in the file-win32 driver. Note that the driver was already using byte-based calls for performing actual I/O, so this just gets rid of a round trip of scaling;

[Qemu-block] [PATCH 6/6] block: Drop last of the sector-based aio callbacks

2018-02-15 Thread Eric Blake
We are gradually moving away from sector-based interfaces, towards byte-based. Now that all drivers with aio callbacks are using the byte-based interfaces, we can remove the sector-based versions. Signed-off-by: Eric Blake --- include/block/block_int.h | 6 --

[Qemu-block] [PATCH 0/6] block: byte-based AIO read/write

2018-02-15 Thread Eric Blake
While we would prefer that block drivers use coroutines instead of aio callbacks, it is a fairly easy exercise to prove that all existing drivers with aio callbacks are merely scaling from bytes into sectors and back to bytes. So, even though I am not set up to completely run (or even

[Qemu-block] [PATCH 1/6] block: Support byte-based aio callbacks

2018-02-15 Thread Eric Blake
We are gradually moving away from sector-based interfaces, towards byte-based. Add new sector-based aio callbacks for read and write, to match the fact that bdrv_aio_pdiscard is already byte-based. Ideally, drivers should be converted to use coroutine callbacks rather than aio; but that is not

[Qemu-block] [PATCH 3/6] null: Switch to byte-based read/write

2018-02-15 Thread Eric Blake
We are gradually moving away from sector-based interfaces, towards byte-based. Make the change for the last few sector-based callbacks in the null-co and null-aio drivers. Note that since the null driver does nothing on writes, it trivially supports the BDRV_REQ_FUA flag (all writes have already

Re: [Qemu-block] [PULL v2 0/3] Block patches

2018-02-15 Thread Peter Maydell
On 15 February 2018 at 09:42, Stefan Hajnoczi wrote: > The following changes since commit bec9c64ef7be8063f1192608b83877bc5c9ea217: > > Merge remote-tracking branch 'remotes/bonzini/tags/for-upstream' into > staging (2018-02-13 18:24:08 +) > > are available in the Git

Re: [Qemu-block] [Qemu-devel] semantics of FIEMAP without FIEMAP_FLAG_SYNC (was Re: [PATCH v5 13/14] nbd: Implement NBD_CMD_WRITE_ZEROES on server)

2018-02-15 Thread Paolo Bonzini
On 15/02/2018 17:40, Vladimir Sementsov-Ogievskiy wrote: > Hi all. > > Two years later, is there are any news on the topic? > > I can't understand the following thing: > >  - FIEMAP without FLAG_SYNC is unsafe >  - FIEMAP with FLAG_SYNC is safe but slow >  - so, we've dropped FIEMAP and use

Re: [Qemu-block] [Qemu-devel] semantics of FIEMAP without FIEMAP_FLAG_SYNC (was Re: [PATCH v5 13/14] nbd: Implement NBD_CMD_WRITE_ZEROES on server)

2018-02-15 Thread Vladimir Sementsov-Ogievskiy
Hi all. Two years later, is there are any news on the topic? I can't understand the following thing:  - FIEMAP without FLAG_SYNC is unsafe  - FIEMAP with FLAG_SYNC is safe but slow  - so, we've dropped FIEMAP and use only lseek. So, it means that lseek is safe _and_ fast (at least, faster

[Qemu-block] [RFC PATCH 2/2] qcow2: Check the L1 table parameters from all internal snapshots

2018-02-15 Thread Alberto Garcia
The code that reads the qcow2 snapshot table takes the offset and size of all snapshots' L1 table without doing any kind of checks. Although qcow2_snapshot_load_tmp() does verify that the table size is valid, the table offset is not checked at all. On top of that there are several other code

[Qemu-block] [RFC PATCH 0/2] Allow checking and repairing corrupted internal snapshots

2018-02-15 Thread Alberto Garcia
Here's a small series that prevents the user from opening corrupted internal snapshots and allows 'qemu-img check' to detect and repair them. This is an RFC because I tried a few different approaches to deal with this but I'm not 100% convinced with any of them. What this one does is simply

[Qemu-block] [RFC PATCH 1/2] qcow2: Allow checking and repairing corrupted internal snapshots

2018-02-15 Thread Alberto Garcia
The L1 table parameters of internal snapshots are generally not checked by QEMU. This patch allows 'qemu-img check' to detect broken snapshots and to skip them when doing the refcount consistency check. Since without an L1 table we don't have a reliable way to recover the data from the snapshot,

Re: [Qemu-block] [Qemu-devel] [PATCH 1/2] Add save-snapshot, load-snapshot and delete-snapshot to QAPI

2018-02-15 Thread Dr. David Alan Gilbert
* Denis Plotnikov (dplotni...@virtuozzo.com) wrote: > > > On 13.02.2018 18:05, Dr. David Alan Gilbert wrote: > > * Denis V. Lunev (d...@virtuozzo.com) wrote: > > > On 02/13/2018 05:59 PM, Dr. David Alan Gilbert wrote: > > > > * Daniel P. Berrangé (berra...@redhat.com) wrote: > > > > > On Tue,

Re: [Qemu-block] [Qemu-devel] [PATCH 16/30] hw/sh4: use the BYTE-based definitions

2018-02-15 Thread Philippe Mathieu-Daudé
On Thu, Feb 15, 2018 at 11:43 AM, Eric Blake wrote: > On 02/14/2018 10:28 PM, Philippe Mathieu-Daudé wrote: >> >> It ease code review, unit is explicit. > > > I noticed it here, then see it occurs throughout the series: > s/ease/eases/ in the commit message. Oops, thanks Eric

Re: [Qemu-block] [PATCH] block/ssh: fix possible segmentation fault when .desc is not null-terminated

2018-02-15 Thread Eric Blake
On 02/15/2018 08:09 AM, Murilo Opsfelder Araujo wrote: On 01/05/2018 02:57 PM, Eric Blake wrote: On 01/05/2018 08:44 AM, Murilo Opsfelder Araujo wrote: This patch prevents a possible segmentation fault when .desc members are checked against NULL. Cc: Max Reitz Cc: Eric

Re: [Qemu-block] [Qemu-devel] [PATCH 16/30] hw/sh4: use the BYTE-based definitions

2018-02-15 Thread Eric Blake
On 02/14/2018 10:28 PM, Philippe Mathieu-Daudé wrote: It ease code review, unit is explicit. I noticed it here, then see it occurs throughout the series: s/ease/eases/ in the commit message. Signed-off-by: Philippe Mathieu-Daudé --- hw/block/tc58128.c | 2 +-

Re: [Qemu-block] [Qemu-devel] [PATCH v2 8/8] qapi: query-blockstat: add driver specific file-posix stats

2018-02-15 Thread Eric Blake
On 02/15/2018 04:23 AM, Anton Nefedov wrote: The output is better indeed, thanks; a little drawback is now we need to pass the whole BlockStats to the driver so it fills its stats. e.g. the interface: void (*bdrv_get_stats)(BlockDriverState *bs, BlockStats *stats); And that

Re: [Qemu-block] [PATCH] block/ssh: fix possible segmentation fault when .desc is not null-terminated

2018-02-15 Thread Murilo Opsfelder Araujo
On 01/05/2018 02:57 PM, Eric Blake wrote: > On 01/05/2018 08:44 AM, Murilo Opsfelder Araujo wrote: >> This patch prevents a possible segmentation fault when .desc members are >> checked >> against NULL. >> >> The ssh_runtime_opts was added by commit >> 8a6a80896d6af03b8ee0c17cdf37219eca2588a7

[Qemu-block] [PATCH 0/9] nbd block status base:allocation

2018-02-15 Thread Vladimir Sementsov-Ogievskiy
Hi all. Here is minimal realization of base:allocation context of NBD block-status extension, which allows to get block status through NBD. Vladimir Sementsov-Ogievskiy (9): nbd/server: add nbd_opt_invalid helper nbd: change indenting in nbd.h nbd: BLOCK_STATUS for standard

[Qemu-block] [PATCH 7/9] iotests.py: tiny refactor: move system imports up

2018-02-15 Thread Vladimir Sementsov-Ogievskiy
Signed-off-by: Vladimir Sementsov-Ogievskiy --- tests/qemu-iotests/iotests.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tests/qemu-iotests/iotests.py b/tests/qemu-iotests/iotests.py index 1bcc9ca57d..c1302a2f9b 100644 ---

[Qemu-block] [PATCH 4/9] block/nbd-client: save first fatal error in nbd_iter_error

2018-02-15 Thread Vladimir Sementsov-Ogievskiy
It is ok, that fatal error hides previous not fatal, but hiding first fatal error is a bad feature. Signed-off-by: Vladimir Sementsov-Ogievskiy --- block/nbd-client.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/block/nbd-client.c

[Qemu-block] [PATCH 6/9] nbd: BLOCK_STATUS for standard get_block_status function: client part

2018-02-15 Thread Vladimir Sementsov-Ogievskiy
Minimal realization: only one extent in server answer is supported. Flag NBD_CMD_FLAG_REQ_ONE is used to force this behavior. Tests 140, 147 and 205 are fixed due to now server failed on searching export in context of NBD_OPT_SET_META_CONTEXT option negotiation. Signed-off-by: Vladimir

[Qemu-block] [PATCH 8/9] iotests: add file_path helper

2018-02-15 Thread Vladimir Sementsov-Ogievskiy
Simple way to have auto generated filenames with auto clenup. Like FilePath but without using 'with' statement and without additional indentation of the whole test. Signed-off-by: Vladimir Sementsov-Ogievskiy --- tests/qemu-iotests/iotests.py | 32

[Qemu-block] [PATCH 3/9] nbd: BLOCK_STATUS for standard get_block_status function: server part

2018-02-15 Thread Vladimir Sementsov-Ogievskiy
Minimal realization: only one extent in server answer is supported. Signed-off-by: Vladimir Sementsov-Ogievskiy --- include/block/nbd.h | 33 ++ nbd/common.c| 10 ++ nbd/server.c| 310 +++- 3 files

[Qemu-block] [PATCH 5/9] nbd/client: fix error messages in nbd_handle_reply_err

2018-02-15 Thread Vladimir Sementsov-Ogievskiy
1. NBD_REP_ERR_INVALID is not only about length, so, make message more general 2. hex format is not very good: it's hard to read something like "option a (set meta context)", so switch to dec. Signed-off-by: Vladimir Sementsov-Ogievskiy --- nbd/client.c | 14

[Qemu-block] [PATCH 9/9] iotests: new test 206 for NBD BLOCK_STATUS

2018-02-15 Thread Vladimir Sementsov-Ogievskiy
Signed-off-by: Vladimir Sementsov-Ogievskiy --- tests/qemu-iotests/206 | 34 ++ tests/qemu-iotests/206.out | 2 ++ tests/qemu-iotests/group | 1 + 3 files changed, 37 insertions(+) create mode 100644 tests/qemu-iotests/206

[Qemu-block] [PATCH 2/9] nbd: change indenting in nbd.h

2018-02-15 Thread Vladimir Sementsov-Ogievskiy
Prepared indenting for the following patch. Signed-off-by: Vladimir Sementsov-Ogievskiy --- include/block/nbd.h | 22 +++--- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/include/block/nbd.h b/include/block/nbd.h index

[Qemu-block] [PATCH 1/9] nbd/server: add nbd_opt_invalid helper

2018-02-15 Thread Vladimir Sementsov-Ogievskiy
NBD_REP_ERR_INVALID is often parameter to nbd_opt_drop and it would be used more in following patches. So, let's add a helper. Signed-off-by: Vladimir Sementsov-Ogievskiy --- nbd/server.c | 50 -- 1 file changed, 36

Re: [Qemu-block] [Xen-devel] [PATCH 30/30] xen: use the BYTE-based definitions

2018-02-15 Thread Alan Robinson
Hi Philippe, On Thu, Feb 15, 2018 at 09:23:52AM -0300, Philippe Mathieu-Daudé wrote: > > Can I add your R-b tag once fixed? Respin will be: > > +xenstore_write_int(dom, "memory/target", ram_size / K_BYTE); > +xenstore_write_int(vm, "memory", ram_size / M_BYTE); > +

Re: [Qemu-block] [Xen-devel] [PATCH 30/30] xen: use the BYTE-based definitions

2018-02-15 Thread Alan Robinson
Hi Philippe, On Thu, Feb 15, 2018 at 01:29:00AM -0300, Philippe Mathieu-Daudé wrote: > From: Philippe Mathieu-Daudé > Subject: [Xen-devel] [PATCH 30/30] xen: use the BYTE-based definitions > List-Id: Xen developer discussion > > It ease code review, unit is explicit. > >

[Qemu-block] [PATCH v3] qcow2: Replace align_offset() with ROUND_UP()

2018-02-15 Thread Alberto Garcia
The align_offset() function is equivalent to the ROUND_UP() macro so there's no need to use the former. The ROUND_UP() name is also a bit more explicit. This patch uses ROUND_UP() instead of the slower QEMU_ALIGN_UP() because align_offset() already requires that the second parameter is a power of

Re: [Qemu-block] [Xen-devel] [PATCH 30/30] xen: use the BYTE-based definitions

2018-02-15 Thread Philippe Mathieu-Daudé
On 02/15/2018 08:00 AM, Alan Robinson wrote: > Hi Philippe, > > On Thu, Feb 15, 2018 at 01:29:00AM -0300, Philippe Mathieu-Daudé wrote: >> From: Philippe Mathieu-Daudé >> Subject: [Xen-devel] [PATCH 30/30] xen: use the BYTE-based definitions >> List-Id: Xen developer discussion

Re: [Qemu-block] [PATCH 3/3] block/ssh: Add basic .bdrv_truncate()

2018-02-15 Thread Richard W.M. Jones
The series looks fine to me: Reviewed-by: Richard W.M. Jones Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming and virtualization blog: http://rwmj.wordpress.com virt-builder quickly builds VMs from scratch

Re: [Qemu-block] [PATCH v2 0/3] block/iscsi: fix ioctl cancel use-after-free

2018-02-15 Thread Stefan Hajnoczi
On Sat, Feb 03, 2018 at 07:16:18AM +0100, Stefan Hajnoczi wrote: > v2: > * It was unnecessary to avoid duplicate iscsi_schedule_bh() calls since this >function already protects against duplicate calls internally [Stefan] > > Patches 1 & 2 are cleanups. > > Patch 3 fixes cancellation of

Re: [Qemu-block] [Qemu-devel] [PATCH v2 8/8] qapi: query-blockstat: add driver specific file-posix stats

2018-02-15 Thread Anton Nefedov
On 12/2/2018 7:38 PM, Anton Nefedov wrote: On 3/2/2018 6:59 PM, Markus Armbruster wrote: Eric Blake writes: On 01/19/2018 06:50 AM, Anton Nefedov wrote: + +## +# @BlockDriverStats: +# +# Statistics of a block driver (driver-specific) +# +# Since: 2.12 +## +{ 'union':

Re: [Qemu-block] [Qemu-devel] [PULL 00/55] Block layer patches

2018-02-15 Thread Peter Maydell
On 13 February 2018 at 17:04, Kevin Wolf wrote: > The following changes since commit fb68096da3d35e64c88cd610c1fa42766c58e92a: > > Revert "tests: use memfd in vhost-user-test" (2018-02-13 09:51:52 +) > > are available in the git repository at: > >

Re: [Qemu-block] [RFC PATCH 0/2] s/size/entries/ when dealing with non-byte units

2018-02-15 Thread Kevin Wolf
Am 14.02.2018 um 00:33 hat Eric Blake geschrieben: > I mentioned this while reviewing Berto's series on L2 slice handling; > this is a first cut at patches that I think are worth doing throughout > the qcow2 code base if we like the idea. I agree it's a good change. While we're at it, something

[Qemu-block] [PULL v2 1/3] vl: pause vcpus before stopping iothreads

2018-02-15 Thread Stefan Hajnoczi
Commit dce8921b2baaf95974af8176406881872067adfa ("iothread: Stop threads before main() quits") introduced iothread_stop_all() to avoid the following virtio-scsi assertion failure: assert(blk_get_aio_context(d->conf.blk) == s->ctx); Back then the assertion failed because when bdrv_close_all()

[Qemu-block] [PULL v2 3/3] misc: fix spelling

2018-02-15 Thread Stefan Hajnoczi
From: Marc-André Lureau s/pupulate/populate Signed-off-by: Marc-André Lureau Reviewed-by: Peter Maydell Message-id: 20180208162447.10851-1-marcandre.lur...@redhat.com Signed-off-by: Stefan Hajnoczi

[Qemu-block] [PULL v2 0/3] Block patches

2018-02-15 Thread Stefan Hajnoczi
The following changes since commit bec9c64ef7be8063f1192608b83877bc5c9ea217: Merge remote-tracking branch 'remotes/bonzini/tags/for-upstream' into staging (2018-02-13 18:24:08 +) are available in the Git repository at: git://github.com/stefanha/qemu.git tags/block-pull-request for you

[Qemu-block] [PULL v2 2/3] ratelimit: don't align wait time with slices

2018-02-15 Thread Stefan Hajnoczi
From: Wolfgang Bumiller It is possible for rate limited writes to keep overshooting a slice's quota by a tiny amount causing the slice-aligned waiting period to effectively halve the rate. Signed-off-by: Wolfgang Bumiller Reviewed-by: Alberto

[Qemu-block] ping Re: [PATCH v10 00/12] Dirty bitmaps postcopy migration

2018-02-15 Thread Vladimir Sementsov-Ogievskiy
ping 07.02.2018 18:58, Vladimir Sementsov-Ogievskiy wrote: Hi all! There is a new version of dirty bitmap postcopy migration series. Now it is based on Max's block tree: https://github.com/XanClic/qemu/commits/block, where it needs only one patch: "block: maintain persistent disabled

[Qemu-block] ping Re: [PATCH v2 0/2] block latency histogram

2018-02-15 Thread Vladimir Sementsov-Ogievskiy
ping 07.02.2018 15:50, Vladimir Sementsov-Ogievskiy wrote: v2: 01: add block_latency_histogram_clear() 02: fix spelling (sorry =() some rewordings remove histogram if latency parameter unspecified Vladimir Sementsov-Ogievskiy (2): block/accounting: introduce latency histogram

[Qemu-block] [PATCH] hw: Do not include "sysemu/block-backend.h" if it is not necessary

2018-02-15 Thread Thomas Huth
After reviewing a patch from Philippe that removes block-backend.h from hw/lm32/milkymist.c, I noticed that this header is included unnecessarily in a lot of other files, too. Remove those unneeded includes to speed up the compilation process a little bit. Signed-off-by: Thomas Huth

Re: [Qemu-block] [RFC PATCH 0/2] s/size/entries/ when dealing with non-byte units

2018-02-15 Thread Alberto Garcia
On Wed 14 Feb 2018 12:33:22 AM CET, Eric Blake wrote: > I mentioned this while reviewing Berto's series on L2 slice handling; > this is a first cut at patches that I think are worth doing throughout > the qcow2 code base if we like the idea. > > Eric Blake (2): > qcow2: Prefer 'entries' over