Re: [Qemu-devel] [PATCH v2 09/45] qapi: merge QInt and QFloat in QNum

2017-06-02 Thread Markus Armbruster
Marc-André Lureau writes: > We would like to use a same QObject type to represent numbers, whether > they are int, uint, or floats. Getters will allow some compatibility > between the various types if the number fits other representations. > > Signed-off-by: Marc-André Lureau > --- > scripts/qa

Re: [Qemu-devel] [PATCH 3/4] spapr: Abolish DRC set_configured method

2017-06-02 Thread David Gibson
On Thu, Jun 01, 2017 at 10:37:39AM -0500, Michael Roth wrote: > Quoting David Gibson (2017-05-31 20:52:17) > > DRConnectorClass has a set_configured method, however: > > * There is only one implementation, and only ever likely to be one > > * There's exactly one caller, and that's (now) local >

Re: [Qemu-devel] [PATCH 1/4] spapr: Move DRC RTAS calls into spapr_drc.c

2017-06-02 Thread David Gibson
On Thu, Jun 01, 2017 at 10:56:50AM -0500, Michael Roth wrote: > Quoting David Gibson (2017-05-31 20:52:15) > > Currently implementations of the RTAS calls related to DRCs are in > > spapr_rtas.c. They belong better in spapr_drc.c - that way they're closer > > to related code, and we'll be able to

Re: [Qemu-devel] [Qemu-ppc] [PATCH 0/4] spapr:DRC cleanups (part I)

2017-06-02 Thread David Gibson
On Thu, Jun 01, 2017 at 12:41:40PM -0300, Daniel Henrique Barboza wrote: > > > On 06/01/2017 02:30 AM, David Gibson wrote: > > On Wed, May 31, 2017 at 11:25:41PM -0500, Michael Roth wrote: > > > Quoting Bharata B Rao (2017-05-31 23:06:46) > > > > On Thu, Jun 01, 2017 at 11:52:14AM +1000, David Gi

Re: [Qemu-devel] [PATCH 1/4] spapr: Move DRC RTAS calls into spapr_drc.c

2017-06-02 Thread David Gibson
On Thu, Jun 01, 2017 at 11:05:37AM -0500, Michael Roth wrote: > Quoting Laurent Vivier (2017-06-01 08:36:36) > > On 01/06/2017 03:52, David Gibson wrote: > > > Currently implementations of the RTAS calls related to DRCs are in > > > spapr_rtas.c. They belong better in spapr_drc.c - that way they'r

Re: [Qemu-devel] [PATCH 0/4] spapr:DRC cleanups (part I)

2017-06-02 Thread David Gibson
On Thu, Jun 01, 2017 at 11:52:14AM +1000, David Gibson wrote: > The code managing DRCs[0] has quite a few things that are more > complicated than they need to be. In particular the object > representing a DRC has a bunch of method pointers, despite the fact > that there are currently no subclasses

Re: [Qemu-devel] [PATCHv5 0/4] Clean up compatibility mode handling

2017-06-02 Thread David Gibson
On Thu, Jun 01, 2017 at 08:55:19PM -0700, no-re...@patchew.org wrote: > Hi, > > This series seems to have some coding style problems. See output below for > more information: > > Type: series > Message-id: 20170602031507.29881-1-da...@gibson.dropbear.id.au > Subject: [Qemu-devel] [PATCHv5 0/4] Cl

[Qemu-devel] [PATCH 3/5] spapr: Move configure-connector state into DRC

2017-06-02 Thread David Gibson
Currently the sPAPRMachineState contains a of sPAPRConfigureConnector structures which store intermediate state for the ibm,configure-connector RTAS call. This was an attempt to separate this state from the core of the DRC state. However the configure connector process is intimately tied to the DR

[Qemu-devel] [PATCH 1/5] spapr: Introduce DRC subclasses

2017-06-02 Thread David Gibson
Currently we only have a single QOM type for all DRCs, but lots of places where we switch behaviour based on the DRC's PAPR defined type. This is a poor use of our existing type system. So, instead create QOM subclasses for each PAPR defined DRC type. We also introduce intermediate subclasses for

[Qemu-devel] [PATCH 5/5] spapr: Remove some non-useful properties on DRC objects

2017-06-02 Thread David Gibson
* 'connector_type' is easily derived from the 'index' property, so there's no point to it (it's also implicit in the QOM type of the DRC) * 'isolation-state', 'indicator-state' and 'allocation-state' are part of the transaction between qemu and guest during PAPR hotplug operations, and o

[Qemu-devel] [PATCH 0/5] spapr: DRC cleanups (part II)

2017-06-02 Thread David Gibson
Having merged my first batch of cleanups for the DRC code, this series contains a second batch. This adds the long-discussed QOM subtypes for different PAPR DRC types. It still only makes partial use of the QOM type structure, but it's a start. It also removes the artificial separation between c

[Qemu-devel] [PATCH 2/5] spapr: Clean up spapr_dr_connector_by_*()

2017-06-02 Thread David Gibson
* Change names to something less ludicrously verbose * Now that we have QOM subclasses for the different DRC types, use a QOM typename instead of a PAPR type value parameter The latter allows removal of the get_type_shift() helper. Signed-off-by: David Gibson --- hw/ppc/spapr.c

[Qemu-devel] [PATCH 4/5] spapr: Eliminate spapr_drc_get_type_str()

2017-06-02 Thread David Gibson
This function was used in generating the device tree. However, now that we have different QOM types for different DRC types we can easily store the information we need in the class structure and avoid this specialized lookup function. Signed-off-by: David Gibson --- hw/ppc/spapr_drc.c |

Re: [Qemu-devel] [PATCH v2] spapr: manage hotplugged devices while the VM is not started

