[Qemu-devel] [RHEL-7.3 qemu-kvm-rhev PATCH] qmp: Report drive_add error to monitor

2016-05-18 Thread Fam Zheng
BZ: https://bugzilla.redhat.com/show_bug.cgi?id=1337100 Brew: 11051815 Upstream: N/A In other error cases of this function we use error_setg, the same should be done with drive_new() failures. This is useful for libvirt to correctly detect the failure and report proper error message when a specifi

Re: [Qemu-devel] [PATCH] block/iscsi: allow caching of the allocation map

2016-05-18 Thread Peter Lieven
Am 18.05.2016 um 09:41 schrieb Fam Zheng: On Tue, 05/17 15:59, Peter Lieven wrote: until now the allocation map was used only as a hint if a cluster is allocated or not. If a block was not allocated (or Qemu had no info about the allocation status) a get_block_status call was issued to check the

Re: [Qemu-devel] [PATCH v4 6/8] i.MX: move FEC device to a register array structure.

2016-05-18 Thread Jean-Christophe DUBOIS
Le 19/05/2016 05:28, Jason Wang a écrit : On 2016年05月19日 06:23, Jean-Christophe Dubois wrote: This is to prepare for the ENET Gb device of the i.MX6. Signed-off-by: Jean-Christophe Dubois --- Changes since v1: * Not present on v1. Changes since v2: * The patch was split in 2 parts:

Re: [Qemu-devel] [PATCH 2/2] block/nfs: refuse readahead if cache.direct is on

2016-05-18 Thread Peter Lieven
Am 18.05.2016 um 15:28 schrieb Jeff Cody: On Tue, May 17, 2016 at 04:11:55PM +0200, Peter Lieven wrote: Signed-off-by: Peter Lieven --- block/nfs.c | 5 + 1 file changed, 5 insertions(+) diff --git a/block/nfs.c b/block/nfs.c index 975510f..8b73a35 100644 --- a/block/nfs.c +++ b/block/n

[Qemu-devel] [PATCH v4 21/28] qstring: Add qstring_wrap_str()

2016-05-18 Thread Eric Blake
Several spots in the code malloc a string, then wrap it in a QString, which has to duplicate the input. Adding a new constructor with transfer semantics makes this pattern more efficient, comparable to the just-added transfer semantics to go from QString back to raw string. Use the new qstring_wr

[Qemu-devel] [PATCH v4 12/28] qapi: Add new visit_complete() function

2016-05-18 Thread Eric Blake
Making each output visitor provide its own output collection function was the only remaining reason for exposing visitor sub-types to the rest of the code base. Add a polymorphic visit_complete() function which is a no-op for input visitors, and which populates an opaque pointer for output visitor

[Qemu-devel] [PATCH v4 28/28] qemu-img: Use new JSON output formatter

2016-05-18 Thread Eric Blake
Now that we can pretty-print straight to JSON from a visitor, we can eliminate the temporary conversion into QObject inside qemu-img. The changes to qemu-iotests 043 expected output demonstrates the fact that output is now done in qapi declaration order, rather than QDict hash order. Signed-off-b

[Qemu-devel] [PATCH v4 27/28] qapi: Add 'any' support to JSON output

2016-05-18 Thread Eric Blake
Now that we can visit any QObject, it's easy to add support for visit_type_any() in the JSON output visitor. Signed-off-by: Eric Blake --- v4: new patch, split out of v3 7/18, but made simpler by not requiring v3 12/18 --- include/qapi/json-output-visitor.h | 2 -- qapi/json-output-visitor.c

[Qemu-devel] [PATCH v4 24/28] qapi: Add JSON output visitor

2016-05-18 Thread Eric Blake
We have several places that want to go from qapi to JSON; right now, they have to create an intermediate QObject to do the work. That also has the drawback that the JSON formatting of a QDict will rearrange keys (according to a deterministic, but unpredictable, hash), when humans have an easier ti

[Qemu-devel] [PATCH v4 17/28] qapi: Factor out JSON number formatting

