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

2016-05-18 Thread Fam Zheng
On Wed, 05/18 07:36, Markus Armbruster wrote: > Fam Zheng writes: > > > On Tue, 05/17 20:42, 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

Re: [Qemu-devel] [PATCH] block/rbd: add .bdrv_reopen_prepare() stub

2016-05-18 Thread Sebastian Färber
> > There's no need to reset the librados state, so connections to the > cluster can stick around. I'm a bit unclear on the bdrv_reopen_* > functions though - what is their intended use and semantics? My motivation for implementing this basic reopen support is getting active block commit in qemu

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

2016-05-18 Thread 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 allocation status and possibly

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

2016-05-18 Thread Xiao Guangrong
Hi Rich, On 05/17/2016 02:25 AM, Richard W.M. Jones wrote: On Mon, May 16, 2016 at 09:53:36AM -0700, Stefan Hajnoczi wrote: On Mon, May 16, 2016 at 04:04:01PM +0100, Richard W.M. Jones wrote: I'm playing with ext4 and DAX. I'm using: -object

[Qemu-devel] [PATCH v4 2/6] pc: Postpone SMBIOS table installation to post machine init

2016-05-18 Thread minyard
From: Corey Minyard This is the same place that the ACPI SSDT table gets added, so that devices can add themselves to the SMBIOS table. Signed-off-by: Corey Minyard --- hw/i386/pc.c | 11 ++- 1 file changed, 6 insertions(+), 5 deletions(-)

[Qemu-devel] [PATCH v4 1/6] ipmi: rework the fwinfo to be fetched from the interface

2016-05-18 Thread minyard
From: Corey Minyard Instead of scanning IPMI devices from a fwinfo list, allow the fwinfo to be fetched from the IPMI interface class. Then the code looking for IPMI fwinfo can scan devices on a bus and look for ones that implement the IPMI class. This will let the ACPI

[Qemu-devel] [PATCH v4 0/6] Add IPMI to firmware tables

