Re: [Qemu-devel] [Qemu-block] [PATCH] block: fix memory leak in early exit

2015-10-15 Thread Alberto Garcia
On Thu 15 Oct 2015 05:54:27 PM CEST, Stefan Hajnoczi wrote: > The stream block job has two early exit code paths. They do not free > s->backing_file_str. > > Also, the early exits rely on the fact that the coroutine hasn't yielded > yet and was launched from the main thread. Therefore the corou

Re: [Qemu-devel] [PATCH] arm_gic_kvm: Disable live migration if not supported

2015-10-15 Thread Pavel Fedin
Hello! > What kernel are you running that doesn't support state save/restore > in the GICv2 implementation? I am not running such an old kernel. Just realized that GICv3 will need something similar, and actually GICv2 needs it too. Actually this idea came to me when i occasionally tried to mi

Re: [Qemu-devel] Connecting netdev to emulated nics.

2015-10-15 Thread sai pavan
+Peter Hi Jason, On Thu, Oct 15, 2015 at 2:44 PM, Jason Wang wrote: > > > On 10/15/2015 02:36 PM, sai pavan wrote: >> Hi, >> >> I am debugging an issue, where through one of the nics I am not able >> to connect to dtcp. >> So to dig in deep, i was going thought net.c files, and ended-up >> under

Re: [Qemu-devel] [Qemu-block] [PATCH v10 08/10] Implement new driver for block replication

2015-10-15 Thread Wen Congyang
On 10/15/2015 10:55 PM, Stefan Hajnoczi wrote: > On Thu, Oct 15, 2015 at 10:19:17AM +0800, Wen Congyang wrote: >> On 10/14/2015 10:27 PM, Stefan Hajnoczi wrote: >>> On Tue, Oct 13, 2015 at 05:08:17PM +0800, Wen Congyang wrote: On 10/13/2015 12:27 AM, Stefan Hajnoczi wrote: > On Fri, Sep 25

[Qemu-devel] [PATCH] QEMU patch for libvmi to introspect QEMU/kvm virtual machines. Usually this patch is distributed with libvmi, but, it might be more useful to have it in the QEMU source permanentl

2015-10-15 Thread valerio
From: Valerio Aimale --- Makefile.target | 2 +- hmp-commands.hx | 14 hmp.c| 9 +++ hmp.h| 1 + memory-access.c | 206 +++ memory-access.h | 21 ++ qapi-schema.json | 28 qmp-commands.hx

[Qemu-devel] QEMU patch to allow VM introspection via libvmi

2015-10-15 Thread valerio
All- I've produced a patch for the current QEMU HEAD, for libvmi to introspect QEMU/KVM VMs. Libvmi has patches for the old qeum-kvm fork, inside its source tree: https://github.com/libvmi/libvmi/tree/master/tools/qemu-kvm-patch This patch adds a hmp and a qmp command, "pmemaccess". When the

[Qemu-devel] [PATCH v9 09/17] block: Convert to new qapi union layout

2015-10-15 Thread Eric Blake
We have two issues with our qapi union layout: 1) Even though the QMP wire format spells the tag 'type', the C code spells it 'kind', requiring some hacks in the generator. 2) The C struct uses an anonymous union, which places all tag values in the same namespace as all non-variant members. This le

[Qemu-devel] [PATCH v9 14/17] memory: Convert to new qapi union layout

2015-10-15 Thread Eric Blake
We have two issues with our qapi union layout: 1) Even though the QMP wire format spells the tag 'type', the C code spells it 'kind', requiring some hacks in the generator. 2) The C struct uses an anonymous union, which places all tag values in the same namespace as all non-variant members. This le

[Qemu-devel] [PATCH v9 13/17] input: Convert to new qapi union layout

2015-10-15 Thread Eric Blake
We have two issues with our qapi union layout: 1) Even though the QMP wire format spells the tag 'type', the C code spells it 'kind', requiring some hacks in the generator. 2) The C struct uses an anonymous union, which places all tag values in the same namespace as all non-variant members. This le

[Qemu-devel] [PATCH v9 16/17] qapi: Finish converting to new qapi union layout

2015-10-15 Thread Eric Blake
We have two issues with our qapi union layout: 1) Even though the QMP wire format spells the tag 'type', the C code spells it 'kind', requiring some hacks in the generator. 2) The C struct uses an anonymous union, which places all tag values in the same namespace as all non-variant members. This le

[Qemu-devel] [PATCH v9 17/17] qapi: Simplify gen_struct_field()

2015-10-15 Thread Eric Blake
Rather than having all callers pass a name, type, and optional flag, have them instead pass a QAPISchemaObjectTypeMember which already has all that information. No change to generated code. Signed-off-by: Eric Blake --- v9: rebase after kind/base cleanups, don't rely on member.c_name() v8: new

[Qemu-devel] [PATCH v9 12/17] char: Convert to new qapi union layout

2015-10-15 Thread Eric Blake
We have two issues with our qapi union layout: 1) Even though the QMP wire format spells the tag 'type', the C code spells it 'kind', requiring some hacks in the generator. 2) The C struct uses an anonymous union, which places all tag values in the same namespace as all non-variant members. This le

[Qemu-devel] [PATCH v9 05/17] qapi: Unbox base members

2015-10-15 Thread Eric Blake
Rather than storing a base class as a pointer to a box, just store the fields of that base class in the same order, so that a child struct can be safely cast to its parent. This gives less malloc overhead, less pointer dereferencing, and even less generated code. Without boxing, the corner case o

[Qemu-devel] [PATCH v9 15/17] tpm: Convert to new qapi union layout