2016-05-18 Thread Eric Blake
Pull out a new qstring_append_json_number() helper, so that all JSON output producers can use a consistent style for printing floating point without duplicating code (since we are doing more data massaging than a simple printf format can handle). (For now, there is only one client, but later patch

[Qemu-devel] [PATCH v4 26/28] qobject: Implement qobject_to_json() atop JSON visitor

2016-05-18 Thread Eric Blake
Rather than open-code two different JSON visitors, it's nicer to make qobject_to_json() reuse the JSON output visitor. This also lets us pass QObject to any output visitor (passing it to the string output visitor will fail if structs are involved, but passing it to the QMP output visitor would pro

[Qemu-devel] [PATCH v4 13/28] qapi: Add new clone visitor

2016-05-18 Thread Eric Blake
We have a couple places in the code base that want to deep-clone one QAPI object into another, and they were resorting to serializing the struct out to QObject then reparsing it. A much more efficient version can be done by adding a new clone visitor. Since cloning is still relatively uncommon, e

[Qemu-devel] [PATCH v4 19/28] qapi: Use qstring_append_chr() where appropriate

2016-05-18 Thread Eric Blake
qstring_append_chr() is more efficient than qstring_append() when dealing with a one-byte string (including the case of a temporary 2-byte buffer just for creating a dynamic one-byte string). Signed-off-by: Eric Blake --- v4: also convert qstring_append() of one-byte strings v3: no change v2: no

[Qemu-devel] [PATCH v4 25/28] qapi: Support pretty printing in JSON output visitor

2016-05-18 Thread Eric Blake
Similar to pretty printing in the QObject visitor. The trickiest part is probably that the testsuite now has to honor parameterization on whether pretty printing is enabled. Signed-off-by: Eric Blake --- v4: rebase to earlier changes, defer type_any() to later v3: rebase to earlier changes v2:

[Qemu-devel] [PATCH v4 22/28] qobject: Consolidate qobject_to_json() calls

2016-05-18 Thread Eric Blake
It's simpler to have a single conversion function that takes a bool parameter, rather than two functions where the choice of function determines an internal bool. Similar to commit fc471c18. While at it, the conversion currently cannot fail (maybe it SHOULD be possible to choose to fail, when enc

[Qemu-devel] [PATCH v4 16/28] qapi: Factor out JSON string escaping

2016-05-18 Thread Eric Blake
Pull out a new qstring_append_json_string() helper, so that all JSON output producers can use the same output escaping rules. While it appears that vmstate's use of the simpler qjson.c formatter is not currently encountering any string that needs escapes to be valid JSON, it is better to be safe t

[Qemu-devel] [PATCH v4 20/28] qstring: Add qstring_consume_str()

2016-05-18 Thread Eric Blake
Similar to g_string_free(), there are cases where we want to destroy our reference to a QString while grabbing its contents, where we want to avoid use-after-free but also avoid a needless strdup(). But unlike g_string_free(), we are at least sensible enough to add this feature via a different func

[Qemu-devel] [PATCH v4 14/28] sockets: Use new QAPI cloning

2016-05-18 Thread Eric Blake
Rather than rolling our own clone via an expensive conversion in and back out of QObject, use the new clone visitor. Signed-off-by: Eric Blake --- v4: completely drop qapi_copy_SocketAddress(), rebase to earlier changes v3: new patch --- include/io/task.h| 2 +- include/qapi/clone-

[Qemu-devel] [PATCH v4 23/28] tests: Test qobject_to_json() pretty formatting

2016-05-18 Thread Eric Blake
It's risky to refactor qobject_to_json() without at least testing that pretty output remains unchanged :) Note that the new simple_pretty() test is a bit sensitive to our current notion of prettiness, as well as to the hash ordering in QDict (most of the tests in check-qobject-json intentionally d

[Qemu-devel] [PATCH v4 18/28] qapi: Add qstring_append_printf()

2016-05-18 Thread Eric Blake
Back in commit 764c1ca (Nov 2009), we added qstring_append_int(). However, it did not see any use until commit 190c882 (Jan 2015). Furthermore, it has a rather limited use case - to print anything else, callers still have to format into a temporary buffer, unless we want to introduce an explosion o

[Qemu-devel] [PATCH v4 09/28] string-output-visitor: Favor new visit_free() function

2016-05-18 Thread Eric Blake
Now that we have a polymorphic visit_free(), we no longer need string_output_visitor_cleanup(); however, we still need to expose the subtype for string_output_get_string(). Signed-off-by: Eric Blake --- v4: new patch --- include/qapi/string-output-visitor.h | 1 - hmp.c

[Qemu-devel] [PATCH v4 04/28] qapi: Add parameter to visit_end_*

2016-05-18 Thread Eric Blake
Rather than making the dealloc visitor track of stack of pointers remembered during visit_start_* in order to free them during visit_end_*, it's a lot easier to just make all callers pass the same pointer to visit_end_*. The generated code has access to the same pointer, while all other users are

[Qemu-devel] [PATCH v4 15/28] replay: Use new QAPI cloning

2016-05-18 Thread Eric Blake
Rather than rolling our own clone via an expensive conversion in and back out of QObject, use the new clone visitor. Signed-off-by: Eric Blake --- v4: rebase to earlier changes v3: new patch --- replay/replay-input.c | 30 +++--- 1 file changed, 3 insertions(+), 27 delet

[Qemu-devel] [PATCH v4 10/28] qmp-output-visitor: Favor new visit_free() function

2016-05-18 Thread Eric Blake
Now that we have a polymorphic visit_free(), we no longer need qmp_output_visitor_cleanup(); however, we still need to expose the subtype for qmp_output_get_qobject(). Signed-off-by: Eric Blake --- v4: new patch --- include/qapi/qmp-output-visitor.h | 1 - block/qapi.c |

[Qemu-devel] [PATCH v4 06/28] opts-visitor: Favor new visit_free() function

2016-05-18 Thread Eric Blake
Now that we have a polymorphic visit_free(), we no longer need opts_visitor_cleanup(); which in turn means we no longer need to return a subtype from opts_visitor_new() nor a public upcast function. Signed-off-by: Eric Blake --- v4: new patch --- include/qapi/opts-visitor.h | 4 +--- block/cry

[Qemu-devel] [PATCH v4 08/28] qmp-input-visitor: Favor new visit_free() function

2016-05-18 Thread Eric Blake
Now that we have a polymorphic visit_free(), we no longer need qmp_input_visitor_cleanup(); which in turn means we no longer need to return a subtype from qmp_input_visitor_new() nor a public upcast function. Generated code changes to qmp-marshal look like: |@@ -52,11 +52,10 @@ void qmp_marshal_a

[Qemu-devel] [PATCH v4 11/28] tests: Factor out common code in qapi output tests

2016-05-18 Thread Eric Blake
Create a new visitor_get() function to capture common actions taken in collecting output from an output visitor, to make it easier to refactor the output visitors in a later patch. While making test improvements, also use &error_abort and error_free_or_abort() in more places, use the generated qapi

[Qemu-devel] [PATCH v4 07/28] string-input-visitor: Favor new visit_free() function

2016-05-18 Thread Eric Blake
Now that we have a polymorphic visit_free(), we no longer need string_input_visitor_cleanup(); which in turn means we no longer need to return a subtype from string_input_visitor_new() nor a public upcast function. Signed-off-by: Eric Blake --- v4: new patch --- include/qapi/string-input-visito

[Qemu-devel] [PATCH v4 01/28] qapi: Rename (one) qjson.h to qobject-json.h

2016-05-18 Thread Eric Blake
We have two different JSON visitors in the tree; and having both named 'qjson.h' can cause include confusion. Rename the qapi version. Why did I pick that one? A later patch plans on deleting the top-level qjson.c once we have a native JSON output visitor; we could have renamed that one for less

[Qemu-devel] [PATCH v4 03/28] qemu-img: Don't leak errors when outputting JSON

2016-05-18 Thread Eric Blake
If our JSON output ever encounters an error, we would just silently leak the local variable. Instead, assert that our usage won't fail. Signed-off-by: Eric Blake --- v4: new patch (split out from v3 14/18) --- qemu-img.c | 10 -- 1 file changed, 4 insertions(+), 6 deletions(-) diff --

[Qemu-devel] [PATCH v4 05/28] qapi: Add new visit_free() function

2016-05-18 Thread Eric Blake
Making each visitor provide its own (awkwardly-named) FOO_cleanup() is unusual, when we can instead have a polymorphic visit_free() interface. The dealloc visitor is the first one converted to completely use the new entry point, since only generated code and the testsuite were using it. Diffs to

[Qemu-devel] [PATCH v4 02/28] qapi: Improve use of qmp/types.h

2016-05-18 Thread Eric Blake
'qobject-json.h' is not a QObject subtype; include this file directly in .c files that are using it, rather than abusing qmp/types.h for that purpose. Meanwhile, for files that include a list of individual QObject subtypes, it's easier to just use qmp/types.h for that purpose. Signed-off-by: Eric

[Qemu-devel] [PATCH v4 00/28] Add qapi-to-JSON and clone visitors

2016-05-18 Thread Eric Blake
Hard prerequisites (for all patches to apply): Markus' qjson movement: https://lists.gnu.org/archive/html/qemu-devel/2016-05/msg00471.html Soft prerequisites (for valgrind to be happy with all touched tests): My fix for memleak in range.h: https://lists.gnu.org/archive/html/qemu-devel/2016-05/msg0

[Qemu-devel] [Bug 1583421] [NEW] Please provide an option to print the default hardware configuration as command-line options, to make -nodefaults easier to use

2016-05-18 Thread Josh Triplett
Public bug reported: For full customization of the default set of hardware qemu supports, a user can pass -nodefaults and then manually specify each device they want. Many specific options document what they translate to in terms of the full configuration model; however, the defaults for any give

[Qemu-devel] [Bug 1583420] [NEW] Please support "-soundhw none"

2016-05-18 Thread Josh Triplett
Public bug reported: qemu currently provides a default set of sound hardware. The -soundhw option can change that default set, such as by using "-soundhw pcspkr" to disable most of it, but no "-soundhw none" option exists to disable all of it. As far as I can tell, disabling the default sound ha

Re: [Qemu-devel] [PATCH CFT v4 00/52] NEED_CPU_H / cpu.h / hw/hw.h cleanups

2016-05-18 Thread Thomas Huth
On 18.05.2016 18:36, Paolo Bonzini wrote: > This series removes usage of NEED_CPU_H from several central > include files in QEMU, most notably hw/hw.h and qemu-common.h. > Definitions conditional on NEED_CPU_H remain only in disas/disas.h, > exec/gdbstub.h, exec/helper-head.h and exec/log.h. > > T

Re: [Qemu-devel] [PATCH 16/52] target-ppc: make cpu-qom.h not target specific

2016-05-18 Thread Thomas Huth
On 18.05.2016 18:36, Paolo Bonzini wrote: > Make PowerPCCPU an opaque type within cpu-qom.h, and move all definitions > of private methods, as well as all type definitions that require knowledge > of the layout to cpu.h. Conversely, move all definitions needed to define > a class to cpu-qom.h. Th

[Qemu-devel] [PATCH v4 0/4] QOM'ify hw/char devices

2016-05-18 Thread xiaoqiang zhao
This patch set trys to QOM'ify hw/char files, see commit messages for more details Thanks Paolo for your suggestions. Note: * CRIS axis_dev88 broad related test is passed and looks ok. * lm32 test is needed. Changes in v4: * add wrapper functions to create char device * drop the sysbus_create_

Re: [Qemu-devel] [PATCH 15/52] target-ppc: do not make PowerPCCPUClass depend on target-specific symbols

2016-05-18 Thread Thomas Huth
On 18.05.2016 18:36, Paolo Bonzini wrote: > Just leave some members in even if they are unused on e.g. > 32-bit PPC or user-mode emulation. This avoids complications > when using PowerPCCPUClass in code that is compiled just > once (because it applies to both 32-bit and 64-bit PPC > for example) b

Re: [Qemu-devel] [PATCH v4 7/8] Add ENET/Gbps Ethernet support to FEC device

2016-05-18 Thread Jason Wang
On 2016年05月19日 06:23, Jean-Christophe Dubois wrote: The ENET device (present in i.MX6) is "derived" from FEC and backward compatible with it. This patch adds the necessary support of the added feature in the ENET device to allow Linux to use it (on supported processors). Signed-off-by: Jean-C

[Qemu-devel] [PATCH v4 1/4] hw/char: QOM'ify escc.c

2016-05-18 Thread xiaoqiang zhao
* Drop the old SysBus init function and use instance_init * Call qemu_chr_add_handlers in the realize callback Signed-off-by: xiaoqiang zhao --- hw/char/escc.c | 30 +++--- 1 file changed, 19 insertions(+), 11 deletions(-) diff --git a/hw/char/escc.c b/hw/char/escc.c ind

[Qemu-devel] [PATCH v4 2/4] hw/char: QOM'ify etraxfs_ser.c

2016-05-18 Thread xiaoqiang zhao
* Drop the old SysBus init function and use instance_init * Call qemu_chr_add_handlers in the realize callback * Use qdev chardev prop instead of qemu_char_get_next_serial * Add etraxfs_ser_create function to create etraxfs serial device Signed-off-by: xiaoqiang zhao --- hw/char/etraxfs_ser.c

[Qemu-devel] [PATCH v4 4/4] hw/char: QOM'ify lm32_uart.c

2016-05-18 Thread xiaoqiang zhao
* Drop the old SysBus init function and use instance_init * Call qemu_chr_add_handlers in the realize callback * Use qdev chardev prop instead of qemu_char_get_next_serial * Add lm32_uart_create function to create lm32 uart device Signed-off-by: xiaoqiang zhao --- hw/char/lm32_uart.c | 28

[Qemu-devel] [PATCH v4 3/4] hw/char: QOM'ify lm32_juart.c

2016-05-18 Thread xiaoqiang zhao
* Drop the old SysBus init function * Call qemu_chr_add_handlers in the realize callback * Use qdev chardev prop instead of qemu_char_get_next_serial Signed-off-by: xiaoqiang zhao --- hw/char/lm32_juart.c | 17 - hw/lm32/lm32.h | 4 2 files changed, 12 insertions(+),

Re: [Qemu-devel] [PATCH v4 6/8] i.MX: move FEC device to a register array structure.

2016-05-18 Thread Jason Wang
On 2016年05月19日 06:23, Jean-Christophe Dubois wrote: This is to prepare for the ENET Gb device of the i.MX6. Signed-off-by: Jean-Christophe Dubois --- Changes since v1: * Not present on v1. Changes since v2: * The patch was split in 2 parts: - a "port" to a reg array based device (th

Re: [Qemu-devel] [PATCH 11/12] vfio: register aer resume notification handler for aer resume

2016-05-18 Thread Zhou Jie
On 2016/5/19 10:18, Alex Williamson wrote: On Thu, 19 May 2016 09:49:00 +0800 Zhou Jie wrote: On 2016/5/19 2:26, Alex Williamson wrote: On Wed, 18 May 2016 11:31:09 +0800 Zhou Jie wrote: From: Chen Fan For supporting aer recovery, host and guest would run the same aer recovery code, th

Re: [Qemu-devel] [PATCH 11/12] vfio: register aer resume notification handler for aer resume

2016-05-18 Thread Zhou Jie
On 2016/5/19 10:18, Alex Williamson wrote: On Thu, 19 May 2016 09:49:00 +0800 Zhou Jie wrote: On 2016/5/19 2:26, Alex Williamson wrote: On Wed, 18 May 2016 11:31:09 +0800 Zhou Jie wrote: From: Chen Fan For supporting aer recovery, host and guest would run the same aer recovery code, th

Re: [Qemu-devel] [PATCH 11/12] vfio: register aer resume notification handler for aer resume

2016-05-18 Thread Alex Williamson
On Thu, 19 May 2016 09:49:00 +0800 Zhou Jie wrote: > On 2016/5/19 2:26, Alex Williamson wrote: > > On Wed, 18 May 2016 11:31:09 +0800 > > Zhou Jie wrote: > > > >> From: Chen Fan > >> > >> For supporting aer recovery, host and guest would run the same aer > >> recovery code, that would do the

Re: [Qemu-devel] [PATCH 11/12] vfio: register aer resume notification handler for aer resume

2016-05-18 Thread Zhou Jie
On 2016/5/19 2:26, Alex Williamson wrote: On Wed, 18 May 2016 11:31:09 +0800 Zhou Jie wrote: From: Chen Fan For supporting aer recovery, host and guest would run the same aer recovery code, that would do the secondary bus reset if the error is fatal, the aer recovery process: 1. error_de

[Qemu-devel] [PATCH v2 1/2] backup: Fail early if cannot determine cluster size

2016-05-18 Thread Fam Zheng
Otherwise the job is orphaned and block_job_cancel_sync in bdrv_close_all() when quitting will trigger assertion failure. Cc: qemu-sta...@nongnu.org Reviewed-by: John Snow Reviewed-by: Jeff Cody Signed-off-by: Fam Zheng --- block/backup.c | 34 ++ 1 file changed

[Qemu-devel] [PATCH v2 2/2] iotests: Add regression test for drive-backup cluster size error

2016-05-18 Thread Fam Zheng
Signed-off-by: Fam Zheng --- tests/qemu-iotests/055 | 13 + tests/qemu-iotests/055.out | 4 ++-- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/tests/qemu-iotests/055 b/tests/qemu-iotests/055 index c8e3578..7f990c2 100755 --- a/tests/qemu-iotests/055 +++ b/tests/

[Qemu-devel] [PATCH v2 0/2] backup: Fail early if cannot determine cluster size

2016-05-18 Thread Fam Zheng
v2: More accurately, s:hang:trigger assertion failure: in the bug fix patch commit message. Add John's and Jeff's R-b. Add a test. [Eric] Fam Zheng (2): backup: Fail early if cannot determine cluster size iotests: Add regression test for drive-backup cluster size error block/ba

Re: [Qemu-devel] [PATCH v2 1/1] block: clarify error message for qmp-eject

2016-05-18 Thread Fam Zheng
On Wed, 05/18 17:53, John Snow wrote: > If you use HMP's eject but the CDROM tray is locked, you may get a > confusing error message informing you that the "tray isn't open." > > As this is the point of eject, we can do a little better and help > clarify that the tray was locked and that it (might

Re: [Qemu-devel] [PATCH] backup: Fail early if cannot determine cluster size

2016-05-18 Thread Fam Zheng
On Wed, 05/18 08:25, Eric Blake wrote: > On 05/17/2016 11:53 PM, Fam Zheng wrote: > > Otherwise the job is orphaned and block_job_cancel_sync in > > bdrv_close_all() when quiting will hang. > > s/quiting/quitting/ > > > > > A simple reproducer is running blockdev-backup from null-co:// to > > nu

[Qemu-devel] [PATCH v4 6/8] i.MX: move FEC device to a register array structure.

2016-05-18 Thread Jean-Christophe Dubois
This is to prepare for the ENET Gb device of the i.MX6. Signed-off-by: Jean-Christophe Dubois --- Changes since v1: * Not present on v1. Changes since v2: * The patch was split in 2 parts: - a "port" to a reg array based device (this patch). - the addition of the Gb support (next patch

[Qemu-devel] [PATCH v4 8/8] Add ENET device to i.MX6 SOC.

2016-05-18 Thread Jean-Christophe Dubois
This adds the ENET device to the i.MX6 SOC. This was tested by booting Linux on an Qemu i.MX6 instance and accessing the internet from the linux guest. Reviewed-by: Peter Maydell Signed-off-by: Jean-Christophe Dubois --- Changes since v1: * Not present on v1 Changes since v2: * None Ch

[Qemu-devel] [PATCH v4 7/8] Add ENET/Gbps Ethernet support to FEC device

2016-05-18 Thread Jean-Christophe Dubois
The ENET device (present in i.MX6) is "derived" from FEC and backward compatible with it. This patch adds the necessary support of the added feature in the ENET device to allow Linux to use it (on supported processors). Signed-off-by: Jean-Christophe Dubois --- Changes since v1: * Not present

[Qemu-devel] [PATCH v4 1/8] net: improve UDP/TCP checksum computation.

2016-05-18 Thread Jean-Christophe Dubois
* based on Eth, UDP, TCP struct present in eth.h instead of hardcoded indexes and sizes. * based on various macros present in eth.h. Signed-off-by: Jean-Christophe Dubois --- Changes since v1: * None Changes since v2: * The patch was split in 2 parts: - a rewrite of the TCP/UDB check

[Qemu-devel] [PATCH v4 5/8] i.MX: Fix FEC code for ECR register reset value.

2016-05-18 Thread Jean-Christophe Dubois
According to the FEC chapter of i.MX25 reference manual ECR register is initialized at 0xf000 at reset time. We fix the value. Signed-off-by: Jean-Christophe Dubois --- Changes since v1: * Not present on v1 Changes since v2: * Not present on v2 Changes since v3: * Not present on v3

[Qemu-devel] [PATCH v4 3/8] i.MX: Fix FEC code for MDIO operation selection

2016-05-18 Thread Jean-Christophe Dubois
According to the FEC chapter of i.MX25 reference manual When writing the MMFR register, bit 29 and 28 select the requested operation. * 10 means read operation with valid MII mgmt frame * 11 means read operation with non compliant MII mgmt frame * 01 means write operation with valid MII mgmt fr

[Qemu-devel] [PATCH v4 2/8] net: handle optional VLAN header in checksum computation.

2016-05-18 Thread Jean-Christophe Dubois
Signed-off-by: Jean-Christophe Dubois --- Changes since v1: * Not present on v1 Changes since v2: * Not present on v2 Changes since v3: * local variable name change. net/checksum.c | 35 +++ 1 file changed, 31 insertions(+), 4 deletions(-) diff --git a/net

[Qemu-devel] [PATCH v4 4/8] i.MX: Fix FEC code for MDIO address selection

2016-05-18 Thread Jean-Christophe Dubois
According to the FEC chapter of i.MX25 reference manual When writing to MMFR register, the MDIO device and adress are selected by bit 27 to 23 and bit 22 to 18 respectively. This is a total of 10 bits that need to be used by the Phy chip/address decoding function. This patch fixes the number of b

[Qemu-devel] [PATCH v4 0/8] Add Ethernet device for i.MX6 SOC

2016-05-18 Thread Jean-Christophe Dubois
This patch series adds Gb ENET Ethernet device to the i.MX6 SOC. The ENET device is an evolution of the FEC device present on the i.MX25 SOC and is backward compatible with it. Therefore the ENET support has been added to the actual Qemu FEC device ( rather than adding a new device). The Patch h

Re: [Qemu-devel] [PATCH v2 1/1] block: clarify error message for qmp-eject

2016-05-18 Thread Eric Blake
On 05/18/2016 03:53 PM, John Snow wrote: > If you use HMP's eject but the CDROM tray is locked, you may get a > confusing error message informing you that the "tray isn't open." > > As this is the point of eject, we can do a little better and help > clarify that the tray was locked and that it (mi

[Qemu-devel] [PATCH v2 1/1] block: clarify error message for qmp-eject

2016-05-18 Thread John Snow
If you use HMP's eject but the CDROM tray is locked, you may get a confusing error message informing you that the "tray isn't open." As this is the point of eject, we can do a little better and help clarify that the tray was locked and that it (might) open up later, so try again. It's not ideal,

[Qemu-devel] [PATCH v2 0/1] block: clarify error message for qmp-eject

2016-05-18 Thread John Snow
v2: Reduce helper to just one parameter, push has_force logic back up into qmp interfaces. Always return -errno if we set errp, return +errno on soft errors where errp remains unset. John Snow (1): block: clarify error message for qmp-eject blockdev.c | 51

[Qemu-devel] [PATCH] json-streamer: Don't leak tokens on incomplete parse

2016-05-18 Thread Eric Blake
Valgrind complained about a number of leaks in tests/check-qobject-json: ==12657==definitely lost: 17,247 bytes in 1,234 blocks All of which had the same root cause: on an incomplete parse, we were abandoning the token queue without cleaning up the allocated data within each queue element. I

Re: [Qemu-devel] [PATCH v5 07/18] qemu-thread: add simple test-and-set spinlock

2016-05-18 Thread Sergey Fedorov
On 18/05/16 23:52, Emilio G. Cota wrote: > On Wed, May 18, 2016 at 22:51:09 +0300, Sergey Fedorov wrote: >> On 14/05/16 06:34, Emilio G. Cota wrote: >>> +static inline void qemu_spin_lock(QemuSpin *spin) >>> +{ >>> +while (atomic_test_and_set_acquire(&spin->value)) { >> A possible optimization

Re: [Qemu-devel] [PATCH v5 07/18] qemu-thread: add simple test-and-set spinlock

2016-05-18 Thread Emilio G. Cota
On Wed, May 18, 2016 at 22:51:09 +0300, Sergey Fedorov wrote: > On 14/05/16 06:34, Emilio G. Cota wrote: > > +static inline void qemu_spin_lock(QemuSpin *spin) > > +{ > > +while (atomic_test_and_set_acquire(&spin->value)) { > > A possible optimization might be using unlikely() here, copmare:

Re: [Qemu-devel] [PATCH v5 07/18] qemu-thread: add simple test-and-set spinlock

2016-05-18 Thread Sergey Fedorov
On 14/05/16 06:34, Emilio G. Cota wrote: > +static inline void qemu_spin_lock(QemuSpin *spin) > +{ > +while (atomic_test_and_set_acquire(&spin->value)) { A possible optimization might be using unlikely() here, copmare: spin.o: file format elf64-littleaarch64 Disassembly of section .text

Re: [Qemu-devel] [PATCH v6 8/8] vfio/pci: Add IGD documentation

2016-05-18 Thread Eric Blake
On 05/18/2016 12:35 PM, Alex Williamson wrote: >> Without an explicit copyright notice and license, your documentation >> defaults to GPLv2+, per the top level COPYING. If you want something >> else, it may be worth explicitly calling it out. >> >> Otherwise, it was a good read. > > > Thanks fo

Re: [Qemu-devel] [PATCH v5 07/18] qemu-thread: add simple test-and-set spinlock

2016-05-18 Thread Emilio G. Cota
On Wed, May 18, 2016 at 21:21:26 +0300, Sergey Fedorov wrote: > On 14/05/16 06:34, Emilio G. Cota wrote: > > +static inline int qemu_spin_trylock(QemuSpin *spin) > > +{ > > +if (atomic_test_and_set_acquire(&spin->value)) { > > +return -EBUSY; > > Seems this should be: > > return E

Re: [Qemu-devel] [PATCH] qdev: Use GList for global properties

2016-05-18 Thread Eduardo Habkost
On Thu, May 12, 2016 at 06:22:36PM +0200, Andreas Färber wrote: > Am 12.05.2016 um 14:26 schrieb Eduardo Habkost: > > On Fri, Jan 29, 2016 at 12:15:12PM -0200, Eduardo Habkost wrote: > >> On Thu, Jan 28, 2016 at 07:01:12PM +0200, Michael S. Tsirkin wrote: > >>> On Thu, Jan 28, 2016 at 01:02:26PM -0

Re: [Qemu-devel] [PATCH v3 2/2] trace: [all] Add "guest_mem_before" event

2016-05-18 Thread Lluís Vilanova
Richard Henderson writes: > On 05/18/2016 03:47 AM, Lluís Vilanova wrote: >> Signed-off-by: Lluís Vilanova >> --- >> include/exec/cpu_ldst_template.h | 25 >> include/exec/cpu_ldst_useronly_template.h | 22 ++ >> tcg/tcg-op.c |

Re: [Qemu-devel] vfio IGD assignment (was Re: [PATCH v6 0/8] Series short description)

2016-05-18 Thread Alex Williamson
On Wed, 18 May 2016 16:24:49 +0200 Gerd Hoffmann wrote: > Hi, > > > I believe we're no longer blocked by SeaBIOS being willing to > > consume the new fw_cfg entries, so barring feedback otherwise, my > > plan will be to send a pull request including these changes (after > > an appropriate revi

Re: [Qemu-devel] [PATCH v5 04/18] include/processor.h: define cpu_relax()

2016-05-18 Thread Sergey Fedorov
On 18/05/16 21:29, Emilio G. Cota wrote: > On Wed, May 18, 2016 at 20:47:56 +0300, Sergey Fedorov wrote: >> Why don't do like this: >> >> #if defined(__foo__) >> # define ... >> #elif defined(__bar__) >> # define ... >> #else >> # define ... >> #endif > Good point. Changed to: > > commit ad31d6c

Re: [Qemu-devel] [PATCH v6 8/8] vfio/pci: Add IGD documentation

2016-05-18 Thread Alex Williamson
On Tue, 17 May 2016 20:23:42 -0600 Eric Blake wrote: > On 05/17/2016 02:20 PM, Alex Williamson wrote: > > Document the usage modes, host primary graphics considerations, usage, > > and fw_cfg ABI required for IGD assignment with vfio. > > > > Signed-off-by: Alex Williamson > > --- > > docs/igd

Re: [Qemu-devel] [PATCH v5 04/18] include/processor.h: define cpu_relax()

2016-05-18 Thread Emilio G. Cota
On Wed, May 18, 2016 at 20:47:56 +0300, Sergey Fedorov wrote: > Why don't do like this: > > #if defined(__foo__) > # define ... > #elif defined(__bar__) > # define ... > #else > # define ... > #endif Good point. Changed to: commit ad31d6cff8e309e41bd4bed110f173e473c27c5a Author: Emilio G. Cot

Re: [Qemu-devel] [PATCH 11/12] vfio: register aer resume notification handler for aer resume

2016-05-18 Thread Alex Williamson
On Wed, 18 May 2016 11:31:09 +0800 Zhou Jie wrote: > From: Chen Fan > > For supporting aer recovery, host and guest would run the same aer > recovery code, that would do the secondary bus reset if the error > is fatal, the aer recovery process: > 1. error_detected > 2. reset_link (if fatal)

Re: [Qemu-devel] [PATCH v5 07/18] qemu-thread: add simple test-and-set spinlock

2016-05-18 Thread Sergey Fedorov
On 14/05/16 06:34, Emilio G. Cota wrote: > +static inline int qemu_spin_trylock(QemuSpin *spin) > +{ > +if (atomic_test_and_set_acquire(&spin->value)) { > +return -EBUSY; Seems this should be: return EBUSY; > +} > +return 0; > +}

Re: [Qemu-devel] [PATCH v3 1/2] exec: [tcg] Track which vCPU is performing translation and execution

2016-05-18 Thread Richard Henderson
On 05/18/2016 03:47 AM, Lluís Vilanova wrote: > Information is tracked inside the TCGContext structure, and later used > by tracing events with the 'tcg' and 'vcpu' properties. > > The 'cpu' field is used to check tracing of translation-time > events ("*_trans"). The 'tcg_env' field is used to pas

Re: [Qemu-devel] [PATCH v3 2/2] trace: [all] Add "guest_mem_before" event

2016-05-18 Thread Richard Henderson
On 05/18/2016 03:47 AM, Lluís Vilanova wrote: > Signed-off-by: Lluís Vilanova > --- > include/exec/cpu_ldst_template.h | 25 > include/exec/cpu_ldst_useronly_template.h | 22 ++ > tcg/tcg-op.c | 32 ++-- > tr

Re: [Qemu-devel] [PATCH v5 04/18] include/processor.h: define cpu_relax()

2016-05-18 Thread Sergey Fedorov
On 14/05/16 06:34, Emilio G. Cota wrote: > Taken from the linux kernel. > > Reviewed-by: Richard Henderson > Reviewed-by: Alex Bennée > Signed-off-by: Emilio G. Cota > --- > include/qemu/processor.h | 34 ++ > 1 file changed, 34 insertions(+) > create mode 10064

Re: [Qemu-devel] Question about vNVDIMM file format

2016-05-18 Thread Richard W.M. Jones
I thought you might be interested in some performance results, "hot off the presses". With DAX enabled, I see the following messages in the guest kernel logs, which I assume means it is working: [0.469364] EXT4-fs (pmem0): DAX enabled. Warning: EXPERIMENTAL, use at your own risk [0.46993

[Qemu-devel] [PATCH] virtio-gpu: check early scanout id

2016-05-18 Thread marcandre . lureau
From: Marc-André Lureau Before accessing the g->scanout array, in order to avoid potential out-of-bounds access. Signed-off-by: Marc-André Lureau --- hw/display/virtio-gpu.c | 19 +-- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/hw/display/virtio-gpu.c b/hw/di

Re: [Qemu-devel] [PATCH v5 07/18] qemu-thread: add simple test-and-set spinlock

2016-05-18 Thread Paolo Bonzini
On 18/05/2016 18:59, Emilio G. Cota wrote: > On Wed, May 18, 2016 at 17:09:48 +0200, Paolo Bonzini wrote: >> But honestly I think it would be even better to just use >> __sync_lock_test_and_set in the spinlock implementation and not add this >> to atomics.h. There's already enough issues with th

Re: [Qemu-devel] [PATCH v5 07/18] qemu-thread: add simple test-and-set spinlock

2016-05-18 Thread Emilio G. Cota
On Wed, May 18, 2016 at 17:09:48 +0200, Paolo Bonzini wrote: > But honestly I think it would be even better to just use > __sync_lock_test_and_set in the spinlock implementation and not add this > to atomics.h. There's already enough issues with the current subset of > atomics, I am not really hap

Re: [Qemu-devel] [PATCH v6 6/8] vfio/pci: Intel graphics legacy mode assignment

2016-05-18 Thread Alex Williamson
On Wed, 18 May 2016 16:21:58 +0200 Gerd Hoffmann wrote: > On Di, 2016-05-17 at 14:19 -0600, Alex Williamson wrote: > > +static int igd_gen(VFIOPCIDevice *vdev) > > +{ > > +if ((vdev->device_id & 0xfff) == 0xa84) { > > +return 8; /* Broxton */ > > +} > > + > > +switch (vdev->de

Re: [Qemu-devel] [PATCH 1/3] ui: egl: Replace fprintf with error_report

2016-05-18 Thread Eric Blake
On 05/18/2016 10:40 AM, Cole Robinson wrote: > Signed-off-by: Cole Robinson > --- > ui/egl-helpers.c | 27 ++- > 1 file changed, 14 insertions(+), 13 deletions(-) Reviewed-by: Eric Blake -- Eric Blake eblake redhat com+1-919-301-3266 Libvirt virtualization librar

Re: [Qemu-devel] [PATCH 02/52] s390x: move vregs_needed to machine.c

2016-05-18 Thread Cornelia Huck
On Wed, 18 May 2016 18:36:15 +0200 Paolo Bonzini wrote: > It is only needed in one file, move it there. > > Signed-off-by: Paolo Bonzini > --- > target-s390x/cpu.h | 15 --- > target-s390x/machine.c | 10 ++ > 2 files changed, 10 insertions(+), 15 deletions(-) Acked-by

[Qemu-devel] [PATCH 15/52] target-ppc: do not make PowerPCCPUClass depend on target-specific symbols

2016-05-18 Thread Paolo Bonzini
Just leave some members in even if they are unused on e.g. 32-bit PPC or user-mode emulation. This avoids complications when using PowerPCCPUClass in code that is compiled just once (because it applies to both 32-bit and 64-bit PPC for example) but still needs to peek at PPC-specific members. Sig

[Qemu-devel] [PATCH 2/3] ui: spice: Exit if gl=on EGL init fails

2016-05-18 Thread Cole Robinson
The user explicitly requested spice GL, so if we know it isn't going to work we should exit Signed-off-by: Cole Robinson --- For example, trying to use spice GL with libvirt qemu:///system will fail here, since the the VM will lack permissions to access /dev/dir/renderD* ui/spice-core.c | 6 +++

[Qemu-devel] [PATCH 3/3] virtio-gpu: Warn if UI config will disable virgl

2016-05-18 Thread Cole Robinson
Give users a hint if their config is wrong. Signed-off-by: Cole Robinson --- If virgl support is built into qemu, virgl=on is the default, so this could be noisy in cases where people don't even care about virgl. So I won't object if this is dropped. The message also pops up once via make check,

[Qemu-devel] [PATCH CFT v4 00/52] NEED_CPU_H / cpu.h / hw/hw.h cleanups

2016-05-18 Thread Paolo Bonzini
This series removes usage of NEED_CPU_H from several central include files in QEMU, most notably hw/hw.h and qemu-common.h. Definitions conditional on NEED_CPU_H remain only in disas/disas.h, exec/gdbstub.h, exec/helper-head.h and exec/log.h. The interesting patches are interspersed with other mis

[Qemu-devel] [PATCH 1/3] ui: egl: Replace fprintf with error_report

2016-05-18 Thread Cole Robinson
Signed-off-by: Cole Robinson --- ui/egl-helpers.c | 27 ++- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/ui/egl-helpers.c b/ui/egl-helpers.c index 558edfd..6555f5f 100644 --- a/ui/egl-helpers.c +++ b/ui/egl-helpers.c @@ -2,6 +2,7 @@ #include #include

[Qemu-devel] [PATCH 16/52] target-ppc: make cpu-qom.h not target specific

2016-05-18 Thread Paolo Bonzini
Make PowerPCCPU an opaque type within cpu-qom.h, and move all definitions of private methods, as well as all type definitions that require knowledge of the layout to cpu.h. Conversely, move all definitions needed to define a class to cpu-qom.h. This helps making files independent of NEED_CPU_H if

[Qemu-devel] [PATCH 22/52] target-xtensa: make cpu-qom.h not target specific

2016-05-18 Thread Paolo Bonzini
Make XtensaCPU an opaque type within cpu-qom.h, and move all definitions of private methods, as well as all type definitions that require knowledge of the layout to cpu.h. Conversely, move all definitions needed to define a class to cpu-qom.h. This helps making files independent of NEED_CPU_H if

[Qemu-devel] [PATCH 0/3] ui: improve feedback if gl setup fails

2016-05-18 Thread Cole Robinson
patch 1 is just a cleanup, patch 2-3 improves feedback for invalid gl configs (which would have saved me an hour of head scratching) Cole Robinson (3): ui: egl: Replace fprintf with error_report ui: spice: Exit if gl=on EGL init fails virtio-gpu: Warn if UI config will disable virgl hw/dis

[Qemu-devel] [PATCH 14/52] target-ppc: do not use target_ulong in cpu-qom.h

2016-05-18 Thread Paolo Bonzini
Bring the PowerPCCPUClass handle_mmu_fault method type into line with the one in CPUClass. Using vaddr also makes the cpu-qom.h file target independent. Signed-off-by: Paolo Bonzini --- target-ppc/cpu-qom.h| 3 +-- target-ppc/mmu-hash32.c | 2 +- target-ppc/mmu-hash32.h | 2 +- target-ppc/m

[Qemu-devel] [PATCH 32/52] explicitly include linux/kvm.h

2016-05-18 Thread Paolo Bonzini
Signed-off-by: Paolo Bonzini --- hw/i386/kvm/i8254.c | 1 + hw/i386/kvm/pci-assign.c | 1 + hw/intc/xics_kvm.c | 1 + hw/vfio/common.c | 3 +++ 4 files changed, 6 insertions(+) diff --git a/hw/i386/kvm/i8254.c b/hw/i386/kvm/i8254.c index a4462e5..734992e 100644 --- a/hw/i386/k

  1   2   3   >