[Qemu-block] [PATCH v2 4/6] nbd/server: Add va_list form of nbd_negotiate_send_rep_err()

2018-01-10 Thread Eric Blake
This will be useful for the next patch. Based on a patch by Vladimir Sementsov-Ogievskiy Signed-off-by: Eric Blake --- nbd/server.c | 24 ++-- 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/nbd/server.c b/nbd/server.c index

[Qemu-block] [PATCH v2 6/6] nbd/server: structurize option reply sending

2018-01-10 Thread Eric Blake
From: Vladimir Sementsov-Ogievskiy Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Eric Blake Message-Id: <20171122101958.17065-6-vsement...@virtuozzo.com> Signed-off-by: Eric Blake ---

[Qemu-block] [PATCH v2 5/6] nbd/server: Add helper functions for parsing option payload

2018-01-10 Thread Eric Blake
Rather than making every callsite perform length sanity checks and error reporting, add the helper functions nbd_opt_read() and nbd_opt_drop() that use the length stored in the client struct; also add an assertion that optlen is reduced to zero after each option is handled. Note that the call in

[Qemu-block] [PATCH v2 2/6] nbd/server: refactor negotiation functions parameters

2018-01-10 Thread Eric Blake
From: Vladimir Sementsov-Ogievskiy Instead of passing currently negotiating option and its length to many of negotiation functions let's just store them on NBDClient struct to be state-variables of negotiation phase. This unifies semantics of negotiation functions and

[Qemu-block] [PATCH v2 3/6] nbd/server: Better error for NBD_OPT_EXPORT_NAME failure

2018-01-10 Thread Eric Blake
When a client abruptly disconnects before we've finished reading the name sent with NBD_OPT_EXPORT_NAME, we are better off logging the failure as EIO (we can't communicate with the client), rather than EINVAL (the client sent bogus data). Signed-off-by: Eric Blake ---

[Qemu-block] [PATCH v2 0/6] NBD server refactoring before BLOCK_STATUS

2018-01-10 Thread Eric Blake
This is my promised revision of Vladimir's v1 posted here: https://lists.gnu.org/archive/html/qemu-devel/2017-11/msg04119.html Sorry for my delay; it was due in part to an embargo while dealing with 2 bounds-check CVEs in the NBD code that I discovered while reviewing his v1 (fixed in time for

[Qemu-block] [PATCH v2 1/6] nbd/server: Hoist nbd_reject_length() earlier

2018-01-10 Thread Eric Blake
No semantic change, but will make it easier for an upcoming patch to refactor code without having to add forward declarations. Signed-off-by: Eric Blake --- nbd/server.c | 56 1 file changed, 28 insertions(+), 28

[Qemu-block] [PULL 1/2] nbd/server: add additional assert to nbd_export_put

2018-01-10 Thread Eric Blake
From: Vladimir Sementsov-Ogievskiy This place is not obvious, nbd_export_close may theoretically reduce refcount to 0. It may happen if someone calls nbd_export_put on named export not through nbd_export_set_name when refcount is 1. Signed-off-by: Vladimir

[Qemu-block] [PULL 2/2] nbd: rename nbd_option and nbd_opt_reply

2018-01-10 Thread Eric Blake
From: Vladimir Sementsov-Ogievskiy Rename nbd_option and nbd_opt_reply to NBDOption and NBDOptionReply to correspond to Qemu coding style and other structures here. Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Eric Blake

Re: [Qemu-block] [Qemu-devel] [PATCH v1 1/1] block: Add numeric errno field to BLOCK_IO_ERROR events

2018-01-10 Thread Jack Schwartz
Hi Kevin. Thanks for your feedback. Looks like my team's project plans have changed, and there is no need to pursue this further.  We can work with the existing reason string.     Thanks,     Jack On 01/09/18 02:24, Kevin Wolf wrote: Am 08.01.2018 um 20:57 hat Jack Schwartz

Re: [Qemu-block] [Qemu-devel] [PATCH v4 2/9] util: Introduce vfio helpers

2018-01-10 Thread Alex Williamson
On Wed, 10 Jan 2018 17:18:39 +0800 Fam Zheng wrote: > This is a library to manage the host vfio interface, which could be used > to implement userspace device driver code in QEMU such as NVMe or net > controllers. > > Signed-off-by: Fam Zheng > --- >