2015-10-15 Thread Eric Blake
We have two issues with our qapi union layout: 1) Even though the QMP wire format spells the tag 'type', the C code spells it 'kind', requiring some hacks in the generator. 2) The C struct uses an anonymous union, which places all tag values in the same namespace as all non-variant members. This le

[Qemu-devel] [PATCH v9 07/17] qapi: Start converting to new qapi union layout

2015-10-15 Thread Eric Blake
We have two issues with our qapi union layout: 1) Even though the QMP wire format spells the tag 'type', the C code spells it 'kind', requiring some hacks in the generator. 2) The C struct uses an anonymous union, which places all tag values in the same namespace as all non-variant members. This le

[Qemu-devel] [PATCH v9 03/17] qapi: Reserve 'u' and 'has[-_]*' member names

2015-10-15 Thread Eric Blake
To make collision detection between member names easier, we might as well reject all attempts to use anything that would collide with our use of 'has_' as a flag for optional members. Also, a later patch will introduce a named union 'u' for holding the branch names of a qapi union in a separate nam

[Qemu-devel] [PATCH v9 10/17] nbd: Convert to new qapi union layout

2015-10-15 Thread Eric Blake
We have two issues with our qapi union layout: 1) Even though the QMP wire format spells the tag 'type', the C code spells it 'kind', requiring some hacks in the generator. 2) The C struct uses an anonymous union, which places all tag values in the same namespace as all non-variant members. This le

[Qemu-devel] [PATCH v9 02/17] qapi: Reserve '*List' type names for arrays

2015-10-15 Thread Eric Blake
We already reserved '*Kind' for implicit enums (since commit 4dc2e69), but failed to reserve '*List' for array types. Since no QMP was yet using it, we might as well make the reservation official. Note that this forbids creation of new types or commands ending in 'List', but does NOT forbid abuse

[Qemu-devel] [PATCH v9 08/17] tests: Convert to new qapi union layout

2015-10-15 Thread Eric Blake
We have two issues with our qapi union layout: 1) Even though the QMP wire format spells the tag 'type', the C code spells it 'kind', requiring some hacks in the generator. 2) The C struct uses an anonymous union, which places all tag values in the same namespace as all non-variant members. This le

[Qemu-devel] [PATCH v9 11/17] net: Convert to new qapi union layout

2015-10-15 Thread Eric Blake
We have two issues with our qapi union layout: 1) Even though the QMP wire format spells the tag 'type', the C code spells it 'kind', requiring some hacks in the generator. 2) The C struct uses an anonymous union, which places all tag values in the same namespace as all non-variant members. This le

[Qemu-devel] [PATCH v9 06/17] qapi-visit: Remove redundant functions for flat union base

2015-10-15 Thread Eric Blake
The code for visiting the base class of a child struct created visit_type_Base_fields() which covers all fields of Base; while the code for visiting the base class of a flat union created visit_type_Union_fields() covering all fields of the base except the discriminator. But if the base class were

[Qemu-devel] [PATCH v9 04/17] vnc: hoist allocation of VncBasicInfo to callers

2015-10-15 Thread Eric Blake
A future qapi patch will rework generated structs with a base class to be unboxed. In preparation for that, change the code that allocates then populates an info struct to instead merely populate the fields of an info field passed in as a parameter. Add rudimentary Error handling for cases where t

[Qemu-devel] [PATCH v9 01/17] qapi: Add tests for reserved name abuse

2015-10-15 Thread Eric Blake
A future patch wants to change qapi union representation from an anonymous C union over to a named C union 'u', so that the C names of tag values are in a separate namespace and thus cannot collide with the C names of non-variant QMP members. But for that to not cause any problems with future exten