2016-05-18 Thread minyard
Ok, I think I have this right now. This changes the code to scan the busses for the IPMI devices. I was kind of stuck on the SMBIOS, since there's really no bus to scan there, but for that I just scan the entire system. This required some rework of the IPMI code to fetch the firmware info from

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

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(>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 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

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

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] [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

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(>value)) { > > +return -EBUSY; > > Seems this should be: > > return EBUSY;

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 > >

[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.

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

[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

[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

[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

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(>value)) { >> A possible optimization might

[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

[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

[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:

[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

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(>value)) { > > A possible optimization might be using unlikely() here, copmare:

[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

[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

[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

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 > >

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

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

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

[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 ---

[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

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

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

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)

[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 *

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. > >

[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 ---

[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

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.

[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 ---

[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 |

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

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:

[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

[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

[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

[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 +-

[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

[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

[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

[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

[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

[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

[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

[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

[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 _abort and error_free_or_abort() in more places, use the generated

[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 ---

[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

[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 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

[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

[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:

[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

[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:

[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

[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

[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 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

[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,

[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 --

[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.

[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

[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

Re: [Qemu-devel] [kvm-unit-tests PATCH 00/10] arm/arm64: add gic framework

2016-05-18 Thread Christoffer Dall
Hi Drew, Thanks for doing this. I'm happy to see some tests for the GIC. I've been pondering with how to write unit tests for all the MMIO implementations. If you have some thoughts on how that could be easily fitted into this framework, that would probably be a good place to do it ;)

Re: [Qemu-devel] [PATCH v18 7/8] Implement new driver for block replication

2016-05-18 Thread Changlong Xie
On 05/06/2016 11:46 PM, Stefan Hajnoczi wrote: On Fri, Apr 15, 2016 at 04:10:37PM +0800, Changlong Xie wrote: +static void replication_close(BlockDriverState *bs) +{ +BDRVReplicationState *s = bs->opaque; + +if (s->mode == REPLICATION_MODE_SECONDARY) { +g_free(s->top_id); +}

Re: [Qemu-devel] [PATCH] pci_register_bar: cleanup

2016-05-18 Thread Cao jin
I guess maybe this one is more suitable for trivial. mjt, could you help to pick it up? On 05/18/2016 09:38 AM, Cao jin wrote: ping? On 05/12/2016 09:39 AM, Cao jin wrote: Hi, Since it has been Reviewed-by: Paolo Bonzini for almost 2 months, is it forgot to

Re: [Qemu-devel] [PATCH] pci_register_bar: cleanup

2016-05-18 Thread Cao jin
Ok, I see. Thanks Paolo Cao. On 05/18/2016 08:17 PM, Paolo Bonzini wrote: On 18/05/2016 14:16, Cao jin wrote: I guess maybe this one is more suitable for trivial. No, it's not trivial. I guess it missed soft freeze. Michael Tsirkin will pick it up. Thanks, Paolo diff --git

[Qemu-devel] [PULL 03/13] loader: fix potential memory leak

2016-05-18 Thread Michael Tokarev
From: Cao jin Signed-off-by: Cao jin Signed-off-by: Michael Tokarev --- hw/core/loader.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/hw/core/loader.c b/hw/core/loader.c index c049957..53e0e41 100644 ---

[Qemu-devel] [PULL 10/13] accel: make configure_accelerator return void

2016-05-18 Thread Michael Tokarev
From: Wei Jiangang Return the negated value of accel_initialised is meaningless, and the caller vl doesn't check it. Signed-off-by: Wei Jiangang Signed-off-by: Michael Tokarev --- accel.c| 4 +---

[Qemu-devel] [PULL 07/13] util: fix comment typos

2016-05-18 Thread Michael Tokarev
From: Wei Jiangang Signed-off-by: Wei Jiangang Reviewed-by: Eric Blake Signed-off-by: Michael Tokarev --- util/buffer.c | 4 ++-- util/qemu-sockets.c | 2 +- 2 files changed, 3 insertions(+), 3

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

2016-05-18 Thread 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/nfs.c > @@

[Qemu-devel] [Bug 1477538] Re: Windows QEMU Guest Agent VSS Provider service stops during qemu backup

2016-05-18 Thread Joop Martens
Hello Ravi, You can find it at the Fedora Windows VirtIO Drivers wiki page that I provided in my first post. Here's a direct link to the latest 7.2.1 guest agent: https://fedorapeople.org/groups/virt/virtio-win/direct-downloads/archive-qemu-ga/qemu-ga-win-7.2.1-1/ -- You received this bug

Re: [Qemu-devel] [PATCH v2] qdev: Clean up around properties

2016-05-18 Thread Cao jin
Hi Michael, I guess you missed this one:) On 05/11/2016 04:24 PM, Cao jin wrote: For mjt`s information: it has been Reviewed-by: Markus Armbruster On 05/10/2016 08:52 PM, Paolo Bonzini wrote: Just comments, so Cc: qemu-triv...@nongnu.org On 17/04/2016 09:45, Cao jin

[Qemu-devel] [PULL 02/13] remove comment for nonexistent structure member

2016-05-18 Thread Michael Tokarev
From: Cao jin Signed-off-by: Cao jin Signed-off-by: Michael Tokarev --- include/sysemu/hostmem.h | 1 - 1 file changed, 1 deletion(-) diff --git a/include/sysemu/hostmem.h b/include/sysemu/hostmem.h index a19801d..4d6617e

[Qemu-devel] [PULL 01/13] s390: remove misleading comment

2016-05-18 Thread Michael Tokarev
The comment talks about a non-ELF object while the example gives ELF object. Signed-off-by: Michael Tokarev --- hw/s390x/ipl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/s390x/ipl.c b/hw/s390x/ipl.c index 5786b5e..e6bf7cf 100644 --- a/hw/s390x/ipl.c

[Qemu-devel] [PULL 09/13] configure: Use uniform description for devel packages

2016-05-18 Thread Michael Tokarev
From: Stefan Weil As all other devel packages are written in the form "name devel", use this form for libcap devel and libattr devel, too. Signed-off-by: Stefan Weil Signed-off-by: Michael Tokarev --- configure | 2 +- 1 file changed, 1

[Qemu-devel] [PATCH v2 3/3] qemu-iotests: Some more write_zeroes tests

2016-05-18 Thread Kevin Wolf
This covers some more write_zeroes cases which are relevant for the recent qcow2 optimisations that check the allocation status of the backing file for partial cluster write_zeroes requests. This needs to be separate from 034 because we can only support qcow2 in this test case for multiple

[Qemu-devel] [PATCH trivial] hw/ipmi: fix spelling

2016-05-18 Thread Michael Tokarev
Signed-off-by: Michael Tokarev --- hw/ipmi/ipmi_bmc_extern.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/ipmi/ipmi_bmc_extern.c b/hw/ipmi/ipmi_bmc_extern.c index fe12112..157879e 100644 --- a/hw/ipmi/ipmi_bmc_extern.c +++ b/hw/ipmi/ipmi_bmc_extern.c @@

[Qemu-devel] [PATCH trivial] docs: "specify" spell fix

2016-05-18 Thread Michael Tokarev
Signed-off-by: Michael Tokarev --- docs/qapi-code-gen.txt | 2 +- qemu-options.hx| 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/qapi-code-gen.txt b/docs/qapi-code-gen.txt index d7d6987..eff2075 100644 --- a/docs/qapi-code-gen.txt +++

[Qemu-devel] [PULL 11/13] smbios: fix typo

2016-05-18 Thread Michael Tokarev
From: Cao jin The spec says: "on paragraph (16-byte) boundaries" Signed-off-by: Cao jin Signed-off-by: Michael Tokarev --- include/hw/smbios/smbios.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git

[Qemu-devel] [PULL 00/13] Trivial patches for 2016-05-18

2016-05-18 Thread Michael Tokarev
This is first pull request in quite a while. Accumulating only relatively old stuff which hasn't been applied to other trees. More to follow. Please consider applying. Thanks, /mjt The following changes since commit a257c741491ff1c3c192d13a89c136dd6401c54d: Merge remote-tracking branch

[Qemu-devel] [PULL 05/13] Fix typo in variable name (found and fixed by codespell)

2016-05-18 Thread Michael Tokarev
From: Stefan Weil Signed-off-by: Stefan Weil Reviewed-by: Fam Zheng Signed-off-by: Michael Tokarev --- scripts/dump-guest-memory.py | 64 ++-- 1 file changed, 32 insertions(+), 32

[Qemu-devel] [PATCH trivial] s390x/virtio-ccw: fix spelling

2016-05-18 Thread Michael Tokarev
Signed-off-by: Michael Tokarev --- hw/s390x/virtio-ccw.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/s390x/virtio-ccw.c b/hw/s390x/virtio-ccw.c index d51642d..5e77b27 100644 --- a/hw/s390x/virtio-ccw.c +++ b/hw/s390x/virtio-ccw.c @@ -1475,7 +1475,7 @@

  1   2   3   >