Re: [Qemu-block] [PATCH v4 9/9] qapi: Add NVMe driver options to the schema

2018-01-10 Thread Stefan Hajnoczi
On Wed, Jan 10, 2018 at 05:18:46PM +0800, Fam Zheng wrote: > Signed-off-by: Fam Zheng > --- > qapi/block-core.json | 16 +++- > 1 file changed, 15 insertions(+), 1 deletion(-) Reviewed-by: Stefan Hajnoczi signature.asc Description: PGP

Re: [Qemu-block] [PATCH v4 8/9] docs: Add section for NVMe VFIO driver

2018-01-10 Thread Stefan Hajnoczi
On Wed, Jan 10, 2018 at 05:18:45PM +0800, Fam Zheng wrote: > Signed-off-by: Fam Zheng > --- > docs/qemu-block-drivers.texi | 32 > 1 file changed, 32 insertions(+) > > diff --git a/docs/qemu-block-drivers.texi b/docs/qemu-block-drivers.texi >

Re: [Qemu-block] [PATCH v4 6/9] qemu-img: Map bench buffer

2018-01-10 Thread Stefan Hajnoczi
On Wed, Jan 10, 2018 at 05:18:43PM +0800, Fam Zheng wrote: > Signed-off-by: Fam Zheng > --- > qemu-img.c | 9 - > 1 file changed, 8 insertions(+), 1 deletion(-) Reviewed-by: Stefan Hajnoczi signature.asc Description: PGP signature

Re: [Qemu-block] [PATCH v4 7/9] block: Move NVMe constants to a separate header

2018-01-10 Thread Stefan Hajnoczi
On Wed, Jan 10, 2018 at 05:18:44PM +0800, Fam Zheng wrote: > Signed-off-by: Fam Zheng > --- > block/nvme.c | 7 +- > hw/block/nvme.h | 698 +- > include/block/nvme.h | 700 >

Re: [Qemu-block] [PATCH v4 5/9] block/nvme: Implement .bdrv_(un)register_buf

2018-01-10 Thread Stefan Hajnoczi
On Wed, Jan 10, 2018 at 05:18:42PM +0800, Fam Zheng wrote: > Forward these two calls to the IOVA manager. > > Signed-off-by: Fam Zheng > --- > block/nvme.c | 24 > 1 file changed, 24 insertions(+) Reviewed-by: Stefan Hajnoczi

Re: [Qemu-block] [PATCH v4 4/9] block: Introduce buf register API

2018-01-10 Thread Stefan Hajnoczi
On Wed, Jan 10, 2018 at 05:18:41PM +0800, Fam Zheng wrote: > Allow block driver to map and unmap a buffer for later I/O, as a performance > hint. > > Signed-off-by: Fam Zheng > --- > block/block-backend.c | 10 ++ > block/io.c | 24

Re: [Qemu-block] [PATCH v4 3/9] block: Add VFIO based NVMe driver

2018-01-10 Thread Stefan Hajnoczi
On Wed, Jan 10, 2018 at 05:18:40PM +0800, Fam Zheng wrote: There are several memory and lock leaks in this patch. Please work with Paolo to get the __attribute__((cleanup(...))) patch series merged so this class of bugs can be eliminated:

Re: [Qemu-block] [Qemu-devel] [PATCH 5/5] nbd/server: structurize option reply sending

2018-01-10 Thread Eric Blake
On 11/22/2017 04:02 PM, Eric Blake wrote: > On 11/22/2017 04:19 AM, Vladimir Sementsov-Ogievskiy wrote: >> Signed-off-by: Vladimir Sementsov-Ogievskiy >> --- >> nbd/server.c | 40 +--- >> 1 file changed, 13 insertions(+), 27

Re: [Qemu-block] [Qemu-devel] [PATCH 4/5] nbd: rename nbd_option and nbd_opt_reply