2017-06-02 Thread David Gibson
On Wed, May 31, 2017 at 11:25:16AM +0200, Laurent Vivier wrote: > For QEMU, a hotlugged device is a device added using the HMP/QMP > interface. > For SPAPR, a hotplugged device is a device added while the > machine is running. In this case QEMU doesn't update internal > state but relies on the OS f

[Qemu-devel] [PULL 01/15] char: cast ARRAY_SIZE() as signed to silent warning on empty array

2017-06-02 Thread Marc-André Lureau
From: Philippe Mathieu-Daudé chardev/char.c: In function 'chardev_name_foreach': chardev/char.c:546:19: error: comparison of unsigned expression < 0 is always false [-Werror=type-limits] for (i = 0; i < ARRAY_SIZE(chardev_alias_table); i++) { ^ Signed-off-by: Philippe Mat

[Qemu-devel] [PULL 00/15] chardev patches

2017-06-02 Thread Marc-André Lureau
The following changes since commit 43771d5d92312504305c19abe29ec5bfabd55f01: Merge remote-tracking branch 'remotes/armbru/tags/pull-qapi-2017-05-31' into staging (2017-06-01 16:39:16 +0100) are available in the git repository at: github/chrfe chrfe-pull-request for you to fetch changes up

[Qemu-devel] [PULL 03/15] char-win: remove WinChardev.len

2017-06-02 Thread Marc-André Lureau
The "len" argument can be passed directly to win_chr_read() Signed-off-by: Marc-André Lureau Reviewed-by: Philippe Mathieu-Daudé --- chardev/char-win.h | 1 - chardev/char-win.c | 16 +++- 2 files changed, 7 insertions(+), 10 deletions(-) diff --git a/chardev/char-win.h b/chardev/

[Qemu-devel] [PULL 02/15] char-win: simplify win_chr_read()

2017-06-02 Thread Marc-André Lureau
win_chr_read_poll() is always used before win_chr_read(). We can easily fold win_chr_readfile() too. Signed-off-by: Marc-André Lureau Reviewed-by: Philippe Mathieu-Daudé --- chardev/char-win.h | 2 +- chardev/char-win.c | 35 +-- 2 files changed, 10 insertions(+

[Qemu-devel] [PULL 12/15] char: move CharBackend handling in char-fe unit

2017-06-02 Thread Marc-André Lureau
Move all the frontend struct and methods to a seperate unit. This avoids accidentally mixing backend and frontend calls, and helps with readabilty. Make qemu_chr_replay() a macro shared by both char and char-fe. Export qemu_chr_write(), and use a macro for qemu_chr_write_all() (nb: yes, CharBack

[Qemu-devel] [PULL 05/15] char-win: rename hcom->file

2017-06-02 Thread Marc-André Lureau
hcom is the name of the file handle, regardless of the actual chardev driver (serial, file, console etc..). Rename it to be more explicit. Signed-off-by: Marc-André Lureau Reviewed-by: Philippe Mathieu-Daudé --- chardev/char-win.h | 2 +- chardev/char-pipe.c | 10 +- chardev/char-win.

[Qemu-devel] [PULL 04/15] char-win: rename win_chr_init/poll win_chr_serial_init/poll

2017-06-02 Thread Marc-André Lureau
Those 2 functions are specific to serial chardev, make it more clear. Signed-off-by: Marc-André Lureau Reviewed-by: Philippe Mathieu-Daudé --- chardev/char-win.h| 2 +- chardev/char-serial.c | 2 +- chardev/char-win.c| 8 3 files changed, 6 insertions(+), 6 deletions(-) diff -

[Qemu-devel] [PULL 06/15] char-win: close file handle except with console

2017-06-02 Thread Marc-André Lureau
Only the console handle shouldn't be closed, however, the "file" handle should. Signed-off-by: Marc-André Lureau Reviewed-by: Philippe Mathieu-Daudé --- chardev/char-win.h | 5 ++--- chardev/char-console.c | 2 +- chardev/char-file.c| 2 +- chardev/char-win.c | 12 4

[Qemu-devel] [PULL 13/15] char: rename functions that are not part of fe

2017-06-02 Thread Marc-André Lureau
There is no clear reason to have those functions associated with frontend. Signed-off-by: Marc-André Lureau Reviewed-by: Philippe Mathieu-Daudé --- chardev/char.c | 15 +++ 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/chardev/char.c b/chardev/char.c index 8ea7b5777a

[Qemu-devel] [PULL 07/15] Remove/replace sysemu/char.h inclusion

2017-06-02 Thread Marc-André Lureau
Those are apparently unnecessary includes. Signed-off-by: Marc-André Lureau Reviewed-by: Philippe Mathieu-Daudé --- hw/arm/bcm2835_peripherals.c | 1 - hw/char/imx_serial.c | 1 - hw/display/xenfb.c | 1 - hw/i386/xen/xen-hvm.c| 1 - hw/mips/mips_fulong2e.c | 1 -

[Qemu-devel] [PULL 10/15] be-hci: use backend functions

2017-06-02 Thread Marc-André Lureau
Avoid accessing CharBackend directly, use qemu_chr_be_* methods instead. be->chr_read should exists if qemu_chr_be_can_write() is true. (use qemu_chr_be_write(), _impl() bypasses replay) Signed-off-by: Marc-André Lureau Reviewed-by: Andrzej Zaborowski --- hw/bt/hci-csr.c | 9 +++-- 1 file

[Qemu-devel] [PULL 08/15] chardev: move headers to include/chardev

2017-06-02 Thread Marc-André Lureau
So they are all in one place. The following patch will move serial & parallel declarations to the respective headers. Signed-off-by: Marc-André Lureau Reviewed-by: Philippe Mathieu-Daudé --- {chardev => include/chardev}/char-fd.h| 2 +- {chardev => include/chardev}/char-io.h|

[Qemu-devel] [PULL 11/15] char: generalize qemu_chr_write_all()

2017-06-02 Thread Marc-André Lureau
qemu_chr_fe_write() is similar to qemu_chr_write_all(): the later write all with a chardev backend. Make qemu_chr_write() and qemu_chr_fe_write_buffer() take an 'all' argument. If false, handle 'partial' write the way qemu_chr_fe_write() use to, and call qemu_chr_write() from qemu_chr_fe_write().

[Qemu-devel] [PULL 09/15] chardev: serial & parallel declaration to own headers

2017-06-02 Thread Marc-André Lureau
Signed-off-by: Marc-André Lureau Reviewed-by: Philippe Mathieu-Daudé --- include/chardev/char-parallel.h | 20 +++- include/chardev/char-serial.h | 22 ++ include/chardev/char.h | 36 backends/wctablet.c

[Qemu-devel] [PULL 14/15] char: make chr_fe_deinit() optionaly delete backend

2017-06-02 Thread Marc-André Lureau
This simplifies removing a backend for a frontend user (no need to retrieve the associated driver and separate delete call etc). NB: many frontends have questionable handling of ending a chardev. They should probably delete the backend to prevent broken reusage. Signed-off-by: Marc-André Lureau

Re: [Qemu-devel] [PATCH] msi: remove return code for msi_init()

2017-06-02 Thread Markus Armbruster
Peter Xu writes: > On Thu, Jun 01, 2017 at 03:06:29PM -0700, Paul Burton wrote: >> Hi Aurelien/Paolo/Marcel, >> >> On Thursday, 1 June 2017 12:22:06 PDT Aurelien Jarno wrote: >> > On 2017-06-01 16:23, Paolo Bonzini wrote: >> > > On 01/06/2017 10:27, Marcel Apfelbaum wrote: >> > > > On 31/05/2017

[Qemu-devel] [PULL 15/15] char: move char devices to chardev/

2017-06-02 Thread Marc-André Lureau
Suggested by Paolo Bonzini during series review. Signed-off-by: Marc-André Lureau Reviewed-by: Philippe Mathieu-Daudé --- {backends => chardev}/baum.c | 0 {backends => chardev}/msmouse.c | 0 spice-qemu-char.c => chardev/spice.c | 2 +- {backends => chardev}/testdev.c | 0

[Qemu-devel] [PATCH v2 0/6] Convert to realize and cleanup

2017-06-02 Thread Mao Zhongyi
v2: * patch1: subject and commit message was rewrited by markus. * patch2: comment was added to pci_add_capability2(). * patch3: a new patch that fix the wrong return value judgment condition. * patch4: a new patch that fix code style problems. * patch5: add an errp argument for pci_add_capability

[Qemu-devel] [PATCH v2 1/6] pci: Clean up error checking in pci_add_capability()

2017-06-02 Thread Mao Zhongyi
On success, pci_add_capability2() returns a positive value. On failure, it sets an error and return a negative value. pci_add_capability() laboriously checks this behavior. No other caller does. Drop the checks from pci_add_capability(). Cc: m...@redhat.com Cc: mar...@redhat.com Cc: arm...@redhat

[Qemu-devel] [PATCH v2 2/6] pci: Add comment for pci_add_capability2()

2017-06-02 Thread Mao Zhongyi
Add a comment for pci_add_capability2() to explain the return value. This may help to make a correct return value check for its callers. Cc: m...@redhat.com Cc: mar...@redhat.com Cc: arm...@redhat.com Suggested-by: Markus Armbruster Signed-off-by: Mao Zhongyi --- hw/pci/pci.c | 4 1 file c

[Qemu-devel] [PATCH v2 6/6] pci: Convert to realize

2017-06-02 Thread Mao Zhongyi
The pci-birdge device i82801b11 and io3130_upstream/downstream still implements the old PCIDeviceClass .init() through *_init() instead of the new .realize(). All devices need to be converted to .realize(). So convert it and rename it to *_realize(). Cc: m...@redhat.com Cc: mar...@redhat.com Cc: a

[Qemu-devel] [PATCH v2 3/6] pci: Fix the wrong return value judgment condition

2017-06-02 Thread Mao Zhongyi
On success, pci_add_capability2() returns a positive value. On failure, it sets an error and return a negative value. It doesn't always return 0. So the judgment condtion of pci_add_capability2() is wrong if it contains the situation where return value equal to 0. Fix the error checks from its call

Re: [Qemu-devel] [PATCH v2 10/45] qapi: Remove visit_start_alternate() parameter promote_int

2017-06-02 Thread Markus Armbruster
Marc-André Lureau writes: > Before the previous commit, parameter promote_int = true made > visit_start_alternate() with an input visitor avoid QTYPE_QINT > variants and create QTYPE_QFLOAT variants instead. This was used > where QTYPE_QINT variants were invalid. > > The previous commit fused QT

Re: [Qemu-devel] [PULL 00/22] Docker and block patches

2017-06-02 Thread Fam Zheng
On Thu, 06/01 18:18, Peter Maydell wrote: > On 26 May 2017 at 08:52, Fam Zheng wrote: > > The following changes since commit 9964e96dccf7f7c936ee854a795415d19b60: > > > > Merge remote-tracking branch 'jasowang/tags/net-pull-request' into > > staging (2017-05-23 15:01:31 +0100) > > > > are a

[Qemu-devel] [PATCH v2 4/6] net/eepro100: Fixed code style

2017-06-02 Thread Mao Zhongyi
It reports a code style problem(ERROR: "foo * bar" should be "foo *bar") when running checkpatch.pl. So fix it to conform to the coding standards. Cc: jasow...@redhat.com Cc: arm...@redhat.com Signed-off-by: Mao Zhongyi --- hw/net/eepro100.c | 62 +++--

[Qemu-devel] [PATCH v2 5/6] pci: Make errp the last parameter of pci_add_capability()

2017-06-02 Thread Mao Zhongyi
Add Error argument for pci_add_capability() to leverage the errp to pass info on errors. This way is helpful for its callers to make a better error handling when moving to 'realize'. Cc: m...@redhat.com Cc: pbonz...@redhat.com Cc: r...@twiddle.net Cc: ehabk...@redhat.com Cc: dmi...@daynix.com Cc:

Re: [Qemu-devel] [PATCH v2 11/45] tests: remove /qnum/destroy test

2017-06-02 Thread Markus Armbruster
Marc-André Lureau writes: > The test isn't really useful. > > Signed-off-by: Marc-André Lureau Same in check-qdict.c check-qlist.c check-qstring.c. Please drop them, too.

Re: [Qemu-devel] [PATCH v2 12/45] qnum: add uint type

2017-06-02 Thread Markus Armbruster
Marc-André Lureau writes: > In order to store integer values superior to INT64_MAX, add a u64 "superior" sounds odd. What about "above"? Or perhaps "between INT64_MAX and UINT64_MAX". s/a u64/a uint64_t/ > internal representation. > > Signed-off-by: Marc-André Lureau With the commit messag

Re: [Qemu-devel] [Qemu-block] [PATCH 00/29] qed: Convert to coroutines

2017-06-02 Thread Paolo Bonzini
On 01/06/2017 19:08, Kevin Wolf wrote: > Am 01.06.2017 um 18:40 hat Paolo Bonzini geschrieben: >> On 01/06/2017 18:28, Kevin Wolf wrote: - qed_acquire/qed_release can be removed as you inline stuff, but this should not cause bugs so you can either do it as a final patch or let me rem

Re: [Qemu-devel] [PULL v2 00/34] Misc patches for 2016-06-01

2017-06-02 Thread Paolo Bonzini
On 01/06/2017 19:56, Peter Maydell wrote: > On 1 June 2017 at 18:53, Peter Maydell wrote: >> Test failure on OSX: >> >> TEST: tests/device-introspect-test... (pid=66373) >> /aarch64/device/introspect/list: OK >> /aarch64/device/introspect/none:

Re: [Qemu-devel] [PATCH v3 30/30] target/s390x: update maximum TCG model to z800

2017-06-02 Thread Thomas Huth
On 01.06.2017 21:17, Aurelien Jarno wrote: > On 2017-06-01 11:04, David Hildenbrand wrote: >> On 01.06.2017 10:38, David Hildenbrand wrote: >>> On 01.06.2017 00:01, Aurelien Jarno wrote: At the same time fix the TCG version of get_max_cpu_model to return the maximum model like on KVM. Rem

[Qemu-devel] [PULL v2 01/22] docker: Run tests with current user

2017-06-02 Thread Fam Zheng
We've used --add-current-user to create a user in the image, use it to run tests, because root has too much priviledge, and can surprise test cases. Signed-off-by: Fam Zheng Message-Id: <20170505032340.26467-2-f...@redhat.com> Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Alex Bennée Reviewe

[Qemu-devel] [PULL v2 00/22] Docker and block patches

2017-06-02 Thread Fam Zheng
The following changes since commit 43771d5d92312504305c19abe29ec5bfabd55f01: Merge remote-tracking branch 'remotes/armbru/tags/pull-qapi-2017-05-31' into staging (2017-06-01 16:39:16 +0100) are available in the git repository at: git://github.com/famz/qemu.git tags/docker-and-block-pull-req

[Qemu-devel] [PULL v2 07/22] block: access io_limits_disabled with atomic ops

2017-06-02 Thread Fam Zheng
From: Paolo Bonzini Reviewed-by: Stefan Hajnoczi Reviewed-by: Alberto Garcia Signed-off-by: Paolo Bonzini Message-Id: <20170525163225.29954-4-pbonz...@redhat.com> Signed-off-by: Fam Zheng --- block/block-backend.c | 4 ++-- block/throttle-groups.c| 2 +- include/sysemu/block

[Qemu-devel] [PULL v2 08/22] block: access serialising_in_flight with atomic ops

2017-06-02 Thread Fam Zheng
From: Paolo Bonzini Reviewed-by: Stefan Hajnoczi Signed-off-by: Paolo Bonzini Message-Id: <20170525163225.29954-5-pbonz...@redhat.com> Signed-off-by: Fam Zheng --- block/io.c| 6 +++--- include/block/block_int.h | 10 ++ 2 files changed, 9 insertions(+), 7 deletions(-

[Qemu-devel] [PULL v2 03/22] docker: Add libaio to fedora image

2017-06-02 Thread Fam Zheng
Signed-off-by: Fam Zheng Message-Id: <20170505032340.26467-5-f...@redhat.com> Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Alex Bennée Reviewed-by: Paolo Bonzini Signed-off-by: Fam Zheng --- tests/docker/dockerfiles/fedora.docker | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff

[Qemu-devel] [PULL v2 02/22] docker: Add bzip2 and hostname to fedora image

2017-06-02 Thread Fam Zheng
It is used by qemu-iotests. Signed-off-by: Fam Zheng Message-Id: <20170505032340.26467-3-f...@redhat.com> Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Alex Bennée Reviewed-by: Paolo Bonzini Signed-off-by: Fam Zheng --- tests/docker/dockerfiles/fedora.docker | 2 +- 1 file changed, 1 inse

[Qemu-devel] [PULL v2 10/22] block: access io_plugged with atomic ops

2017-06-02 Thread Fam Zheng
From: Paolo Bonzini Reviewed-by: Stefan Hajnoczi Signed-off-by: Paolo Bonzini Message-Id: <20170525163225.29954-7-pbonz...@redhat.com> Signed-off-by: Fam Zheng --- block/io.c| 4 ++-- include/block/block_int.h | 8 +--- 2 files changed, 7 insertions(+), 5 deletions(-) dif

[Qemu-devel] [PULL v2 11/22] throttle-groups: only start one coroutine from drained_begin

2017-06-02 Thread Fam Zheng
From: Paolo Bonzini Starting all waiting coroutines from bdrv_drain_all is unnecessary; throttle_group_co_io_limits_intercept calls schedule_next_request as soon as the coroutine restarts, which in turn will restart the next request if possible. If we only start the first request and let the cor

[Qemu-devel] [PULL v2 04/22] docker: Add flex and bison to centos6 image

2017-06-02 Thread Fam Zheng
Currently there are warnings about flex and bison being missing when building in the centos6 image: make[1]: flex: Command not found BISON dtc-parser.tab.c make[1]: bison: Command not found Add them. Reported-by: Thomas Huth Signed-off-by: Fam Zheng Message-Id: <2017052400

[Qemu-devel] [PULL v2 06/22] block: access quiesce_counter with atomic ops

2017-06-02 Thread Fam Zheng
From: Paolo Bonzini Reviewed-by: Stefan Hajnoczi Reviewed-by: Alberto Garcia Signed-off-by: Paolo Bonzini Message-Id: <20170525163225.29954-3-pbonz...@redhat.com> Signed-off-by: Fam Zheng --- block/io.c| 4 ++-- include/block/block_int.h | 1 + 2 files changed, 3 insertions(+

[Qemu-devel] [PULL v2 12/22] throttle-groups: do not use qemu_co_enter_next

2017-06-02 Thread Fam Zheng
From: Paolo Bonzini Prepare for removing this function; always restart throttled requests from coroutine context. This will matter when restarting throttled requests will have to acquire a CoMutex. Reviewed-by: Alberto Garcia Reviewed-by: Stefan Hajnoczi Signed-off-by: Paolo Bonzini Message-

[Qemu-devel] [PULL v2 14/22] util: add stats64 module

2017-06-02 Thread Fam Zheng
From: Paolo Bonzini This module provides fast paths for 64-bit atomic operations on machines that only have 32-bit atomic access. Reviewed-by: Stefan Hajnoczi Signed-off-by: Paolo Bonzini Message-Id: <20170525163225.29954-11-pbonz...@redhat.com> [Include qemu/processor.h for cpu_relax(). - Fam

[Qemu-devel] [PULL v2 05/22] block: access copy_on_read with atomic ops

2017-06-02 Thread Fam Zheng
From: Paolo Bonzini Reviewed-by: Stefan Hajnoczi Signed-off-by: Paolo Bonzini Message-Id: <20170525163225.29954-2-pbonz...@redhat.com> Signed-off-by: Fam Zheng --- block.c | 6 -- block/io.c| 8 blockdev.c| 2 +- include/block/

[Qemu-devel] [PULL v2 15/22] block: use Stat64 for wr_highest_offset

2017-06-02 Thread Fam Zheng
From: Paolo Bonzini Reviewed-by: Stefan Hajnoczi Signed-off-by: Paolo Bonzini Message-Id: <20170525163225.29954-12-pbonz...@redhat.com> Signed-off-by: Fam Zheng --- block/io.c| 4 +--- block/qapi.c | 2 +- include/block/block_int.h | 7 --- 3 files changed, 6

[Qemu-devel] [PULL v2 13/22] throttle-groups: protect throttled requests with a CoMutex

2017-06-02 Thread Fam Zheng
From: Paolo Bonzini Another possibility is to use tg->lock, which we're holding anyway in both schedule_next_request and throttle_group_co_io_limits_intercept. This would require open-coding the CoQueue however, so I've chosen this alternative. Reviewed-by: Stefan Hajnoczi Signed-off-by: Paolo

[Qemu-devel] [PULL v2 09/22] block: access wakeup with atomic ops

2017-06-02 Thread Fam Zheng
From: Paolo Bonzini Reviewed-by: Stefan Hajnoczi Signed-off-by: Paolo Bonzini Message-Id: <20170525163225.29954-6-pbonz...@redhat.com> Signed-off-by: Fam Zheng --- block/io.c| 3 ++- block/nfs.c | 4 +++- block/sheepdog.c | 3 ++- include/block/block.h

[Qemu-devel] [PULL v2 19/22] migration/block: reset dirty bitmap before reading

2017-06-02 Thread Fam Zheng
From: Paolo Bonzini Any data that is returned by read may be stale already, the bitmap has to be cleared before issuing the read. Reviewed-by: Stefan Hajnoczi Signed-off-by: Paolo Bonzini Message-Id: <20170525163225.29954-16-pbonz...@redhat.com> Signed-off-by: Fam Zheng --- migration/block.c

[Qemu-devel] [PULL v2 17/22] block: protect tracked_requests and flush_queue with reqs_lock

2017-06-02 Thread Fam Zheng
From: Paolo Bonzini Reviewed-by: Stefan Hajnoczi Signed-off-by: Paolo Bonzini Message-Id: <20170525163225.29954-14-pbonz...@redhat.com> Signed-off-by: Fam Zheng --- block.c | 1 + block/io.c| 16 ++-- include/block/block_int.h | 14 +-

[Qemu-devel] [PULL v2 18/22] block: introduce dirty_bitmap_mutex

2017-06-02 Thread Fam Zheng
From: Paolo Bonzini It protects only the list of dirty bitmaps; in the next patch we will also protect their content. Reviewed-by: Stefan Hajnoczi Signed-off-by: Paolo Bonzini Message-Id: <20170525163225.29954-15-pbonz...@redhat.com> Signed-off-by: Fam Zheng --- block/dirty-bitmap.c | 4

[Qemu-devel] [PULL v2 21/22] block: introduce block_account_one_io

2017-06-02 Thread Fam Zheng
From: Paolo Bonzini This is the common code to account operations that produced actual I/O. Reviewed-by: Alberto Garcia Reviewed-by: Stefan Hajnoczi Signed-off-by: Paolo Bonzini Message-Id: <20170525163225.29954-18-pbonz...@redhat.com> Signed-off-by: Fam Zheng --- block/accounting.c | 51 ++

[Qemu-devel] [PULL v2 16/22] block: access write_gen with atomics

2017-06-02 Thread Fam Zheng
From: Paolo Bonzini Reviewed-by: Stefan Hajnoczi Signed-off-by: Paolo Bonzini Message-Id: <20170525163225.29954-13-pbonz...@redhat.com> Signed-off-by: Fam Zheng --- block.c | 2 +- block/io.c| 6 +++--- include/block/block_int.h | 2 +- 3 files changed, 5 ins

[Qemu-devel] [PULL v2 20/22] block: protect modification of dirty bitmaps with a mutex

2017-06-02 Thread Fam Zheng
From: Paolo Bonzini Reviewed-by: Stefan Hajnoczi Signed-off-by: Paolo Bonzini Message-Id: <20170525163225.29954-17-pbonz...@redhat.com> Signed-off-by: Fam Zheng --- block/dirty-bitmap.c | 70 ++-- block/mirror.c | 11 +-- inclu

[Qemu-devel] [PATCH] vhost-user-bridge: fix iov_restore_front() warning

2017-06-02 Thread Marc-André Lureau
CC tests/vhost-user-bridge.o /home/dgilbert/git/qemu-world3/tests/vhost-user-bridge.c:228:23: warning: variables 'front' and 'iov' used in loop condition not modified in loop body [-Wfor-loop-analysis] for (cur = front; front != iov; cur++) { ^~~~ 1 warnin

Re: [Qemu-devel] [PATCHv4 0/5] Clean up compatibility mode handling

2017-06-02 Thread Greg Kurz
On Fri, 2 Jun 2017 12:00:07 +1000 David Gibson wrote: > On Thu, Jun 01, 2017 at 03:09:15PM +0200, Greg Kurz wrote: > > On Thu, 1 Jun 2017 13:59:14 +0200 > > Cédric Le Goater wrote: > > > > > On 06/01/2017 08:52 AM, David Gibson wrote: > > > > On Wed, May 31, 2017 at 10:58:57AM +0200, Greg K

[Qemu-devel] [PULL v2 22/22] block: make accounting thread-safe

2017-06-02 Thread Fam Zheng
From: Paolo Bonzini I'm not trying too hard yet. Later, with multiqueue support, this may cause mutex contention or cacheline bouncing. Reviewed-by: Alberto Garcia Reviewed-by: Stefan Hajnoczi Signed-off-by: Paolo Bonzini Message-Id: <20170525163225.29954-19-pbonz...@redhat.com> Signed-off-b

Re: [Qemu-devel] [PATCH v2 13/45] json: learn to parse uint64 numbers

2017-06-02 Thread Markus Armbruster
Marc-André Lureau writes: > Switch strtoll() usage to qemu_strtoi64() helper while at it. > > Add a few tests for large numbers. > > Signed-off-by: Marc-André Lureau > --- > qobject/json-lexer.c | 4 > qobject/json-parser.c | 30 -- > tests/check-qjson.c | 3

Re: [Qemu-devel] [PATCH v8 19/20] qcow2: report encryption specific image information

2017-06-02 Thread Alberto Garcia
On Thu 01 Jun 2017 07:27:33 PM CEST, Daniel P. Berrange wrote: > Currently 'qemu-img info' reports a simple "encrypted: yes" > field. This is not very useful now that qcow2 can support > multiple encryption formats. Users want to know which format > is in use and some data related to it. Reviewed-

Re: [Qemu-devel] [PATCH] vhost-user-bridge: fix iov_restore_front() warning

2017-06-02 Thread Dr. David Alan Gilbert
* Marc-André Lureau (marcandre.lur...@redhat.com) wrote: > CC tests/vhost-user-bridge.o > /home/dgilbert/git/qemu-world3/tests/vhost-user-bridge.c:228:23: warning: > variables 'front' and 'iov' used in loop condition not modified in loop body > [-Wfor-loop-analysis] > for (cur = front;

Re: [Qemu-devel] [PATCH v3 1/1] coroutine-lock: do not touch coroutine after another one has been entered

2017-06-02 Thread Stefan Hajnoczi
On Thu, Jun 01, 2017 at 06:08:47PM +0200, Roman Pen wrote: > Submission of requests on linux aio is a bit tricky and can lead to > requests completions on submission path: > > 44713c9e8547 ("linux-aio: Handle io_submit() failure gracefully") > 0ed93d84edab ("linux-aio: process completions from ioq

Re: [Qemu-devel] [PATCH 09/25] block/dirty-bitmap: add readonly field to BdrvDirtyBitmap

2017-06-02 Thread Vladimir Sementsov-Ogievskiy
02.06.2017 02:25, John Snow wrote: On 06/01/2017 03:30 AM, Sementsov-Ogievskiy Vladimir wrote: Hi John! Look at our discussion about this in v18 thread. Shortly: readonly is not the same as disabled. disabled= bitmap just ignores all writes. readonly= writes are not allowed at all. And I th

Re: [Qemu-devel] [Qemu-arm] [PATCH 09/13] armv7m: Implement M profile default memory map

2017-06-02 Thread Peter Maydell
On 2 June 2017 at 06:10, Philippe Mathieu-Daudé wrote: > On 05/30/2017 12:11 PM, Peter Maydell wrote: >> This is the arm of the if() that deals with R profile, and R profile's > > > Oh I completely misunderstood that if() indeed. R and also A I suppose. A profile is never PMSA -- arguably VMSA (M

Re: [Qemu-devel] [PATCH 09/25] block/dirty-bitmap: add readonly field to BdrvDirtyBitmap

2017-06-02 Thread Vladimir Sementsov-Ogievskiy
02.06.2017 11:56, Vladimir Sementsov-Ogievskiy wrote: 02.06.2017 02:25, John Snow wrote: On 06/01/2017 03:30 AM, Sementsov-Ogievskiy Vladimir wrote: Hi John! Look at our discussion about this in v18 thread. Shortly: readonly is not the same as disabled. disabled= bitmap just ignores all wri

Re: [Qemu-devel] [PATCH 09/25] block/dirty-bitmap: add readonly field to BdrvDirtyBitmap

2017-06-02 Thread Vladimir Sementsov-Ogievskiy
02.06.2017 12:01, Vladimir Sementsov-Ogievskiy wrote: 02.06.2017 11:56, Vladimir Sementsov-Ogievskiy wrote: 02.06.2017 02:25, John Snow wrote: On 06/01/2017 03:30 AM, Sementsov-Ogievskiy Vladimir wrote: Hi John! Look at our discussion about this in v18 thread. Shortly: readonly is not the s

Re: [Qemu-devel] [PATCH v2 1/4] dump: add DumpInfo structure

2017-06-02 Thread Marc-André Lureau
Hi On Thu, Jun 1, 2017 at 10:19 PM Eric Blake wrote: > On 06/01/2017 01:06 PM, Laszlo Ersek wrote: > > On 06/01/17 15:03, Marc-André Lureau wrote: > >> One way or another, the guest could communicate various dump info (via > >> guest agent or vmcoreinfo device) and populate that structure. It ca

Re: [Qemu-devel] [PATCH 1/2] qcow2: add reduce image support

2017-06-02 Thread Pavel Butsykin
On 01.06.2017 17:41, Kevin Wolf wrote: Am 31.05.2017 um 16:43 hat Pavel Butsykin geschrieben: This patch adds the reduction 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 fragmented

[Qemu-devel] [PATCH] virtio-serial: fix segfault on disconnect

2017-06-02 Thread Stefan Hajnoczi
Since commit d4c19cdeeb2f1e474bc426a6da261f1d7346eb5b ("virtio-serial: add missing virtio_detach_element() call") the following commands may cause QEMU to segfault: $ qemu -M accel=kvm -cpu host -m 1G \ -drive if=virtio,file=test.img,format=raw \ -device virtio-serial-pci,id=vi

Re: [Qemu-devel] [PATCH v2 1/4] dump: add DumpInfo structure

2017-06-02 Thread Marc-André Lureau
Hi On Fri, Jun 2, 2017 at 1:46 PM Marc-André Lureau wrote: > Hi > > On Thu, Jun 1, 2017 at 10:19 PM Eric Blake wrote: > >> On 06/01/2017 01:06 PM, Laszlo Ersek wrote: >> > On 06/01/17 15:03, Marc-André Lureau wrote: >> >> One way or another, the guest could communicate various dump info (via >>

Re: [Qemu-devel] [PULL 23/33] exec: fix address_space_get_iotlb_entry page mask

2017-06-02 Thread Peter Xu
On Thu, Jun 01, 2017 at 02:41:41PM +0200, Paolo Bonzini wrote: > From: Peter Xu > > The IOTLB that it returned didn't guarantee that page_mask is indeed a > so-called page mask. That won't affect current usage since now only > vhost is using it (vhost API allows arbitary IOTLB range). However we

Re: [Qemu-devel] [PATCH 13/19] nbd/server: return original error codes

2017-06-02 Thread Vladimir Sementsov-Ogievskiy
02.06.2017 01:29, Eric Blake wrote: On 05/30/2017 09:30 AM, Vladimir Sementsov-Ogievskiy wrote: The code in many cases return -EINVAL or -EIO instead of original error code from, for example, write_sync(). Following patch will need EPIPE handling, so, let's refactor this where possible (the only

[Qemu-devel] [PATCH] spapr/drc: don't migrate DRC of cold-plugged CPUs and LMBs

2017-06-02 Thread Greg Kurz
As explained in commit 5c0139a8c2f0 ("spapr: fix default DRC state for coldplugged LMBs"), guests expect cold-plugged LMBs to be pre-allocated and unisolated. The same goes for cold-plugged CPUs. While here, let's convert g_assert(false) to the better self documenting g_assert_not_reached(). Sign

Re: [Qemu-devel] [PATCH] virtio-serial: fix segfault on disconnect

2017-06-02 Thread Pankaj Gupta
Hello Stefan, > > Since commit d4c19cdeeb2f1e474bc426a6da261f1d7346eb5b ("virtio-serial: > add missing virtio_detach_element() call") the following commands may > cause QEMU to segfault: > > $ qemu -M accel=kvm -cpu host -m 1G \ > -drive if=virtio,file=test.img,format=raw \ >

[Qemu-devel] [PATCH v3 3/5] vhost-user: add vhost_user to hold the chr

2017-06-02 Thread Maxime Coquelin
From: Marc-André Lureau Next patches will add more fields to the structure Signed-off-by: Marc-André Lureau Signed-off-by: Maxime Coquelin --- hw/virtio/vhost-user.c | 19 --- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/hw/virtio/vhost-user.c b/hw/virtio/vho

[Qemu-devel] [PATCH v3 0/5] vhost-user: Specify and implement device IOTLB support

2017-06-02 Thread Maxime Coquelin
This series aims at specifying ans implementing the protocol update required to support device IOTLB with user backends. In this third non-RFC version, main change is mandating the slave to be able to send IOTLB miss requests for any addresses it needs to access. It implies the removal of patch 3,

[Qemu-devel] [PATCH v3 2/5] vhost: rework IOTLB messaging

2017-06-02 Thread Maxime Coquelin
This patch reworks IOTLB messaging to prepare for vhost-user device IOTLB support. IOTLB messages handling is extracted from vhost-kernel backend, so that only the messages transport remains backend specifics. Signed-off-by: Maxime Coquelin --- hw/virtio/vhost-backend.c | 130 ++

[Qemu-devel] [PATCH v3 4/5] vhost-user: add slave-req-fd support

2017-06-02 Thread Maxime Coquelin
From: Marc-André Lureau Learn to give a socket to the slave to let him make requests to the master. Signed-off-by: Marc-André Lureau Signed-off-by: Maxime Coquelin --- docs/specs/vhost-user.txt | 32 +++- hw/virtio/vhost-user.c| 127 ++

[Qemu-devel] [PATCH v3 1/5] vhost: propagate errors in vhost_device_iotlb_miss()

2017-06-02 Thread Maxime Coquelin
Some backends might want to know when things went wrong. Signed-off-by: Maxime Coquelin --- hw/virtio/vhost.c | 15 ++- include/hw/virtio/vhost.h | 2 +- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/hw/virtio/vhost.c b/hw/virtio/vhost.c index 03a46a7..8fab

[Qemu-devel] [PATCH v3 5/5] spec/vhost-user spec: Add IOMMU support

2017-06-02 Thread Maxime Coquelin
This patch specifies and implements the master/slave communication to support device IOTLB in slave. The vhost_iotlb_msg structure introduced for kernel backends is re-used, making the design close between the two backends. An exception is the use of the secondary channel to enable the slave to s

Re: [Qemu-devel] [PATCH 5/6] hw/misc: add a TMP42{1, 2, 3} device model

2017-06-02 Thread Peter Maydell
On 15 May 2017 at 06:51, Cédric Le Goater wrote: > Largely inspired by the TMP105 temperature sensor, here is a model for > the TMP42{1,2,3} temperature sensors. > > Specs can be found here : > > http://www.ti.com/lit/gpn/tmp421 > > Signed-off-by: Cédric Le Goater This turns out to segfa

Re: [Qemu-devel] [PATCH v1] s390x/cpumodel: wire up cpu type + id for TCG

2017-06-02 Thread David Hildenbrand
>> + >> +#ifndef CONFIG_USER_ONLY >> +void HELPER(stidp)(CPUS390XState *env, uint64_t addr) >> +{ >> +S390CPU *cpu = s390_env_get_cpu(env); >> +uint64_t cpuid = s390_cpuid_from_cpu_model(cpu->model); >> + >> +if (addr & 0x7) { >> +program_interrupt(env, PGM_SPECIFICATION, ILEN_

Re: [Qemu-devel] [PATCH v2 2/4] dump: add vmcoreinfo ELF note

2017-06-02 Thread Marc-André Lureau
HI On Thu, Jun 1, 2017 at 10:38 PM Laszlo Ersek wrote: > On 06/01/17 15:03, Marc-André Lureau wrote: > > Read vmcoreinfo note from guest memory when dump_info provides the > > address, and write it as an ELF note in the dump. > > > > NUMBER(phys_base) in vmcoreinfo has only been recently introdu

Re: [Qemu-devel] [PATCH 04/17] qapi: merge QInt and QFloat in QNum

2017-06-02 Thread Marc-André Lureau
Hi On Fri, Jun 2, 2017 at 10:30 AM Markus Armbruster wrote: > Marc-André Lureau writes: > > > Hi > > > > On Tue, May 30, 2017 at 6:23 PM Markus Armbruster > wrote: > > > >> Marc-André Lureau writes: > >> > >> > Hi > >> > > >> > On Thu, May 11, 2017 at 6:30 PM Markus Armbruster > wrote: > [..

Re: [Qemu-devel] [PATCH v2 14/45] qapi: update the qobject visitor to use QNUM_U64

2017-06-02 Thread Markus Armbruster
Marc-André Lureau writes: > Switch to use QNum/uint where appropriate to remove i64 limitation. > > The input visitor will cast i64 input to u64 for compatibility > reasons (existing json QMP client already use negative i64 for large > u64, and expect an implicit cast in qemu). > > Signed-off-by:

Re: [Qemu-devel] [PATCH v2 14/45] qapi: update the qobject visitor to use QNUM_U64

2017-06-02 Thread Markus Armbruster
One more nitpick: Marc-André Lureau writes: > Switch to use QNum/uint where appropriate to remove i64 limitation. > > The input visitor will cast i64 input to u64 for compatibility > reasons (existing json QMP client already use negative i64 for large > u64, and expect an implicit cast in qemu).

[Qemu-devel] [PATCH v20 30/30] block: release persistent bitmaps on inactivate

2017-06-02 Thread Vladimir Sementsov-Ogievskiy
We should release them here to reload on invalidate cache. Signed-off-by: Vladimir Sementsov-Ogievskiy --- block.c | 4 block/dirty-bitmap.c | 29 +++-- include/block/dirty-bitmap.h | 1 + 3 files changed, 28 insertions(+), 6 deletions(

[Qemu-devel] [PATCH v20 05/30] block: fix bdrv_dirty_bitmap_granularity signature

2017-06-02 Thread Vladimir Sementsov-Ogievskiy
Make getter signature const-correct. This allows other functions with const dirty bitmap parameter use bdrv_dirty_bitmap_granularity(). Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Eric Blake Reviewed-by: John Snow Reviewed-by: Kevin Wolf --- block/dirty-bitmap.c | 2 +- i

  1   2   3   4   >