[Qemu-block] [PATCH v2 11/54] quorum: use qapi_enum_parse() in quorum_open

2017-08-22 Thread Marc-André Lureau
Signed-off-by: Marc-André Lureau --- block/quorum.c | 27 --- 1 file changed, 8 insertions(+), 19 deletions(-) diff --git a/block/quorum.c b/block/quorum.c index d04da4f430..e4271caa7a 100644 --- a/block/quorum.c +++ b/block/quorum.c @@ -22,6

[Qemu-block] [PATCH v2 06/54] qapi: introduce qapi_enum_lookup()

2017-08-22 Thread Marc-André Lureau
This will help with the introduction of a new structure to handle enum lookup. Signed-off-by: Marc-André Lureau --- include/qapi/util.h | 2 + backends/hostmem.c | 3 +- block/backup.c | 3 +-

[Qemu-block] [PATCH v2 12/54] qapi: change enum lookup structure

2017-08-22 Thread Marc-André Lureau
Store the length in the lookup table, i.e. change it from const char *const[] to struct { int n, const char *const s[] }. The following conditional enum entry change will create "hole" elements in the generated lookup array, that should be skipped. Signed-off-by: Marc-André Lureau

[Qemu-block] [PATCH v2 13/54] qapi: drop the sentinel in enum array

2017-08-22 Thread Marc-André Lureau
Now that all usages have been converted to user lookup helpers. Signed-off-by: Marc-André Lureau --- scripts/qapi.py | 1 - block/parallels.c | 1 - ui/input-legacy.c | 2 +- 3 files changed, 1 insertion(+), 3 deletions(-) diff --git a/scripts/qapi.py

Re: [Qemu-block] [Qemu-devel] [PATCH 03/10] scsi: introduce scsi_build_sense

2017-08-22 Thread Philippe Mathieu-Daudé
On 08/22/2017 10:18 AM, Paolo Bonzini wrote: Move more knowledge of sense data format out of hw/scsi/scsi-bus.c for reusability. Signed-off-by: Paolo Bonzini Reviewed-by: Philippe Mathieu-Daudé --- hw/scsi/scsi-bus.c | 8 +---

Re: [Qemu-block] [Qemu-devel] [PATCH 02/10] scsi: move non-emulation specific code to scsi/

2017-08-22 Thread Philippe Mathieu-Daudé
On 08/22/2017 10:18 AM, Paolo Bonzini wrote: There is a bunch of SCSI code that is shared by block/iscsi.c and hw/scsi, and the introduction of the persistent reservation helper will add more instances of this. There is also include/block/scsi.h, which actually is not part of the core block

[Qemu-block] [PATCH for-2.10-rc4?] acpi: pcihp: fix use-after-free for machines previous pc-1.7 compat

2017-08-22 Thread Philippe Mathieu-Daudé
9e047b982452 "piix4: add acpi pci hotplug support" introduced a new property 'use_acpi_pci_hotplug' for pc-1.7 and older machines. c24d5e0b91d1 "convert ACPI PCI hotplug to use hotplug-handler API" added the qbus hotplug handlers but forgot to check for the 'use_acpi_pci_hotplug' property. Check

Re: [Qemu-block] [PATCH for-2.10-rc4?] acpi: pcihp: fix use-after-free for machines previous pc-1.7 compat

2017-08-22 Thread Michael S. Tsirkin
On Tue, Aug 22, 2017 at 06:43:43PM -0300, Philippe Mathieu-Daudé wrote: > 9e047b982452 "piix4: add acpi pci hotplug support" introduced a new property > 'use_acpi_pci_hotplug' for pc-1.7 and older machines. > c24d5e0b91d1 "convert ACPI PCI hotplug to use hotplug-handler API" added the > qbus

Re: [Qemu-block] [PATCH for-2.10-rc4?] acpi: pcihp: fix use-after-free for machines previous pc-1.7 compat

2017-08-22 Thread Philippe Mathieu-Daudé
On 08/22/2017 07:42 PM, Michael S. Tsirkin wrote: On Tue, Aug 22, 2017 at 06:43:43PM -0300, Philippe Mathieu-Daudé wrote: 9e047b982452 "piix4: add acpi pci hotplug support" introduced a new property 'use_acpi_pci_hotplug' for pc-1.7 and older machines. c24d5e0b91d1 "convert ACPI PCI hotplug to