2018-01-10 Thread Eric Blake
On 11/22/2017 03:56 PM, Eric Blake wrote: > On 11/22/2017 04:19 AM, Vladimir Sementsov-Ogievskiy wrote: >> Rename nbd_optino and nbd_opt_reply to NBDOption and NBDOptionReply > > s/optino/option/ > >> to correspond to Qemu coding style and other structures here. >> >> Signed-off-by: Vladimir

[Qemu-block] [PATCH 0/5 v2] preparation for Parallels Disk xml driver

2018-01-10 Thread Klim Kireev
Parallels Desktop and Parallels Cloud Server uses images glued with the bundle description in XML format. This series contains very basic description of this XML files and makes preparations for actual implementation to be followed. Signed-off-by: Edgar Kaziakhmedov

[Qemu-block] [PATCH 3/5] block/parallels: move some structures into header

2018-01-10 Thread Klim Kireev
To implement xml format, some defines and structures from parallels.c are required. Signed-off-by: Klim Kireev Reviewed-by: Vladimir Sementsov-Ogievskiy Signed-off-by: Denis V. Lunev CC: Stefan Hajnoczi

[Qemu-block] [PATCH 2/5] configure: add dependency

2018-01-10 Thread Klim Kireev
This dependency is required for adequate Parallels images support. Typically the disk consists of several images which are glued by XML disk descriptor. Also XML hides inside several important parameters which are not available in the image header. The patch also adds clause to checkpatch.pl to

[Qemu-block] [PATCH 1/5] docs/interop/prl-xml: description of Parallels Disk format

2018-01-10 Thread Klim Kireev
This patch adds main information about Parallels Disk format, which consists of DiskDescriptor.xml and other files. Signed-off-by: Edgar Kaziakhmedov Signed-off-by: Klim Kireev Signed-off-by: Vladimir Sementsov-Ogievskiy

[Qemu-block] [PATCH 5/5] block/parallels: add backing support to readv/writev

2018-01-10 Thread Klim Kireev
From: Edgar Kaziakhmedov Since parallels format supports backing files, refine readv/writev (allocate_clusters) to redirect read/write requests to a backing file (if cluster is not available in the current bs). Signed-off-by: Edgar Kaziakhmedov

[Qemu-block] [PATCH 4/5] block/parallels: replace some magic numbers

2018-01-10 Thread Klim Kireev
Signed-off-by: Klim Kireev Reviewed-by: Vladimir Sementsov-Ogievskiy Signed-off-by: Denis V. Lunev CC: Stefan Hajnoczi --- block/parallels.c | 5 +++-- block/parallels.h | 2 ++ 2 files changed, 5

Re: [Qemu-block] [PATCH v4 2/9] util: Introduce vfio helpers