[Qemu-devel] [PATCH v9 00/17] qapi collision reduction (post-introspection subset B')

2015-10-15 Thread Eric Blake
Pending prerequisite: Markus' qapi-next branch (which has the first half of my subset B patches): git://repo.or.cz/qemu/armbru.git pull-qapi-2015-10-15 https://lists.gnu.org/archive/html/qemu-devel/2015-10/msg03321.html Pending prerequisite: Paolo's rewrite of qemu-char: https://lists.gnu.org/arch

Re: [Qemu-devel] [PATCH] block: fix memory leak in early exit

2015-10-15 Thread Jeff Cody
On Thu, Oct 15, 2015 at 05:54:27PM +0200, Stefan Hajnoczi wrote: > The stream block job has two early exit code paths. They do not free > s->backing_file_str. > > Also, the early exits rely on the fact that the coroutine hasn't yielded > yet and was launched from the main thread. Therefore the c

Re: [Qemu-devel] [PATCH v3 27/32] nvdimm: support DSM_CMD_IMPLEMENTED function

2015-10-15 Thread Xiao Guangrong
On 10/15/2015 11:01 PM, Stefan Hajnoczi wrote: On Wed, Oct 14, 2015 at 10:52:15PM +0800, Xiao Guangrong wrote: On 10/14/2015 05:41 PM, Stefan Hajnoczi wrote: On Sun, Oct 11, 2015 at 11:52:59AM +0800, Xiao Guangrong wrote: +out->len = sizeof(out->status); out->len is uint16_t, it needs

Re: [Qemu-devel] [Xen-devel] Question about xen disk unplug support for ahci missed in qemu

2015-10-15 Thread Kevin O'Connor
On Fri, Oct 16, 2015 at 01:10:54AM +0200, Laszlo Ersek wrote: > On 10/14/15 13:27, Ian Campbell wrote: > > On Wed, 2015-10-14 at 12:06 +0100, Stefano Stabellini wrote: > >>> Can't you just teach SeaBIOS how to deal with your PV disks and then > >>> only add that to your VM and forget about IDE/AHCI

Re: [Qemu-devel] [PATCH v3 27/32] nvdimm: support DSM_CMD_IMPLEMENTED function

2015-10-15 Thread Xiao Guangrong
On 10/15/2015 11:07 PM, Stefan Hajnoczi wrote: On Wed, Oct 14, 2015 at 10:50:40PM +0800, Xiao Guangrong wrote: On 10/14/2015 05:40 PM, Stefan Hajnoczi wrote: On Sun, Oct 11, 2015 at 11:52:59AM +0800, Xiao Guangrong wrote: +out = (dsm_out *)in; + +revision = in->arg1; +function =

Re: [Qemu-devel] [PATCH] block: fix memory leak in early exit

2015-10-15 Thread Fam Zheng
On Thu, 10/15 17:54, Stefan Hajnoczi wrote: > The stream block job has two early exit code paths. They do not free > s->backing_file_str. > > Also, the early exits rely on the fact that the coroutine hasn't yielded > yet and was launched from the main thread. Therefore the coroutine is > guarant

Re: [Qemu-devel] [PATCH] target-*: Advance pc after recognizing a breakpoint

2015-10-15 Thread Richard Henderson
On 10/16/2015 03:36 AM, Peter Maydell wrote: On 14 October 2015 at 22:02, Richard Henderson wrote: On 10/15/2015 06:34 AM, Peter Maydell wrote: This is still the same cryptic comment we have in the targets which do do this. Can we have something that is a bit more explanatory about what is go

Re: [Qemu-devel] [Qemu-block] [PATCH v10 08/10] Implement new driver for block replication

2015-10-15 Thread Wen Congyang
On 10/15/2015 10:55 PM, Stefan Hajnoczi wrote: > On Thu, Oct 15, 2015 at 10:19:17AM +0800, Wen Congyang wrote: >> On 10/14/2015 10:27 PM, Stefan Hajnoczi wrote: >>> On Tue, Oct 13, 2015 at 05:08:17PM +0800, Wen Congyang wrote: On 10/13/2015 12:27 AM, Stefan Hajnoczi wrote: > On Fri, Sep 25

[Qemu-devel] [PATCH 4/4] mips: add gic support to malta

2015-10-15 Thread Yongbok Kim
Add Global Interrupt Controller support to Malta board. The I8259 is connected to pin 3 of the GIC. Increase number of CPUs supported to 32. Signed-off-by: Yongbok Kim --- hw/mips/mips_malta.c | 71 - target-mips/cpu.h|1 + 2 files change

[Qemu-devel] [PATCH 3/4] mips: add Global Interrupt Controller

2015-10-15 Thread Yongbok Kim
The Global Interrupt Controller (GIC) is responsible for mapping each internal and external interrupt to the correct location for servicing. Limitations: Level triggering only No User-Mode Visible Section GIC CounterHi not implemented (Countbits = 32bits) DINT not implemented Local WatchDog, Fast

[Qemu-devel] [PATCH 2/4] mips: add Global Config Register block (part)

2015-10-15 Thread Yongbok Kim
Add part of GCR Block which Linux Kernel utilises and it is enough to bring the GIC up. Signed-off-by: Yongbok Kim --- hw/mips/Makefile.objs |2 +- hw/mips/mips_gcr.c| 120 + hw/mips/mips_gcr.h| 57 +++ 3 files ch

[Qemu-devel] [PATCH 1/4] target-mips: add CMGCRBase register

2015-10-15 Thread Yongbok Kim
Physical base address for the memory-mapped Coherency Manager Global Configuration Register space. The MIPS default location for the GCR_BASE address is 0x1FBF_8. This register only exists if Config3 CMGCR is set to one. Signed-off-by: Yongbok Kim --- target-mips/cpu.h|3 ++- tar

[Qemu-devel] [PATCH 0/4] mips: add Global Interrupt Controller

2015-10-15 Thread Yongbok Kim
Add support of MIPS GIC. The patchset implements the Global Interrupt Controller. With the patchset Linux Kernel detects GIC and utilises it. # cat /proc/interrupts CPU0 0: 2XT-PIC 0 timer 2: 0XT-PIC 2 cascade 4:462XT-PIC 4 serial

Re: [Qemu-devel] Question about xen disk unplug support for ahci missed in qemu

2015-10-15 Thread Laszlo Ersek
On 10/14/15 14:48, Paul Durrant wrote: >> -Original Message- >> From: Fabio Fantoni [mailto:fabio.fant...@m2r.biz] >> Sent: 14 October 2015 12:12 >> To: Kevin Wolf; Stefano Stabellini >> Cc: John Snow; Anthony Perard; qemu-devel@nongnu.org; xen- >> de...@lists.xen.org; qemu-bl...@nongnu.org

Re: [Qemu-devel] [Xen-devel] Question about xen disk unplug support for ahci missed in qemu

2015-10-15 Thread Laszlo Ersek
CC'ing Kevin O'Connor On 10/14/15 13:27, Ian Campbell wrote: > On Wed, 2015-10-14 at 12:06 +0100, Stefano Stabellini wrote: >>> Can't you just teach SeaBIOS how to deal with your PV disks and then >>> only add that to your VM and forget about IDE/AHCI? I mean, that's how >>> it's done for virtio-b

Re: [Qemu-devel] [PATCH 7/7] docs: Document QMP event rate limiting

2015-10-15 Thread Eric Blake
On 10/15/2015 09:08 AM, Markus Armbruster wrote: > Signed-off-by: Markus Armbruster > --- > docs/qmp-events.txt | 12 > docs/qmp-spec.txt | 5 + > 2 files changed, 17 insertions(+) > Reviewed-by: Eric Blake -- Eric Blake eblake redhat com+1-919-301-3266 Libvirt virt

Re: [Qemu-devel] [PATCH 3/7] monitor: Switch from timer_new() to timer_new_ns()

2015-10-15 Thread Eric Blake
On 10/15/2015 09:08 AM, Markus Armbruster wrote: > We don't actually care for the scale, so we can just as well use the > simpler interface. > > Signed-off-by: Markus Armbruster > --- > monitor.c | 7 +++ > 1 file changed, 3 insertions(+), 4 deletions(-) > > diff --git a/monitor.c b/monitor

Re: [Qemu-devel] [PATCH 2/7] monitor: Simplify event throttling

2015-10-15 Thread Eric Blake
On 10/15/2015 09:08 AM, Markus Armbruster wrote: > The event throttling state machine is hard to understand. I'm not > sure it's entirely correct. Rewrite it in a more straightforward > manner: > > State 1: No event sent recently (less than evconf->rate ns ago) > > Invariant: evstate->timer

[Qemu-devel] [RESEND PATCH] kvm: Allow the Hyper-V vendor ID to be specified

2015-10-15 Thread Alex Williamson
According to Microsoft documentation, the signature in the standard hypervisor CPUID leaf at 0x4000 identifies the Vendor ID and is for reporting and diagnostic purposes only. We can therefore allow the user to change it to whatever they want, within the 12 character limit. Add a new hyperv-v

Re: [Qemu-devel] [PATCH 1/3] log: improve performance of qemu_log and qemu_log_mask if disabled

2015-10-15 Thread Alex Bennée
Denis V. Lunev writes: > On 10/15/2015 08:23 PM, Alex Bennée wrote: >> Denis V. Lunev writes: >> >>> The patch is intended to avoid to perform any operation including >>> calculation of log function arguments when the log is not enabled due to >>> various reasons. >>> >>> Functions qemu_log and

[Qemu-devel] [PATCH] kvm: Move x86-specific functions into target-i386/kvm.c

2015-10-15 Thread Thomas Huth
The functions for checking xcrs, xsave and pit_state2 are only used on x86, so they should reside in target-i386/kvm.c. Signed-off-by: Thomas Huth --- include/sysemu/kvm.h | 2 -- kvm-all.c| 29 - kvm-stub.c | 5 - target-i386/kvm.c| 31

Re: [Qemu-devel] Question about xen disk unplug support for ahci missed in qemu

2015-10-15 Thread Anthony PERARD
On Thu, Oct 15, 2015 at 06:27:17PM +0200, Fabio Fantoni wrote: > Il 14/10/2015 13:06, Stefano Stabellini ha scritto: > >I would suggest Fabio to avoid AHCI disks altogether and just use OVMF > >with PV disks only and Anthony's patch to libxl to avoid creating any > >IDE disks: http://marc.info/?l=x

Re: [Qemu-devel] [PATCH v4] fw_cfg: insert string blobs via qemu cmdline

2015-10-15 Thread Gabriel L. Somlo
On Thu, Oct 15, 2015 at 05:50:03PM +0200, Laszlo Ersek wrote: > On 10/15/15 11:24, Gerd Hoffmann wrote: > > On Mi, 2015-10-14 at 16:22 +0200, Laszlo Ersek wrote: > >> Paolo, > >> > >> On 09/29/15 18:29, Gabriel L. Somlo wrote: > >>> Allow users to provide custom fw_cfg blobs with ascii string > >>>

Re: [Qemu-devel] [PATCH 1/3] log: improve performance of qemu_log and qemu_log_mask if disabled

2015-10-15 Thread Denis V. Lunev
On 10/15/2015 08:23 PM, Alex Bennée wrote: Denis V. Lunev writes: The patch is intended to avoid to perform any operation including calculation of log function arguments when the log is not enabled due to various reasons. Functions qemu_log and qemu_log_mask are replaced with variadic macros.

Re: [Qemu-devel] [PATCH 1/3] log: improve performance of qemu_log and qemu_log_mask if disabled

2015-10-15 Thread Alex Bennée
Denis V. Lunev writes: > The patch is intended to avoid to perform any operation including > calculation of log function arguments when the log is not enabled due to > various reasons. > > Functions qemu_log and qemu_log_mask are replaced with variadic macros. > Unfortunately the code is not C99

Re: [Qemu-devel] [PATCH] arm_gic_kvm: Disable live migration if not supported

2015-10-15 Thread Peter Maydell
On 15 October 2015 at 13:45, Pavel Fedin wrote: > Currently, if the kernel does not have live migration API, the migration > will still be attempted, but vGIC save/restore functions will just not do > anything. This will result in a broken machine state. > > This patch fixes the problem by patchin

Re: [Qemu-devel] [PATCH] target-*: Advance pc after recognizing a breakpoint

2015-10-15 Thread Peter Maydell
On 14 October 2015 at 22:02, Richard Henderson wrote: > On 10/15/2015 06:34 AM, Peter Maydell wrote: >> >> This is still the same cryptic comment we have in the >> targets which do do this. Can we have something >> that is a bit more explanatory about what is going on and >> why we need to do this

Re: [Qemu-devel] Question about xen disk unplug support for ahci missed in qemu

2015-10-15 Thread Fabio Fantoni
Il 14/10/2015 13:06, Stefano Stabellini ha scritto: On Wed, 14 Oct 2015, Kevin Wolf wrote: [ CC qemu-block ] Am 13.10.2015 um 19:10 hat Stefano Stabellini geschrieben: On Tue, 13 Oct 2015, John Snow wrote: On 10/13/2015 11:55 AM, Fabio Fantoni wrote: I added ahci disk support in libxl and us

[Qemu-devel] [PATCH 06/12] glib-compat: add 2.38/2.40/2.46 asserts

2015-10-15 Thread Michael Roth
From: Marc-André Lureau Those are mostly useful for writing tests. Signed-off-by: Marc-André Lureau Reviewed-by: Claudio Fontana Signed-off-by: Michael Roth --- include/glib-compat.h | 61 +++ 1 file changed, 61 insertions(+) diff --git a/incl

Re: [Qemu-devel] [PATCH 6/6] qstring: Make conversion from QObject * accept null

2015-10-15 Thread Eric Blake
On 10/15/2015 08:15 AM, Markus Armbruster wrote: > qobject_to_qstring() crashes on null, which is a trap for the unwary. > Return null instead, and simplify a few callers. > > Signed-off-by: Markus Armbruster > --- > qapi/qmp-input-visitor.c | 6 +++--- > qobject/qdict.c | 11 +++--

[Qemu-devel] [PATCH 08/12] qga: drop guest_file_init helper and replace it with static initializers

2015-10-15 Thread Michael Roth
From: "Denis V. Lunev" This just makes code shorter and better. Signed-off-by: Denis V. Lunev Signed-off-by: Yuri Pudgorodskiy Reviewed-by: Michael Roth Signed-off-by: Denis V. Lunev Signed-off-by: Michael Roth --- qga/commands-posix.c | 10 +++--- qga/commands-win32.c | 10 +++---

Re: [Qemu-devel] [PULL 1/3] Migration: Generate the completed event only when we complete

2015-10-15 Thread Dr. David Alan Gilbert
* Christian Borntraeger (borntrae...@de.ibm.com) wrote: > Am 15.10.2015 um 08:27 schrieb Juan Quintela: > > From: "Dr. David Alan Gilbert" > > > > The current migration-completed event is generated a bit too early, > > which means that an eager libvirt that's ready to go as soon > > as it sees th

[Qemu-devel] [PATCH 07/12] tests: add a local test for guest agent

2015-10-15 Thread Michael Roth
From: Marc-André Lureau Add some local guest agent tests, as it is better than nothing, only when CONFIG_POSIX (using unix sockets). With the QGA_TEST_SIDE_EFFECTING environment variable, it will include tests with side effects, such as freezing/thawing the FS or changing the time. (a better te

[Qemu-devel] [PATCH 6/7] monitor: Throttle event VSERPORT_CHANGE separately by "id"

2015-10-15 Thread Markus Armbruster
VSERPORT_CHANGE is emitted when the guest opens or closes a virtio-serial port. The event's member "id" identifies the port. When several events arrive quickly, throttling drops all but the last of them. Because of that, a QMP client must assume that *any* port may have changed state when it rec

Re: [Qemu-devel] [PATCH 5/6] qlist: Make conversion from QObject * accept null

2015-10-15 Thread Eric Blake
On 10/15/2015 08:15 AM, Markus Armbruster wrote: > qobject_to_qlist() crashes on null, which is a trap for the unwary. > Return null instead. > > Signed-off-by: Markus Armbruster > --- > qobject/qlist.c | 3 +-- > 1 file changed, 1 insertion(+), 2 deletions(-) > Reviewed-by: Eric Blake -- E

[Qemu-devel] [PATCH 12/12] qga: guest-exec simple stdin/stdout/stderr redirection

2015-10-15 Thread Michael Roth
From: Yuri Pudgorodskiy Implemented with base64-encoded strings in qga json protocol. Glib portable GIOChannel is used for data I/O. Optinal stdin parameter of guest-exec command is now used as stdin content for spawned subprocess. If capture-output bool flag is specified, guest-exec redirects

[Qemu-devel] [PATCH 5/7] monitor: Turn monitor_qapi_event_state[] into a hash table

2015-10-15 Thread Markus Armbruster
In preparation of finer grained throttling. Signed-off-by: Markus Armbruster Reviewed-by: Eric Blake --- monitor.c | 55 ++- 1 file changed, 38 insertions(+), 17 deletions(-) diff --git a/monitor.c b/monitor.c index 5e3a7f2..ebec428 100644 --

[Qemu-devel] [PATCH 03/12] qga: add QGA_CONF environment variable

2015-10-15 Thread Michael Roth
From: Marc-André Lureau Having a environment variable allows to override default configuration path, useful for testing. Note that this can't easily be an argument, since loading config is done before parsing the arguments. Signed-off-by: Marc-André Lureau Reviewed-by: Michael Roth Signed-off-

[Qemu-devel] [PATCH 05/12] qtest: add a few fd-level qmp helpers

2015-10-15 Thread Michael Roth
From: Marc-André Lureau Add a few functions to interact with qmp via a simple fd. Signed-off-by: Marc-André Lureau Reviewed-by: Michael Roth Signed-off-by: Michael Roth --- tests/libqtest.c | 45 + tests/libqtest.h | 7 +++ 2 files changed, 48

Re: [Qemu-devel] [PATCH 4/6] qfloat qint: Make conversion from QObject * accept null

2015-10-15 Thread Eric Blake
On 10/15/2015 08:15 AM, Markus Armbruster wrote: > qobject_to_qfloat() and qobject_to_qint() crash on null, which is a > trap for the unwary. Return null instead, and simplify a few callers. > > Signed-off-by: Markus Armbruster > --- > qapi/qmp-input-visitor.c | 28

Re: [Qemu-devel] [PATCH 0/6] qobject: Make conversion from QObject * accept null

2015-10-15 Thread Luiz Capitulino
On Thu, 15 Oct 2015 16:15:31 +0200 Markus Armbruster wrote: > The qobject_to_FOO() crash on null, which is a trap for the unwary. > Return null instead, and simplify a few callers. > > Throw in a patch to drop QObject_HEAD. > > Luiz, I'm happy to take this through my tree, since got a QMP serie

Re: [Qemu-devel] [PATCH] hw/display/tcx: Remove superfluous OBJECT() typecasts

2015-10-15 Thread Markus Armbruster
Thomas Huth writes: > The tcx_initfn() function is already supplied with an > Object *obj pointer, so there is no need to cast the > state pointer back to an Object pointer all over the > place. And while we're at it, also remove the superfluous > "return;" statement in this function. > > Signed-

Re: [Qemu-devel] [PATCH 1/6] qobject: Drop QObject_HEAD

2015-10-15 Thread Eric Blake
On 10/15/2015 08:15 AM, Markus Armbruster wrote: > QObject_HEAD is a macro expanding into the common part of structs that > are sub-types of QObject. It's always been just QObject base, and > unlikely to change. Drop the macro, because the code is clearer with > out it. > > Signed-off-by: Markus

[Qemu-devel] [PATCH 11/12] qga: handle G_IO_STATUS_AGAIN in ga_channel_write_all()

2015-10-15 Thread Michael Roth
From: Yuri Pudgorodskiy glib may return G_IO_STATUS_AGAIN which is actually not an error. Also fixed a bug when on incomplete write buf pointer was not adjusted. Signed-off-by: Yuri Pudgorodskiy Signed-off-by: Denis V. Lunev Reviewed-by: Michael Roth Signed-off-by: Michael Roth --- qga/chan

[Qemu-devel] [PATCH 04/12] qga: do not override configuration verbosity

2015-10-15 Thread Michael Roth
From: Marc-André Lureau Move the default verbosity settings before loading the configuration file, or it will overwrite it. Found thanks to writing qga tests :) Signed-off-by: Marc-André Lureau Reviewed-by: Michael Roth Signed-off-by: Michael Roth --- qga/main.c | 4 ++-- 1 file changed, 2 i

[Qemu-devel] [PATCH 01/12] build: qemu-ga: add 'qemu-ga' build target for w32

2015-10-15 Thread Michael Roth
Currently POSIX builds rely on 'qemu-ga' target to do qga-only distributable build. On w32, as with most standalone binary targets, we rely on 'qemu-ga.exe' target. Unlike with POSIX, qemu-ga for w32 has a number of related targets such as VSS DLL and MSI package. We can do the full distributable

[Qemu-devel] [PATCH 10/12] qga: handle possible SIGPIPE in guest-file-write

2015-10-15 Thread Michael Roth
From: "Denis V. Lunev" qemu-ga should not exit on guest-file-write to pipe without read end but proper error code should be returned. The behavior of the spawned process should be default thus SIGPIPE processing should be reset to default after fork() but before exec(). Signed-off-by: Denis V. L

[Qemu-devel] [PULL v2 00/12] qemu-ga patch queue

2015-10-15 Thread Michael Roth
Hi Peter, Please note that 'glib-compat: add 2.38/2.40/2.46 asserts' is also in Marc-André's recent ivshmem PULL. The 2 versions of the patches are identical, but let me know if you'd prefer a re-send/re-base later. The following changes since commit c49d3411faae8ffaab8f7e5db47405a008411c10: M

[Qemu-devel] [PATCH 09/12] qga: guest exec functionality

2015-10-15 Thread Michael Roth
From: Yuri Pudgorodskiy Guest-exec rewritten in platform-independent style with glib spawn. Child process is spawn asynchronously and exit status can later be picked up by guest-exec-status command. stdin/stdout/stderr of the child now is redirected to /dev/null Later we will add ability to spe

[Qemu-devel] [PATCH 02/12] qga: Use g_new() & friends where that makes obvious sense

2015-10-15 Thread Michael Roth
From: Markus Armbruster g_new(T, n) is neater than g_malloc(sizeof(T) * n). It's also safer, for two reasons. One, it catches multiplication overflowing size_t. Two, it returns T * rather than void *, which lets the compiler catch more type errors. This commit only touches allocations with siz

Re: [Qemu-devel] [PATCH 2/6] qbool: Make conversion from QObject * accept null

2015-10-15 Thread Eric Blake
On 10/15/2015 08:15 AM, Markus Armbruster wrote: > qobject_to_qbool() crashes on null, which is a trap for the unwary. > Return null instead, and simplify a few callers. > > Signed-off-by: Markus Armbruster > --- > qapi/qmp-input-visitor.c | 6 +++--- > qobject/qbool.c | 4 ++-- > qob

Re: [Qemu-devel] [PATCH 0/3] QEMU logging improvements

2015-10-15 Thread Kashyap Chamarthy
On Thu, Oct 15, 2015 at 06:18:31PM +0300, Pavel Butsykin wrote: > > On 15.10.2015 17:49, Kashyap Chamarthy wrote: > >On Thu, Oct 15, 2015 at 10:30:21AM +0300, Denis V. Lunev wrote: > >>The following is done: > >>- QMP/HMP events are now logged > > > >I applied this patch series locally, and tried

[Qemu-devel] [PATCH 1/7] monitor: Reduce casting of QAPI event QDict

2015-10-15 Thread Markus Armbruster
Make the variables holding the event QDict instead of QObject. Signed-off-by: Markus Armbruster Reviewed-by: Eric Blake --- monitor.c | 38 +++--- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/monitor.c b/monitor.c index 4f1ba2f..2fa90ca 100644

[Qemu-devel] [PATCH] block: fix memory leak in early exit

2015-10-15 Thread Stefan Hajnoczi
The stream block job has two early exit code paths. They do not free s->backing_file_str. Also, the early exits rely on the fact that the coroutine hasn't yielded yet and was launched from the main thread. Therefore the coroutine is guaranteed to be running in the main thread where block_job_com

Re: [Qemu-devel] [PATCH v2 2/5] qdev: add the HotUnpluggable handler

2015-10-15 Thread Cornelia Huck
On Mon, 12 Oct 2015 11:00:13 +0200 Greg Kurz wrote: > This handler allows to ask a device instance if it can be hot-unplugged. It > is to be defined in device classes where hot-unpluggability depends on the > device state (for example, virtio-9p devices cannot be unplugged if the 9p > share is mo

Re: [Qemu-devel] [PATCH v2 06/22] block: Add "supports_stats" field to BlockStats

2015-10-15 Thread Stefan Hajnoczi
On Thu, Oct 15, 2015 at 03:06:19PM +0200, Alberto Garcia wrote: > On Tue 13 Oct 2015 05:38:30 PM CEST, Stefan Hajnoczi wrote: > > >> query-blockstats always returns a BlockDeviceStats structure for each > >> BDS, regardless of whether it implements accounting or not. Since the > >> field is mandat

Re: [Qemu-devel] [PATCH] Revert "blockdev: add note that block_job_cb() must be thread-safe"

2015-10-15 Thread Stefan Hajnoczi
On Wed, Oct 14, 2015 at 10:51:27PM -0400, Fam Zheng wrote: > > > - Original Message - > > On Tue, Oct 13, 2015 at 06:16:15PM +0800, Fam Zheng wrote: > > > This reverts commit 723c5d93c51bdb3adbc238ce90195c0864aa6cd5. > > > > > > block_job_cb is called by block_job_completed, which is alw

Re: [Qemu-devel] [PATCH v4] fw_cfg: insert string blobs via qemu cmdline

2015-10-15 Thread Laszlo Ersek
On 10/15/15 11:24, Gerd Hoffmann wrote: > On Mi, 2015-10-14 at 16:22 +0200, Laszlo Ersek wrote: >> Paolo, >> >> On 09/29/15 18:29, Gabriel L. Somlo wrote: >>> Allow users to provide custom fw_cfg blobs with ascii string >>> payloads specified directly on the qemu command line. >>> >>> Suggested-by:

Re: [Qemu-devel] [PATCH v3 27/32] nvdimm: support DSM_CMD_IMPLEMENTED function

2015-10-15 Thread Stefan Hajnoczi
On Wed, Oct 14, 2015 at 10:52:15PM +0800, Xiao Guangrong wrote: > On 10/14/2015 05:41 PM, Stefan Hajnoczi wrote: > >On Sun, Oct 11, 2015 at 11:52:59AM +0800, Xiao Guangrong wrote: > >>+out->len = sizeof(out->status); > > > >out->len is uint16_t, it needs cpu_to_le16(). There may be other > >in

Re: [Qemu-devel] [Qemu-block] [PATCH v10 08/10] Implement new driver for block replication

2015-10-15 Thread Stefan Hajnoczi
On Thu, Oct 15, 2015 at 10:19:17AM +0800, Wen Congyang wrote: > On 10/14/2015 10:27 PM, Stefan Hajnoczi wrote: > > On Tue, Oct 13, 2015 at 05:08:17PM +0800, Wen Congyang wrote: > >> On 10/13/2015 12:27 AM, Stefan Hajnoczi wrote: > >>> On Fri, Sep 25, 2015 at 02:17:36PM +0800, Wen Congyang wrote: >

Re: [Qemu-devel] [PATCH v3 27/32] nvdimm: support DSM_CMD_IMPLEMENTED function

2015-10-15 Thread Stefan Hajnoczi
On Wed, Oct 14, 2015 at 10:50:40PM +0800, Xiao Guangrong wrote: > On 10/14/2015 05:40 PM, Stefan Hajnoczi wrote: > >On Sun, Oct 11, 2015 at 11:52:59AM +0800, Xiao Guangrong wrote: > >>+out = (dsm_out *)in; > >>+ > >>+revision = in->arg1; > >>+function = in->arg2; > >>+handle = in->h

Re: [Qemu-devel] [PATCH v2 2/5] qdev: add the HotUnpluggable handler

2015-10-15 Thread Greg Kurz
On Thu, 15 Oct 2015 17:14:36 +0200 Cornelia Huck wrote: > On Mon, 12 Oct 2015 11:00:13 +0200 > Greg Kurz wrote: > > > This handler allows to ask a device instance if it can be hot-unplugged. It > > is to be defined in device classes where hot-unpluggability depends on the > > device state (for

Re: [Qemu-devel] [PATCH 3/6] qdict: Make conversion from QObject * accept null

2015-10-15 Thread Eric Blake
On 10/15/2015 08:15 AM, Markus Armbruster wrote: > qobject_to_qdict() crashes on null, which is a trap for the unwary. > Return null instead, and simplify a few callers. > > Signed-off-by: Markus Armbruster > --- > qga/main.c | 11 +++ > qobject/qdict.c | 6 +++--- > 2 files change

[Qemu-devel] [PATCH 3/7] monitor: Switch from timer_new() to timer_new_ns()

2015-10-15 Thread Markus Armbruster
We don't actually care for the scale, so we can just as well use the simpler interface. Signed-off-by: Markus Armbruster --- monitor.c | 7 +++ 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/monitor.c b/monitor.c index ca201fd..baffd76 100644 --- a/monitor.c +++ b/monitor.c @@

Re: [Qemu-devel] [PATCH 0/7] Throttle event VSERPORT_CHANGE separately by "id"

2015-10-15 Thread Markus Armbruster
Forgot to mention: this is based on my "[PATCH 0/6] qobject: Make conversion from QObject * accept null".

Re: [Qemu-devel] [PATCH 0/3] QEMU logging improvements

2015-10-15 Thread Pavel Butsykin
On 15.10.2015 17:49, Kashyap Chamarthy wrote: On Thu, Oct 15, 2015 at 10:30:21AM +0300, Denis V. Lunev wrote: The following is done: - QMP/HMP events are now logged I applied this patch series locally, and tried to test it the below way: Launch a minimal QEMU instance: $ /home/kashyapc/

[Qemu-devel] [PATCH 4/7] monitor: Split MonitorQAPIEventConf off MonitorQAPIEventState

2015-10-15 Thread Markus Armbruster
In preparation of turning monitor_qapi_event_state[] into a hash table for finer grained throttling. Signed-off-by: Markus Armbruster Reviewed-by: Eric Blake --- monitor.c | 80 ++- 1 file changed, 38 insertions(+), 42 deletions(-) di

[Qemu-devel] [PATCH 7/7] docs: Document QMP event rate limiting

2015-10-15 Thread Markus Armbruster
Signed-off-by: Markus Armbruster --- docs/qmp-events.txt | 12 docs/qmp-spec.txt | 5 + 2 files changed, 17 insertions(+) diff --git a/docs/qmp-events.txt b/docs/qmp-events.txt index d92cc48..d2f1ce4 100644 --- a/docs/qmp-events.txt +++ b/docs/qmp-events.txt @@ -28,6 +28,8 @@

[Qemu-devel] [PATCH 2/7] monitor: Simplify event throttling

2015-10-15 Thread Markus Armbruster
The event throttling state machine is hard to understand. I'm not sure it's entirely correct. Rewrite it in a more straightforward manner: State 1: No event sent recently (less than evconf->rate ns ago) Invariant: evstate->timer is not pending, evstate->qdict is null On event: send eve

[Qemu-devel] [PATCH 0/7] Throttle event VSERPORT_CHANGE separately by "id"

2015-10-15 Thread Markus Armbruster
VSERPORT_CHANGE is emitted when the guest opens or closes a virtio-serial port. The event's member "id" identifies the port. When several events arrive quickly, throttling drops all but the last of them. Because of that, a QMP client must assume that *any* port may have changed state when it rec

Re: [Qemu-devel] [PULL 1/3] Migration: Generate the completed event only when we complete

2015-10-15 Thread Christian Borntraeger
Am 15.10.2015 um 08:27 schrieb Juan Quintela: > From: "Dr. David Alan Gilbert" > > The current migration-completed event is generated a bit too early, > which means that an eager libvirt that's ready to go as soon > as it sees the event ends up racing with the actual end of migration. > > This c

Re: [Qemu-devel] [PATCH v4 3/5] acpi: pc: add fw_cfg device node to ssdt

2015-10-15 Thread Igor Mammedov
On Wed, 14 Oct 2015 13:47:32 -0300 Eduardo Habkost wrote: > On Wed, Oct 14, 2015 at 10:45:00AM +0200, Igor Mammedov wrote: > > On Tue, 13 Oct 2015 16:10:03 -0300 > > Eduardo Habkost wrote: > > > > > On Sat, Oct 10, 2015 at 12:00:16AM -0400, Gabriel L. Somlo wrote: > > > > On Thu, Oct 01, 2015 a

[Qemu-devel] [PATCH 0/6] qobject: Make conversion from QObject * accept null

2015-10-15 Thread Markus Armbruster
The qobject_to_FOO() crash on null, which is a trap for the unwary. Return null instead, and simplify a few callers. Throw in a patch to drop QObject_HEAD. Luiz, I'm happy to take this through my tree, since got a QMP series based on it (to be posted shortly). Markus Armbruster (6): qobject: D

Re: [Qemu-devel] [PATCH 0/3] QEMU logging improvements

2015-10-15 Thread Kashyap Chamarthy
On Thu, Oct 15, 2015 at 10:30:21AM +0300, Denis V. Lunev wrote: > The following is done: > - QMP/HMP events are now logged I applied this patch series locally, and tried to test it the below way: Launch a minimal QEMU instance: $ /home/kashyapc/build/build-qemu-upstream/x86_64-softmmu/qemu-sys

Re: [Qemu-devel] [PULL 1/3] Migration: Generate the completed event only when we complete

2015-10-15 Thread Eric Blake
On 10/15/2015 12:27 AM, Juan Quintela wrote: > From: "Dr. David Alan Gilbert" > > The current migration-completed event is generated a bit too early, > which means that an eager libvirt that's ready to go as soon > as it sees the event ends up racing with the actual end of migration. > > This co

[Qemu-devel] [PATCH] tests: re-enable vhost-user-test

2015-10-15 Thread marcandre . lureau
From: Marc-André Lureau Commit 7fe34ca9c2e actually disabled vhost-user-test altogether, since CONFIG_VHOST_NET is a per-target config variable. tests/vhost-user-test is already x86/64 softmmu specific test, in order to enable it correctly, kvm & vhost-net are also conditions. To check that, set

[Qemu-devel] [PATCH 3/6] qdict: Make conversion from QObject * accept null

2015-10-15 Thread Markus Armbruster
qobject_to_qdict() crashes on null, which is a trap for the unwary. Return null instead, and simplify a few callers. Signed-off-by: Markus Armbruster --- qga/main.c | 11 +++ qobject/qdict.c | 6 +++--- 2 files changed, 6 insertions(+), 11 deletions(-) diff --git a/qga/main.c b/qg

  1   2   >