Re: [Qemu-block] [PATCH v7 4/6] block: convert ThrottleGroup to object with QOM

2017-08-22 Thread Manos Pitsidianakis
On Tue, Aug 22, 2017 at 03:25:41PM +0200, Alberto Garcia wrote: +/* This function edits throttle_groups and must be called under the global + * mutex */ +static void throttle_group_obj_complete(UserCreatable *obj, Error **errp) +{ +ThrottleGroup *tg = THROTTLE_GROUP(obj); +ThrottleConfig

Re: [Qemu-block] [PATCH v2 11/54] quorum: use qapi_enum_parse() in quorum_open

2017-08-22 Thread Alberto Garcia
On Tue 22 Aug 2017 03:22:12 PM CEST, Marc-André Lureau wrote: > @@ -925,7 +908,13 @@ static int quorum_open(BlockDriverState *bs, QDict > *options, int flags, > goto exit; > } > > -ret = parse_read_pattern(qemu_opt_get(opts, QUORUM_OPT_READ_PATTERN)); > +if

Re: [Qemu-block] [Qemu-devel] [RFC PATCH 04/56] char: Make ringbuf-read size unsigned in QAPI/QMP

2017-08-22 Thread Marc-André Lureau
Hi On Tue, Aug 22, 2017 at 3:00 PM, Markus Armbruster wrote: > Marc-André Lureau writes: > >> Hi >> >> On Mon, Aug 7, 2017 at 4:45 PM, Markus Armbruster wrote: >>> Sizes should use QAPI type 'size' (uint64_t). ringbuf-read

Re: [Qemu-block] [Qemu-devel] [RFC PATCH 12/56] pc-dimm: Make size and address unsigned in QAPI/QMP

2017-08-22 Thread Markus Armbruster
Igor Mammedov writes: > On Tue, 22 Aug 2017 15:50:14 +0200 > Markus Armbruster wrote: > >> Igor Mammedov writes: >> >> > On Mon, 7 Aug 2017 16:45:16 +0200 >> > Markus Armbruster wrote: >> > >> >> Sizes and

Re: [Qemu-block] [Qemu-devel] [RFC PATCH 00/10] scsi, block: introduce persistent reservation managers

2017-08-22 Thread no-reply
Hi, This series failed build test on FreeBSD host. Please find the details below. Message-id: 20170822131832.20191-1-pbonz...@redhat.com Type: series Subject: [Qemu-devel] [RFC PATCH 00/10] scsi, block: introduce persistent reservation managers === TEST SCRIPT BEGIN === #!/bin/sh # Testing

Re: [Qemu-block] [Qemu-devel] [RFC PATCH 04/56] char: Make ringbuf-read size unsigned in QAPI/QMP

2017-08-22 Thread Markus Armbruster
Marc-André Lureau writes: > Hi > > On Tue, Aug 22, 2017 at 3:00 PM, Markus Armbruster wrote: >> Marc-André Lureau writes: >> >>> Hi >>> >>> On Mon, Aug 7, 2017 at 4:45 PM, Markus Armbruster wrote:

Re: [Qemu-block] [Qemu-devel] [PATCH 04/10] scsi: introduce sg_io_sense_from_errno

2017-08-22 Thread Paolo Bonzini
On 22/08/2017 15:45, Philippe Mathieu-Daudé wrote: > Hi Paolo, > > On 08/22/2017 10:18 AM, Paolo Bonzini wrote: >> Move more knowledge of SG_IO out of hw/scsi/scsi-generic.c, for >> reusability. >> >> Signed-off-by: Paolo Bonzini >> --- >> hw/scsi/scsi-generic.c | 40

Re: [Qemu-block] [Qemu-devel] [PATCH 08/10] scsi: build qemu-pr-helper

2017-08-22 Thread Marc-André Lureau
Hi On Tue, Aug 22, 2017 at 3:18 PM, Paolo Bonzini wrote: > Introduce a privileged helper to run persistent reservation commands. > This lets virtual machines send persistent reservations without using > CAP_SYS_RAWIO or out-of-tree patches. The helper uses Unix permissions

Re: [Qemu-block] [PATCH v7 5/6] block: add throttle block filter driver

2017-08-22 Thread Manos Pitsidianakis
On Tue, Aug 22, 2017 at 04:16:26PM +0200, Alberto Garcia wrote: On Tue 22 Aug 2017 12:15:34 PM CEST, Manos Pitsidianakis wrote: @@ -548,6 +548,11 @@ void throttle_group_unregister_tgm(ThrottleGroupMember *tgm) ThrottleGroupMember *token; int i; +if (!ts) { +/* Discard

Re: [Qemu-block] [Qemu-devel] [PATCH 08/10] scsi: build qemu-pr-helper

2017-08-22 Thread Paolo Bonzini
On 22/08/2017 16:34, Marc-André Lureau wrote: > Could this be handled by udisk? It seems at first the problem is not > specific to qemu. Yes, possibly. In practice, everybody else who uses persistent reservations seems to run as root. :) >> +static void usage(const char *name) >> +{ >> +

Re: [Qemu-block] [Qemu-devel] [PATCH 05/10] scsi: move block/scsi.h to include/scsi/constants.h

2017-08-22 Thread Philippe Mathieu-Daudé
On 08/22/2017 10:18 AM, Paolo Bonzini wrote: Complete the transition by renaming this header, which was shared by block/iscsi.c and the SCSI emulation code. Signed-off-by: Paolo Bonzini Reviewed-by: Philippe Mathieu-Daudé --- block/iscsi.c

Re: [Qemu-block] [Qemu-devel] [RFC PATCH 00/10] scsi, block: introduce persistent reservation managers

2017-08-22 Thread no-reply
Hi, This series failed build test on s390x host. Please find the details below. Message-id: 20170822131832.20191-1-pbonz...@redhat.com Type: series Subject: [Qemu-devel] [RFC PATCH 00/10] scsi, block: introduce persistent reservation managers === TEST SCRIPT BEGIN === #!/bin/bash # Testing

Re: [Qemu-block] [Qemu-devel] [RFC PATCH 00/10] scsi, block: introduce persistent reservation managers

2017-08-22 Thread no-reply
Hi, This series seems to have some coding style problems. See output below for more information: Type: series Message-id: 20170822131832.20191-1-pbonz...@redhat.com Subject: [Qemu-devel] [RFC PATCH 00/10] scsi, block: introduce persistent reservation managers === TEST SCRIPT BEGIN ===

Re: [Qemu-block] [Qemu-devel] [PATCH 04/10] scsi: introduce sg_io_sense_from_errno

2017-08-22 Thread Philippe Mathieu-Daudé
Hi Paolo, On 08/22/2017 10:18 AM, Paolo Bonzini wrote: Move more knowledge of SG_IO out of hw/scsi/scsi-generic.c, for reusability. Signed-off-by: Paolo Bonzini --- hw/scsi/scsi-generic.c | 40 +++- include/scsi/utils.h | 3 +++

Re: [Qemu-block] [Qemu-devel] [PATCH v7 0/4] Add shrink image for qcow2

2017-08-22 Thread Max Reitz
On 2017-08-22 01:31, John Snow wrote: > > > On 08/17/2017 05:15 AM, Pavel Butsykin wrote: >> This patch add shrinking of the image file for qcow2. As a result, this >> allows >> us to reduce the virtual image size and free up space on the disk without >> copying the image. Image can be

Re: [Qemu-block] [Qemu-devel] [PATCH 01/10] scsi: rename scsi_convert_sense

2017-08-22 Thread Philippe Mathieu-Daudé
On 08/22/2017 10:18 AM, Paolo Bonzini wrote: After introducing the scsi/ subdirectory, there will be a scsi_build_sense function that is the same as scsi_req_build_sense but without needing a SCSIRequest. The existing scsi_build_sense function gets in the way, remove it. Signed-off-by: Paolo

Re: [Qemu-block] [PATCH v7 5/6] block: add throttle block filter driver

2017-08-22 Thread Alberto Garcia
On Tue 22 Aug 2017 12:15:34 PM CEST, Manos Pitsidianakis wrote: > ## > +# @BlockdevOptionsThrottle: > +# > +# Driver specific block device options for the throttle driver > +# > +# @throttle-group: the name of the throttle-group object to use. It > +#must already exist. > +#

Re: [Qemu-block] [PATCH] nbd-client: avoid spurious qio_channel_yield() re-entry

2017-08-22 Thread Dr. David Alan Gilbert
* Stefan Hajnoczi (stefa...@redhat.com) wrote: > The following scenario leads to an assertion failure in > qio_channel_yield(): > > 1. Request coroutine calls qio_channel_yield() successfully when sending >would block on the socket. It is now yielded. > 2. nbd_read_reply_entry() calls

Re: [Qemu-block] [Qemu-devel] [RFC PATCH 00/10] scsi, block: introduce persistent reservation managers

2017-08-22 Thread no-reply
Hi, This series failed automatic build test. Please find the testing commands and their output below. If you have docker installed, you can probably reproduce it locally. Type: series Message-id: 20170822131832.20191-1-pbonz...@redhat.com Subject: [Qemu-devel] [RFC PATCH 00/10] scsi, block:

Re: [Qemu-block] [Qemu-devel] [RFC PATCH 12/56] pc-dimm: Make size and address unsigned in QAPI/QMP

2017-08-22 Thread Markus Armbruster
Igor Mammedov writes: > On Mon, 7 Aug 2017 16:45:16 +0200 > Markus Armbruster wrote: > >> Sizes and addresses should use QAPI type 'size' (uint64_t). >> PCDIMMDeviceInfo members @addr and @size are 'int' (int64_t). >> qmp_pc_dimm_device_list() implicitly

Re: [Qemu-block] [RFC PATCH 13/56] pci: Make PCI addresses and sizes unsigned in QAPI/QMP

2017-08-22 Thread Marcel Apfelbaum
Hi Markus, On 07/08/2017 17:45, Markus Armbruster wrote: Sizes and addresses should use QAPI type 'size' (uint64_t). PciMemoryRegion members @address and @size are 'int' (int64_t). qmp_query_pci_regions() implicitly converts from pcibus_t, i.e. uint64_t. Change these PciMemoryRegion members to

Re: [Qemu-block] [Qemu-devel] [RFC PATCH 12/56] pc-dimm: Make size and address unsigned in QAPI/QMP

2017-08-22 Thread Igor Mammedov
On Tue, 22 Aug 2017 15:50:14 +0200 Markus Armbruster wrote: > Igor Mammedov writes: > > > On Mon, 7 Aug 2017 16:45:16 +0200 > > Markus Armbruster wrote: > > > >> Sizes and addresses should use QAPI type 'size' (uint64_t). > >>

Re: [Qemu-block] [Qemu-devel] [PATCH] nbd-client: fix hang after server closes connection

2017-08-22 Thread Philippe Mathieu-Daudé
On 08/21/2017 01:15 PM, Stefan Hajnoczi wrote: Commit 72b6ffc76653214b69a94a7b1643ff80df134486 ("nbd-client: Fix regression when server sends garbage") improved NBD client behavior when the connection enters a broken state. The following still does not behave as expected: $ qemu-nbd -p 1234

Re: [Qemu-block] [Qemu-devel] [PATCH v2 06/54] qapi: introduce qapi_enum_lookup()

2017-08-22 Thread John Snow
On 08/22/2017 09:22 AM, Marc-André Lureau wrote: > This will help with the introduction of a new structure to handle > enum lookup. > Procedurally for the sake of review, it's a little odd to introduce the function, deploy it, and then change it and update all callers. content-wise, I'm

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

2017-08-22 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 >>

[Qemu-block] Use after free problem somewhere in ahci.c or ich.c code

2017-08-22 Thread Thomas Huth
Hi! Looks like there is a use-after-free problem somewhere in the ahci.c or ich.c code when trying to add the ich9-ahci on a old PC machine. Using valgrind, I get: $ valgrind x86_64-softmmu/qemu-system-x86_64 -M pc-1.2 -nographic -S ==6604== Memcheck, a memory error detector ==6604== Copyright

Re: [Qemu-block] [Qemu-devel] Use after free problem somewhere in ahci.c or ich.c code

2017-08-22 Thread John Snow
On 08/22/2017 02:15 PM, Thomas Huth wrote: > > Hi! > > Looks like there is a use-after-free problem somewhere in > the ahci.c or ich.c code when trying to add the ich9-ahci > on a old PC machine. Using valgrind, I get: > I'll look; it looks like it works okay for pc-i440fx-2.9 as well as

[Qemu-block] Persistent bitmaps for non-qcow2 formats

2017-08-22 Thread John Snow
Well, we knew we'd want this sooner or later. I've got some pings downstream over whether or not we support persistent bitmaps for non-qcow2 formats. Currently: no, we don't. We tried two different ideas for storage agnostic bitmap persistence: (1) Using qcow2 as a storage container format

Re: [Qemu-block] [PATCH 09/10] scsi: add multipath support to qemu-pr-helper

2017-08-22 Thread Fam Zheng
On Tue, 08/22 15:18, Paolo Bonzini wrote: > Proper support of persistent reservation for multipath devices requires > communication with the multipath daemon, so that the reservation is > registered and applied when a path comes up. The device mapper > utilities provide a library to do so; this

Re: [Qemu-block] [PATCH 06/10] scsi, file-posix: add support for persistent reservation management

2017-08-22 Thread Fam Zheng
On Tue, 08/22 15:18, Paolo Bonzini wrote: > diff --git a/docs/pr-manager.rst b/docs/pr-manager.rst Is docs/interop/persistent-reservation-manager.rst better? (Move to interop/ and de-abbreviate) ... > new file mode 100644 > index 00..b6089fb57c > --- /dev/null > +++ b/docs/pr-manager.rst

Re: [Qemu-block] [PATCH 07/10] io: add qio_channel_read/write_all

2017-08-22 Thread Fam Zheng
On Tue, 08/22 15:18, Paolo Bonzini wrote: > It is pretty common to read a fixed-size buffer from a socket. Add a > function that does this, either with multiple reads (on blocking sockets) > or by yielding if called from a coroutine. > > Cc: Daniel P. Berrange >

Re: [Qemu-block] [PATCH 10/10] scsi: add persistent reservation manager using qemu-pr-helper

2017-08-22 Thread Fam Zheng
On Tue, 08/22 15:18, Paolo Bonzini wrote: > This adds a concrete subclass of pr-manager that talks to qemu-pr-helper. > > Signed-off-by: Paolo Bonzini > --- > scsi/Makefile.objs | 2 +- > scsi/pr-manager-helper.c | 288 >

Re: [Qemu-block] [PATCH for-2.10-rc4?] acpi: pcihp: fix use-after-free for machines previous pc-1.7 compat

2017-08-22 Thread Thomas Huth
On 23.08.2017 02:10, Philippe Mathieu-Daudé wrote: > On 08/22/2017 07:42 PM, Michael S. Tsirkin wrote: >> On Tue, Aug 22, 2017 at 06:43:43PM -0300, Philippe Mathieu-Daudé wrote: >>> 9e047b982452 "piix4: add acpi pci hotplug support" introduced a new >>> property >>> 'use_acpi_pci_hotplug' for

Re: [Qemu-block] [Qemu-devel] Use after free problem somewhere in ahci.c or ich.c code

2017-08-22 Thread Philippe Mathieu-Daudé
On 08/22/2017 03:39 PM, John Snow wrote: On 08/22/2017 02:15 PM, Thomas Huth wrote: Looks like there is a use-after-free problem somewhere in the ahci.c or ich.c code when trying to add the ich9-ahci on a old PC machine. Using valgrind, I get: those old PC don't support AHCI hotplug, so

Re: [Qemu-block] [Qemu-devel] Use after free problem somewhere in ahci.c or ich.c code

2017-08-22 Thread John Snow
On 08/22/2017 05:02 PM, Philippe Mathieu-Daudé wrote: > On 08/22/2017 03:39 PM, John Snow wrote: >> On 08/22/2017 02:15 PM, Thomas Huth wrote: >>> >>> Looks like there is a use-after-free problem somewhere in >>> the ahci.c or ich.c code when trying to add the ich9-ahci >>> on a old PC machine.

[Qemu-block] [PATCH v7 2/6] block: add aio_context field in ThrottleGroupMember

2017-08-22 Thread Manos Pitsidianakis
timer_cb() needs to know about the current Aio context of the throttle request that is woken up. In order to make ThrottleGroupMember backend agnostic, this information is stored in an aio_context field instead of accessing it from BlockBackend. Reviewed-by: Alberto Garcia

[Qemu-block] [PATCH v7 0/6] add throttle block driver filter

2017-08-22 Thread Manos Pitsidianakis
This series adds a throttle block driver filter. Currently throttling is done at the BlockBackend level. Using block driver interfaces we can move the throttling to any point in the BDS graph using a throttle node which uses the existing throttling code. This allows for potentially more complex

[Qemu-block] [PATCH v7 3/6] block: tidy ThrottleGroupMember initializations

2017-08-22 Thread Manos Pitsidianakis
Move the CoMutex and CoQueue inits inside throttle_group_register_tgm() which is called whenever a ThrottleGroupMember is initialized. There's no need for them to be separate. Reviewed-by: Alberto Garcia Reviewed-by: Stefan Hajnoczi Signed-off-by: Manos

[Qemu-block] [PATCH v7 5/6] block: add throttle block filter driver

2017-08-22 Thread Manos Pitsidianakis
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 referred to block/throttle-groups.c The driver can be used with the syntax -drive

Re: [Qemu-block] [PATCH v2 3/6] block: require job-id when device is a node name

2017-08-22 Thread Alberto Garcia
On Tue 22 Aug 2017 12:31:26 PM CEST, Manos Pitsidianakis wrote: > On Tue, Aug 22, 2017 at 11:57:28AM +0200, Alberto Garcia wrote: >>On Mon 21 Aug 2017 05:39:48 PM CEST, Manos Pitsidianakis wrote: > -if (job_id == NULL && !(flags & BLOCK_JOB_INTERNAL)) { > -job_id =

Re: [Qemu-block] [PATCH v2 3/6] block: require job-id when device is a node name

2017-08-22 Thread Alberto Garcia
On Mon 21 Aug 2017 05:39:48 PM CEST, Manos Pitsidianakis wrote: >>> -if (job_id == NULL && !(flags & BLOCK_JOB_INTERNAL)) { >>> -job_id = bdrv_get_device_name(bs); >>> -if (!*job_id) { >>> -error_setg(errp, "An explicit job ID is required for this >>> node"); >>> -

Re: [Qemu-block] [PATCH v2 3/6] block: require job-id when device is a node name

2017-08-22 Thread Manos Pitsidianakis
On Tue, Aug 22, 2017 at 11:57:28AM +0200, Alberto Garcia wrote: On Mon 21 Aug 2017 05:39:48 PM CEST, Manos Pitsidianakis wrote: -if (job_id == NULL && !(flags & BLOCK_JOB_INTERNAL)) { -job_id = bdrv_get_device_name(bs); -if (!*job_id) { -error_setg(errp, "An

[Qemu-block] [PATCH v7 1/6] block: move ThrottleGroup membership to ThrottleGroupMember

2017-08-22 Thread Manos Pitsidianakis
This commit eliminates the 1:1 relationship between BlockBackend and throttle group state. Users will be able to create multiple throttle nodes, each with its own throttle group state, in the future. The throttle group state cannot be per-BlockBackend anymore, it must be per-throttle node. This

[Qemu-block] [PATCH v7 4/6] block: convert ThrottleGroup to object with QOM

2017-08-22 Thread Manos Pitsidianakis
ThrottleGroup is converted to an object. This will allow the future throttle block filter drive easy creation and configuration of throttle groups in QMP and cli. A new QAPI struct, ThrottleLimits, is introduced to provide a shared struct for all throttle configuration needs in QMP.

Re: [Qemu-block] [RFC PATCH 02/56] qdict: New helpers to put and get unsigned integers

2017-08-22 Thread Marc-André Lureau
Hi Is this based on https://lists.gnu.org/archive/html/qemu-devel/2017-06/msg01894.html ? If so, you should probably keep me signed-off. My patch had also a test :) - Original Message - > Signed-off-by: Markus Armbruster > --- > include/qapi/qmp/qdict.h | 5

Re: [Qemu-block] [Qemu-devel] [RFC PATCH 04/56] char: Make ringbuf-read size unsigned in QAPI/QMP

2017-08-22 Thread Marc-André Lureau
Hi On Mon, Aug 7, 2017 at 4:45 PM, Markus Armbruster wrote: > Sizes should use QAPI type 'size' (uint64_t). ringbuf-read parameter > @size is 'int' (int64_t). qmp_ringbuf_read() rejects negative values, > then implicitly converts to size_t. > > Change the parameter to 'size'

Re: [Qemu-block] [PATCH v2 4/6] block: remove legacy I/O throttling

2017-08-22 Thread Alberto Garcia
On Wed 09 Aug 2017 04:02:54 PM CEST, Manos Pitsidianakis wrote: > +void blk_io_limits_update_group(BlockBackend *blk, const char *group, Error > **errp) > { > +ThrottleGroupMember *tgm; > + > /* this BB is not part of any group */ > -if

Re: [Qemu-block] [PATCH v2 6/6] block: remove BlockBackendPublic

2017-08-22 Thread Alberto Garcia
On Wed 09 Aug 2017 04:02:56 PM CEST, Manos Pitsidianakis wrote: > All BlockBackend level throttling (via the implicit throttle filter node) is > done in block/block-backend.c and block/throttle-groups.c doesn't know > about BlockBackends anymore. Since BlockBackendPublic is not needed anymore, >

[Qemu-block] [PATCH] nbd-client: avoid spurious qio_channel_yield() re-entry

2017-08-22 Thread Stefan Hajnoczi
The following scenario leads to an assertion failure in qio_channel_yield(): 1. Request coroutine calls qio_channel_yield() successfully when sending would block on the socket. It is now yielded. 2. nbd_read_reply_entry() calls nbd_recv_coroutines_enter_all() because nbd_receive_reply()

Re: [Qemu-block] [Qemu-devel] [RFC PATCH 12/56] pc-dimm: Make size and address unsigned in QAPI/QMP

2017-08-22 Thread Igor Mammedov
On Mon, 7 Aug 2017 16:45:16 +0200 Markus Armbruster wrote: > Sizes and addresses should use QAPI type 'size' (uint64_t). > PCDIMMDeviceInfo members @addr and @size are 'int' (int64_t). > qmp_pc_dimm_device_list() implicitly converts from uint64_t. > > Change these

Re: [Qemu-block] [Qemu-devel] [RFC PATCH 04/56] char: Make ringbuf-read size unsigned in QAPI/QMP

2017-08-22 Thread Markus Armbruster
Marc-André Lureau writes: > Hi > > On Mon, Aug 7, 2017 at 4:45 PM, Markus Armbruster wrote: >> Sizes should use QAPI type 'size' (uint64_t). ringbuf-read parameter >> @size is 'int' (int64_t). qmp_ringbuf_read() rejects negative values, >> then

[Qemu-block] [PATCH 08/10] scsi: build qemu-pr-helper

2017-08-22 Thread Paolo Bonzini
Introduce a privileged helper to run persistent reservation commands. This lets virtual machines send persistent reservations without using CAP_SYS_RAWIO or out-of-tree patches. The helper uses Unix permissions and SCM_RIGHTS to restrict access to processes that can access its socket and prove

[Qemu-block] [PATCH 06/10] scsi, file-posix: add support for persistent reservation management

2017-08-22 Thread Paolo Bonzini
It is a common requirement for virtual machine to send persistent reservations, but this currently requires either running QEMU with CAP_SYS_RAWIO, or using out-of-tree patches that let an unprivileged QEMU bypass Linux's filter on SG_IO commands. As an alternative mechanism, the next patches

[Qemu-block] [PATCH 10/10] scsi: add persistent reservation manager using qemu-pr-helper

2017-08-22 Thread Paolo Bonzini
This adds a concrete subclass of pr-manager that talks to qemu-pr-helper. Signed-off-by: Paolo Bonzini --- scsi/Makefile.objs | 2 +- scsi/pr-manager-helper.c | 288 +++ 2 files changed, 289 insertions(+), 1 deletion(-)

Re: [Qemu-block] [PATCH] nbd-client: avoid spurious qio_channel_yield() re-entry

2017-08-22 Thread Paolo Bonzini
On 22/08/2017 14:51, Stefan Hajnoczi wrote: > This should fix the issue that Dave is seeing but I'm concerned that > there are more problems in nbd-client.c. We don't have good > abstractions for writing coroutine socket I/O code. Something like Go's > channels would avoid manual low-level

[Qemu-block] [PATCH 02/10] scsi: move non-emulation specific code to scsi/

2017-08-22 Thread Paolo Bonzini
There is a bunch of SCSI code that is shared by block/iscsi.c and hw/scsi, and the introduction of the persistent reservation helper will add more instances of this. There is also include/block/scsi.h, which actually is not part of the core block layer. Create a directory for this kind of shared

[Qemu-block] [PATCH 05/10] scsi: move block/scsi.h to include/scsi/constants.h

2017-08-22 Thread Paolo Bonzini
Complete the transition by renaming this header, which was shared by block/iscsi.c and the SCSI emulation code. Signed-off-by: Paolo Bonzini --- block/iscsi.c | 2 +- hw/block/virtio-blk.c | 2 +- hw/scsi/megasas.c

[Qemu-block] [RFC PATCH 00/10] scsi, block: introduce persistent reservation managers

2017-08-22 Thread Paolo Bonzini
SCSI persistent Reservations allow restricting access to block devices to specific initiators in a shared storage setup. When implementing clustering of virtual machines, it is a common requirement for virtual machines to send persistent reservation SCSI commands. However, the operating system

[Qemu-block] [PATCH 03/10] scsi: introduce scsi_build_sense

2017-08-22 Thread Paolo Bonzini
Move more knowledge of sense data format out of hw/scsi/scsi-bus.c for reusability. Signed-off-by: Paolo Bonzini --- hw/scsi/scsi-bus.c | 8 +--- include/scsi/utils.h | 2 ++ scsi/utils.c | 11 +++ 3 files changed, 14 insertions(+), 7 deletions(-)

[Qemu-block] [PATCH 04/10] scsi: introduce sg_io_sense_from_errno

2017-08-22 Thread Paolo Bonzini
Move more knowledge of SG_IO out of hw/scsi/scsi-generic.c, for reusability. Signed-off-by: Paolo Bonzini --- hw/scsi/scsi-generic.c | 40 +++- include/scsi/utils.h | 3 +++ scsi/utils.c | 35

[Qemu-block] [PATCH 07/10] io: add qio_channel_read/write_all

2017-08-22 Thread Paolo Bonzini
It is pretty common to read a fixed-size buffer from a socket. Add a function that does this, either with multiple reads (on blocking sockets) or by yielding if called from a coroutine. Cc: Daniel P. Berrange Signed-off-by: Paolo Bonzini ---

[Qemu-block] [PATCH 09/10] scsi: add multipath support to qemu-pr-helper

2017-08-22 Thread Paolo Bonzini
Proper support of persistent reservation for multipath devices requires communication with the multipath daemon, so that the reservation is registered and applied when a path comes up. The device mapper utilities provide a library to do so; this patch makes qemu-pr-helper.c detect multipath

[Qemu-block] [PATCH 01/10] scsi: rename scsi_convert_sense

2017-08-22 Thread Paolo Bonzini
After introducing the scsi/ subdirectory, there will be a scsi_build_sense function that is the same as scsi_req_build_sense but without needing a SCSIRequest. The existing scsi_build_sense function gets in the way, remove it. Signed-off-by: Paolo Bonzini ---

[Qemu-block] [PATCH v2 10/54] block: use qemu_enum_parse() in blkdebug_debug_breakpoint

2017-08-22 Thread Marc-André Lureau
This slightly change the error report message from "Invalid event name" to "Invalid parameter". Signed-off-by: Marc-André Lureau --- block/blkdebug.c | 28 1 file changed, 8 insertions(+), 20 deletions(-) diff --git a/block/blkdebug.c