2018-01-10 Thread Stefan Hajnoczi
On Wed, Jan 10, 2018 at 05:18:39PM +0800, Fam Zheng wrote: > +/* Map [host, host + size) area into a contiguous IOVA address space, and > store > + * the result in @iova if not NULL. The caller need to make sure the area is > + * aligned to page size, and mustn't overlap with existing mapping

Re: [Qemu-block] [PATCH v4 1/9] stubs: Add stubs for ram block API

2018-01-10 Thread Stefan Hajnoczi
On Wed, Jan 10, 2018 at 05:18:38PM +0800, Fam Zheng wrote: > These functions will be wanted by block-obj-y but the actual definition > is in obj-y, so stub them to keep the linker happy. > > Signed-off-by: Fam Zheng > Acked-by: Paolo Bonzini > --- >

Re: [Qemu-block] [Qemu-devel] [PATCH 0/2] qemu-img: Let "info" warn and go ahead without -U

2018-01-10 Thread Nir Soffer
On Wed, Jan 10, 2018 at 4:04 PM Kashyap Chamarthy wrote: > On Mon, Jan 08, 2018 at 03:41:36PM +0100, Kevin Wolf wrote: > > Am 05.01.2018 um 07:55 hat Fam Zheng geschrieben: > > > Management and users are accustomed to "qemu-img info" to query status > of > > > images even

Re: [Qemu-block] [PATCH v2 1/6] nbd/server: add additional assert to nbd_export_put

2018-01-10 Thread Eric Blake
On 12/07/2017 09:50 AM, Vladimir Sementsov-Ogievskiy wrote: > This place is not obvious, nbd_export_close may theoretically reduce > refcount to 0. It may happen if someone calls nbd_export_put on named > export not through nbd_export_set_name when refcount is 1. > > Signed-off-by: Vladimir

Re: [Qemu-block] [PATCH 1/5] docs/interop/prl-xml: description of Parallels Disk format

2018-01-10 Thread klim
On 01/04/2018 02:34 PM, Stefan Hajnoczi wrote: On Mon, Dec 18, 2017 at 02:09:07PM +0300, Denis V. Lunev wrote: From: Klim Kireev This patch adds main information about Parallels Disk format, which consists of DiskDescriptor.xml and other files. Signed-off-by: Edgar

Re: [Qemu-block] [PATCH v2 2/6] qapi: add name parameter to nbd-server-add

2018-01-10 Thread Dr. David Alan Gilbert
* Eric Blake (ebl...@redhat.com) wrote: > On 12/08/2017 11:33 AM, Dr. David Alan Gilbert wrote: > > >> @@ -2223,7 +2224,7 @@ void hmp_nbd_server_add(Monitor *mon, const QDict > >> *qdict) > >> bool writable = qdict_get_try_bool(qdict, "writable", false); > >> Error *local_err = NULL; >

Re: [Qemu-block] [Qemu-devel] [PATCH 2/5] configure: add dependency

2018-01-10 Thread Daniel P. Berrange
On Fri, Dec 22, 2017 at 03:38:02PM +0300, Roman Kagan wrote: > On Mon, Dec 18, 2017 at 02:09:08PM +0300, Denis V. Lunev wrote: > > From: Klim Kireev > > > > This dependency is required for adequate Parallels images support. > > Typically the disk consists of several

Re: [Qemu-block] [Qemu-devel] qemu 2.9.0 qcow2 file failed to open after hard server reset

2018-01-10 Thread John Snow
On 12/27/2017 04:47 PM, Vasiliy Tolstov wrote: > 2017-12-22 1:58 GMT+03:00 John Snow : >> >> >> On 12/21/2017 05:13 PM, Vasiliy Tolstov wrote: >>> Hi! Today my server have forced reboot and one of my vm can't start >>> with message: >>> qcow2: Marking image as corrupt: L2 table

Re: [Qemu-block] [PATCH 2/5] configure: add dependency

2018-01-10 Thread klim
On 12/22/2017 03:38 PM, Roman Kagan wrote: On Mon, Dec 18, 2017 at 02:09:08PM +0300, Denis V. Lunev wrote: From: Klim Kireev This dependency is required for adequate Parallels images support. Typically the disk consists of several images which are glued by XML disk

Re: [Qemu-block] [PATCH v4 3/9] block: Add VFIO based NVMe driver

2018-01-10 Thread Paolo Bonzini
On 10/01/2018 15:43, Eric Blake wrote: > On 01/10/2018 03:18 AM, Fam Zheng wrote: >> This is a new protocol driver that exclusively opens a host NVMe >> controller through VFIO. It achieves better latency than linux-aio by >> completely bypassing host kernel vfs/block layer. >> >>

Re: [Qemu-block] [PATCH v4 3/9] block: Add VFIO based NVMe driver

2018-01-10 Thread Eric Blake
On 01/10/2018 03:18 AM, Fam Zheng wrote: > This is a new protocol driver that exclusively opens a host NVMe > controller through VFIO. It achieves better latency than linux-aio by > completely bypassing host kernel vfs/block layer. > > +static BlockDriver bdrv_nvme = { > +.format_name

Re: [Qemu-block] [PATCH v4 3/9] block: Add VFIO based NVMe driver

2018-01-10 Thread Eric Blake
On 01/10/2018 03:18 AM, Fam Zheng wrote: > This is a new protocol driver that exclusively opens a host NVMe > controller through VFIO. It achieves better latency than linux-aio by > completely bypassing host kernel vfs/block layer. > > $rw-$bs-$iodepth linux-aio nvme:// >

Re: [Qemu-block] [PATCH v4 9/9] qapi: Add NVMe driver options to the schema

2018-01-10 Thread Eric Blake
On 01/10/2018 03:18 AM, Fam Zheng wrote: > Signed-off-by: Fam Zheng > --- > qapi/block-core.json | 16 +++- > 1 file changed, 15 insertions(+), 1 deletion(-) > > diff --git a/qapi/block-core.json b/qapi/block-core.json > index e94a6881b2..fd6c94454d 100644 > ---

Re: [Qemu-block] [PATCH] block/iscsi: fix initialization of iTask in iscsi_co_get_block_status

2018-01-10 Thread Paolo Bonzini
On 08/01/2018 16:27, Peter Lieven wrote: > in case of unaligned requests or on a target that does not support > block provisioning we leave iTask uninitialized and check iTask.task > for NULL later. > > Fixes: e38bc23454ef763deb4405ebdee6a1081aa00bc8 > Cc: qemu-sta...@nongnu.org > Signed-off-by:

Re: [Qemu-block] [Qemu-devel] [PATCH 0/2] qemu-img: Let "info" warn and go ahead without -U

2018-01-10 Thread Daniel P. Berrange
On Wed, Jan 10, 2018 at 03:07:12PM +0100, Kevin Wolf wrote: > Am 10.01.2018 um 13:49 hat Daniel P. Berrange geschrieben: > > On Mon, Jan 08, 2018 at 03:41:36PM +0100, Kevin Wolf wrote: > > > Am 05.01.2018 um 07:55 hat Fam Zheng geschrieben: > > > > Management and users are accustomed to "qemu-img

Re: [Qemu-block] [Qemu-devel] [PATCH 0/2] qemu-img: Let "info" warn and go ahead without -U

2018-01-10 Thread Kevin Wolf
Am 10.01.2018 um 13:49 hat Daniel P. Berrange geschrieben: > On Mon, Jan 08, 2018 at 03:41:36PM +0100, Kevin Wolf wrote: > > Am 05.01.2018 um 07:55 hat Fam Zheng geschrieben: > > > Management and users are accustomed to "qemu-img info" to query status of > > > images even when they are used by

Re: [Qemu-block] [Qemu-devel] [PATCH 0/2] qemu-img: Let "info" warn and go ahead without -U

2018-01-10 Thread Kashyap Chamarthy
On Mon, Jan 08, 2018 at 03:41:36PM +0100, Kevin Wolf wrote: > Am 05.01.2018 um 07:55 hat Fam Zheng geschrieben: > > Management and users are accustomed to "qemu-img info" to query status of > > images even when they are used by guests. Since image locking was added, > > the -U > > (--force-share)

Re: [Qemu-block] [PATCH v2 2/3] qcow2: handle reopening bitmaps on bdrv_invalidate_cache

2018-01-10 Thread Vladimir Sementsov-Ogievskiy
22.12.2017 19:28, Kevin Wolf wrote: Am 22.12.2017 um 17:12 hat Vladimir Sementsov-Ogievskiy geschrieben: 22.12.2017 18:43, Kevin Wolf wrote: Am 22.12.2017 um 15:25 hat Vladimir Sementsov-Ogievskiy geschrieben: 22.12.2017 16:39, Kevin Wolf wrote: Am 12.12.2017 um 17:04 hat Vladimir

Re: [Qemu-block] [Qemu-devel] [PATCH 0/2] qemu-img: Let "info" warn and go ahead without -U

2018-01-10 Thread Daniel P. Berrange
On Mon, Jan 08, 2018 at 06:57:29PM +0100, Kevin Wolf wrote: > Am 08.01.2018 um 18:07 hat Nir Soffer geschrieben: > > On Mon, Jan 8, 2018 at 4:48 PM Kevin Wolf wrote: > > > > > Am 05.01.2018 um 07:55 hat Fam Zheng geschrieben: > > > > Management and users are accustomed to

Re: [Qemu-block] [Qemu-devel] [PATCH 0/2] qemu-img: Let "info" warn and go ahead without -U

2018-01-10 Thread Daniel P. Berrange
On Mon, Jan 08, 2018 at 03:41:36PM +0100, Kevin Wolf wrote: > Am 05.01.2018 um 07:55 hat Fam Zheng geschrieben: > > Management and users are accustomed to "qemu-img info" to query status of > > images even when they are used by guests. Since image locking was added, > > the -U > > (--force-share)

[Qemu-block] [PATCH v4 5/9] block/nvme: Implement .bdrv_(un)register_buf

2018-01-10 Thread Fam Zheng
Forward these two calls to the IOVA manager. Signed-off-by: Fam Zheng --- block/nvme.c | 24 1 file changed, 24 insertions(+) diff --git a/block/nvme.c b/block/nvme.c index 5162272e5b..7042743929 100644 --- a/block/nvme.c +++ b/block/nvme.c @@ -1089,6

[Qemu-block] [PATCH v4 9/9] qapi: Add NVMe driver options to the schema

2018-01-10 Thread Fam Zheng
Signed-off-by: Fam Zheng --- qapi/block-core.json | 16 +++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/qapi/block-core.json b/qapi/block-core.json index e94a6881b2..fd6c94454d 100644 --- a/qapi/block-core.json +++ b/qapi/block-core.json @@ -2237,7

[Qemu-block] [PATCH v4 6/9] qemu-img: Map bench buffer

2018-01-10 Thread Fam Zheng
Signed-off-by: Fam Zheng --- qemu-img.c | 9 - 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/qemu-img.c b/qemu-img.c index 68b375f998..28d0e4e9f8 100644 --- a/qemu-img.c +++ b/qemu-img.c @@ -3862,6 +3862,7 @@ static int img_bench(int argc, char **argv)

[Qemu-block] [PATCH v4 8/9] docs: Add section for NVMe VFIO driver

2018-01-10 Thread Fam Zheng
Signed-off-by: Fam Zheng --- docs/qemu-block-drivers.texi | 32 1 file changed, 32 insertions(+) diff --git a/docs/qemu-block-drivers.texi b/docs/qemu-block-drivers.texi index 503c1847aa..66b27cc4f7 100644 --- a/docs/qemu-block-drivers.texi +++

[Qemu-block] [PATCH v4 7/9] block: Move NVMe constants to a separate header

2018-01-10 Thread Fam Zheng
Signed-off-by: Fam Zheng --- block/nvme.c | 7 +- hw/block/nvme.h | 698 +- include/block/nvme.h | 700 +++ 3 files changed, 702 insertions(+), 703 deletions(-) create

[Qemu-block] [PATCH v4 4/9] block: Introduce buf register API

2018-01-10 Thread Fam Zheng
Allow block driver to map and unmap a buffer for later I/O, as a performance hint. Signed-off-by: Fam Zheng --- block/block-backend.c | 10 ++ block/io.c | 24 include/block/block.h | 11 ++-

[Qemu-block] [PATCH v4 2/9] util: Introduce vfio helpers

2018-01-10 Thread Fam Zheng
This is a library to manage the host vfio interface, which could be used to implement userspace device driver code in QEMU such as NVMe or net controllers. Signed-off-by: Fam Zheng --- include/qemu/vfio-helpers.h | 30 ++ util/Makefile.objs | 1 + util/trace-events

[Qemu-block] [PATCH v4 1/9] stubs: Add stubs for ram block API

2018-01-10 Thread Fam Zheng
These functions will be wanted by block-obj-y but the actual definition is in obj-y, so stub them to keep the linker happy. Signed-off-by: Fam Zheng Acked-by: Paolo Bonzini --- stubs/Makefile.objs | 1 + stubs/ram-block.c | 16 2 files

[Qemu-block] [PATCH v4 3/9] block: Add VFIO based NVMe driver

2018-01-10 Thread Fam Zheng
This is a new protocol driver that exclusively opens a host NVMe controller through VFIO. It achieves better latency than linux-aio by completely bypassing host kernel vfs/block layer. $rw-$bs-$iodepth linux-aio nvme:// randread-4k-1

[Qemu-block] [PATCH v4 0/9] block: Add VFIO based driver for NVMe device

2018-01-10 Thread Fam Zheng
v4: - Rebase, address Stefan's comments. - Add QAPI and doc patches. v3: Rebase, small tweaks/fixes and add locks to provide basic thread safety (basic because it is not really tested). v2: - Implement "split vfio addr space" appraoch. [Paolo] - Add back 'device reset' in