Re: [Qemu-devel] [PATCH v5 08/17] vfio: Pass an Error object to vfio_connect_container

2016-10-07 Thread Markus Armbruster
Eric Auger writes: > The error is currently simply reported in vfio_get_group. Don't > bother too much with the prefix which will be handled at upper level, > later on. > > Also return an error value in case container->error is not 0 and > the container is teared down. "torn down", I think. Is

Re: [Qemu-devel] [PATCH] qtest: ask endianness of the target in qtest_init()

2016-10-07 Thread Laurent Vivier
On 06/10/2016 22:45, Peter Maydell wrote: > On 6 October 2016 at 11:56, Laurent Vivier wrote: >> The target endianness is not deduced anymore from >> the architecture name but asked directly to the guest, >> using a new qtest command: "endianness". As it can't >> change (this is the value of TAR

Re: [Qemu-devel] [PATCH] qtest: ask endianness of the target in qtest_init()

2016-10-07 Thread Greg Kurz
On Fri, 7 Oct 2016 10:55:29 +1100 David Gibson wrote: > On Thu, Oct 06, 2016 at 10:46:22PM +0200, Greg Kurz wrote: > > On Thu, 6 Oct 2016 20:56:58 +0200 > > Laurent Vivier wrote: > > > > > The target endianness is not deduced anymore from > > > the architecture name but asked directly to the

Re: [Qemu-devel] [PATCH v4 15/17] vfio/pci: Remove vfio_msix_early_setup returned value

2016-10-07 Thread Markus Armbruster
Auger Eric writes: > Hi Markus, > > On 04/10/2016 15:05, Markus Armbruster wrote: >> Eric Auger writes: >> >>> The returned value is not used anymore by the caller, vfio_realize, >>> since the error now is stored in the error object. So let's remove it. >>> >>> Signed-off-by: Eric Auger >>> >>

Re: [Qemu-devel] [PATCH v5 00/17] Convert VFIO-PCI to realize

2016-10-07 Thread Markus Armbruster
Eric Auger writes: > This series converts VFIO-PCI to realize. It also aims at improving > the error reporting in case of QMP hot-plug. > > Before the series, a device_add failure would have reported: > {"error": {"class": "GenericError", "desc": "Device initialization > failed"}}. > > Now the ac

Re: [Qemu-devel] [PATCH 1/3] linux-user: detect pwritev support on configure

2016-10-07 Thread Riku Voipio
On Thu, Oct 06, 2016 at 03:59:29PM +0200, Dejan Jovicevic wrote: > Modified the configure file so that, during configuration, a check > is performed to determine if the system call pwritev is supported > by the host. The check for preadv support already exists. Since preadv/pwritev

Re: [Qemu-devel] Adding Save States menu items

2016-10-07 Thread Paolo Bonzini
On 06/10/2016 22:26, Eric Blake wrote: > > > Doesn't virt-manager already do this? What do we gain by duplicating > > > GUI functionality at this level that is already implemented at higher > > > levels? Not that I'm opposed to the idea, but having a solid reason why > > > it is useful is impor

Re: [Qemu-devel] [PATCH] qtest: ask endianness of the target in qtest_init()

2016-10-07 Thread Greg Kurz
On Fri, 7 Oct 2016 09:10:14 +0200 Laurent Vivier wrote: > On 06/10/2016 22:45, Peter Maydell wrote: > > On 6 October 2016 at 11:56, Laurent Vivier wrote: > >> The target endianness is not deduced anymore from > >> the architecture name but asked directly to the guest, > >> using a new qtest co

Re: [Qemu-devel] [PATCH v5 08/17] vfio: Pass an Error object to vfio_connect_container

2016-10-07 Thread Auger Eric
Hi, On 07/10/2016 09:01, Markus Armbruster wrote: > Eric Auger writes: > >> The error is currently simply reported in vfio_get_group. Don't >> bother too much with the prefix which will be handled at upper level, >> later on. >> >> Also return an error value in case container->error is not 0 and

Re: [Qemu-devel] [PATCH v4 01/20] ppc/pnv: add skeleton PowerNV platform

2016-10-07 Thread Cédric Le Goater
Hello, >> - removed the requirement on having a kernel loaded as running with >>just a firmware is fine. We will need to discuss the inclusion of >>the file skiboot.lid under qemu. > > Yes, this isn't terribly useful without it. The normal procedure for > new roms is this: > >1. Ge

Re: [Qemu-devel] [PATCH] qtest: add read/write accessors with a specific endianness

2016-10-07 Thread Laurent Vivier
On 07/10/2016 01:34, David Gibson wrote: >> On 06/10/2016 17:41, Peter Maydell wrote: >>> Speaking of the right place to do things, perhaps we should >>> reimplement qtest_big_endian() in libqtest.c to send a query >>> to the QEMU-under-test to ask it what TARGET_BIG_ENDIAN says, >>> rather than

Re: [Qemu-devel] [PATCH v4] fsdev: add IO throttle support to fsdev devices

2016-10-07 Thread Greg Kurz
On Thu, 22 Sep 2016 07:59:19 -0400 Pradeep Jagadeesh wrote: > Uses throttling APIs to limit I/O bandwidth and number of operations on the > devices which use 9p-local driver. > > Signed-off-by: Pradeep Jagadeesh > --- Hi Pradeep, So where are we with this patch ? Have you solved the issues y

Re: [Qemu-devel] [PATCH v2 04/11] blockjobs: Always use block_job_get_aio_context

2016-10-07 Thread Paolo Bonzini
On 06/10/2016 22:22, John Snow wrote: > Calls .complete(), for which the only implementation is > mirror_complete. Uh, this actually seems messy. Looks like there's > nothing to prevent us from calling this after we've already told it to > complete once. Yeah, it should have an if (s->shoul

Re: [Qemu-devel] [PATCH v5] MC146818 RTC: coordinate guest clock base to destination host after migration

2016-10-07 Thread Paolo Bonzini
On 07/10/2016 06:24, Michael S. Tsirkin wrote: > On Mon, Sep 26, 2016 at 08:41:01PM +0800, Junlian Bell wrote: >> qemu tracks guest time based on vector [base_rtc, last_update], in which >> last_update stands for a monotonic tick which is actually uptime of the >> host. >> according to rtc implem

Re: [Qemu-devel] [PATCH v4 03/20] ppc/pnv: add a core mask to PnvChip

2016-10-07 Thread David Gibson
On Fri, Oct 07, 2016 at 04:01:52PM +1100, Benjamin Herrenschmidt wrote: > On Fri, 2016-10-07 at 15:32 +1100, David Gibson wrote: > > On Mon, Oct 03, 2016 at 09:24:39AM +0200, Cédric Le Goater wrote: > > > This will be used to build real HW ids for the cores and enforce > > some > > > limits on the

Re: [Qemu-devel] [PATCH 09/10] qemu-tech: rewrite some parts

2016-10-07 Thread Paolo Bonzini
On 06/10/2016 18:31, Emilio G. Cota wrote: >> > - >> > -For system emulation QEMU supports a soft MMU. In that mode, the MMU >> > +memory accesses. QEMU keeps a map that host program counter to >> > +target program counter, and looks up where the exception happened >> > +based on the host program

Re: [Qemu-devel] [PATCH 06/10] qemu-tech: move user mode emulation features from qemu-tech

2016-10-07 Thread Paolo Bonzini
On 06/10/2016 20:32, Jonathan Neuschäfer wrote: > On Thu, Oct 06, 2016 at 05:24:19PM +0200, Paolo Bonzini wrote: >> These are interesting for users too, since nowadays most >> qemu-user users are going to be somewhat technical rather than >> just people that want to run Wine. Some detail is lost

Re: [Qemu-devel] [PATCH 05/10] qemu-tech: document lazy condition code evaluation in cpu.h

2016-10-07 Thread Paolo Bonzini
On 06/10/2016 20:45, Peter Maydell wrote: > On 6 October 2016 at 16:24, Paolo Bonzini wrote: >> Unlike the other sections, they are pretty specific to a particular CPU. >> >> Signed-off-by: Paolo Bonzini >> --- >> qemu-tech.texi | 25 - >> target-cris/cpu.h | 7 ++

Re: [Qemu-devel] [QEMU PATCH v5 1/6] migration: alternative way to set instance_id in SaveStateEntry

2016-10-07 Thread Dr. David Alan Gilbert
* David Gibson (da...@gibson.dropbear.id.au) wrote: > On Wed, Oct 05, 2016 at 09:44:57AM -0700, Jianjun Duan wrote: > > Please see comments below: > > > > On 10/05/2016 03:12 AM, Dr. David Alan Gilbert wrote: > > > * Jianjun Duan (du...@linux.vnet.ibm.com) wrote: > > >> In QOM(QEMU Object Model) m

Re: [Qemu-devel] [Qemu-block] [PATCH] qcow2: Optimize L2 table cache size based on image and cluster sizes

2016-10-07 Thread Kevin Wolf
[ Restoring the CC list, adding Eric for QAPI ] Am 06.10.2016 um 20:36 hat Frank Myhr geschrieben: > Thanks Alberto for pointing me to Ed Swierk's patch and this discussion. > > On Wed 05 Oct 2016 16:57:57 +0200, Alberto Garcia wrote: > > > Frank Myhr's suggestion (in bugzilla) is that we allow

Re: [Qemu-devel] [PATCH] usb: xHCI: add check to limit command TRB processing

2016-10-07 Thread Gerd Hoffmann
On Do, 2016-10-06 at 11:20 +0530, P J P wrote: > From: Prasad J Pandit > > USB xHCI controller uses ring of Transfer Request Blocks(TRB) > to process USB commands. These are processed by loop in > 'xhci_ring_fetch'. A guest user could make it read and process > a same TRB infinitely. Limit number

Re: [Qemu-devel] [PATCH v4 03/20] ppc/pnv: add a core mask to PnvChip

2016-10-07 Thread Cédric Le Goater
On 10/07/2016 07:11 AM, David Gibson wrote: > On Fri, Oct 07, 2016 at 04:01:52PM +1100, Benjamin Herrenschmidt wrote: >> On Fri, 2016-10-07 at 15:32 +1100, David Gibson wrote: >>> On Mon, Oct 03, 2016 at 09:24:39AM +0200, Cédric Le Goater wrote: This will be used to build real HW ids for the c

Re: [Qemu-devel] [PATCH v4 01/20] ppc/pnv: add skeleton PowerNV platform

2016-10-07 Thread Cédric Le Goater
On 10/07/2016 06:14 AM, David Gibson wrote: > On Mon, Oct 03, 2016 at 09:24:37AM +0200, Cédric Le Goater wrote: >> From: Benjamin Herrenschmidt >> >> The goal is to emulate a PowerNV system at the level of the skiboot >> firmware, which loads the OS and provides some runtime services. Power >> Sys

Re: [Qemu-devel] [PATCH] tests: minor cleanups in usb-hcd-uhci-test

2016-10-07 Thread Gerd Hoffmann
On Fr, 2016-10-07 at 10:49 +1100, David Gibson wrote: > On Thu, Oct 06, 2016 at 04:50:48PM +0200, Laurent Vivier wrote: > > Two minor cleanups: > > - exit gracefully in case on unsupported target, > > - put machine command line in a constant to avoid > > to duplicate it. > > > > Signed-off-by: L

[Qemu-devel] [PATCH] clean-up: removed duplicate #includes

2016-10-07 Thread Anand J
Some files contain multiple #includes of the same header file. Removed most of those unnecessary duplicate entries. Signed-off-by: Anand J --- accel.c | 1 - cputlb.c| 1 - disas/libvixl/vixl/globals.h| 1 - gdbstub.c

Re: [Qemu-devel] Adding Save States menu items

2016-10-07 Thread Kevin Wolf
Am 06.10.2016 um 21:59 hat Eric Blake geschrieben: > Libvirt also learned that the qemu 'migrate-to-disk' format (used by > 'savevm' or 'migrate') is NOT self-descriptive - in order to fully and > safely revert to an earlier state, you HAVE to store the command line > (or a way to regenerate the co

Re: [Qemu-devel] QEMU - Security Research Questions

2016-10-07 Thread Kevin Wolf
Am 06.10.2016 um 10:27 hat Markus Armbruster geschrieben: > Paolo Bonzini writes: > > > On 06/10/2016 02:10, Joey Connelly wrote: > >> Hey QEMU dev group, > >> I'm a graduate student at Boise State University working on my thesis > >> involving Virtualization/Cloud Computing Security and I wanted

Re: [Qemu-devel] [PULL 10/18] block: Move 'discard' option to bdrv_open_common()

2016-10-07 Thread Gerd Hoffmann
On Di, 2016-09-27 at 15:53 +0200, Kevin Wolf wrote: > This enables its use for nested child nodes. The compatibility > between the 'discard' and 'detect-zeroes' setting is checked in > bdrv_open_common() now as the former setting isn't available before > calling bdrv_open() any more. Seems this ch

[Qemu-devel] [PATCH] vhost-user: don't poke at chardev internal QemuOpts

2016-10-07 Thread Daniel P. Berrange
The vhost-user code is poking at the QemuOpts instance in the CharDriverState struct, not realizing that it is valid for this to be NULL. e.g. the following crash shows a codepath where it will be NULL: Program terminated with signal SIGSEGV, Segmentation fault. #0 0x55baf6ab4adc in qemu_op

Re: [Qemu-devel] Adding Save States menu items

2016-10-07 Thread Daniel P. Berrange
On Thu, Oct 06, 2016 at 02:59:49PM -0500, Eric Blake wrote: > On 10/06/2016 09:22 AM, Programmingkid wrote: > > Would you accept a patch that added "Save State" and "Restore State" menu > > items to the cocoa interface? They would allow the user to save the running > > state of the emulator. > >

Re: [Qemu-devel] [PATCH] vhost-user: don't poke at chardev internal QemuOpts

2016-10-07 Thread Marc-André Lureau
Hi On Fri, Oct 7, 2016 at 1:04 PM Daniel P. Berrange wrote: > The vhost-user code is poking at the QemuOpts instance > in the CharDriverState struct, not realizing that it is > valid for this to be NULL. e.g. the following crash > shows a codepath where it will be NULL: > > Program terminated w

Re: [Qemu-devel] Adding Save States menu items

2016-10-07 Thread Daniel P. Berrange
On Fri, Oct 07, 2016 at 09:21:36AM +0200, Paolo Bonzini wrote: > > > On 06/10/2016 22:26, Eric Blake wrote: > > > > Doesn't virt-manager already do this? What do we gain by duplicating > > > > GUI functionality at this level that is already implemented at higher > > > > levels? Not that I'm opp

Re: [Qemu-devel] [PATCH] vhost-user: don't poke at chardev internal QemuOpts

2016-10-07 Thread Daniel P. Berrange
On Fri, Oct 07, 2016 at 09:10:27AM +, Marc-André Lureau wrote: > Hi > > On Fri, Oct 7, 2016 at 1:04 PM Daniel P. Berrange > wrote: > > > The vhost-user code is poking at the QemuOpts instance > > in the CharDriverState struct, not realizing that it is > > valid for this to be NULL. e.g. the

Re: [Qemu-devel] [PATCH v4 02/20] ppc/pnv: add a PnvChip object

2016-10-07 Thread Cédric Le Goater
On 10/07/2016 06:26 AM, David Gibson wrote: > On Mon, Oct 03, 2016 at 09:24:38AM +0200, Cédric Le Goater wrote: >> This is is an abstraction of a POWER8 chip which is a set of cores >> plus other 'units', like the pervasive unit, the interrupt controller, >> the memory controller, the on-chip micro

Re: [Qemu-devel] [PATCHv3] Reducing stack frame size in stream_process_mem2s()

2016-10-07 Thread Peter Maydell
On 7 October 2016 at 01:03, Alistair Francis wrote: > On Thu, Oct 6, 2016 at 11:16 AM, wrote: >> From: Rutuja Shah >> >> This patch allocates memory for txbuf in struct Stream rather than the stack. >> As a result, the stack frame size is reduced of stream_process_mem2s(). >> >> Signed-off-by:

Re: [Qemu-devel] [PATCH] qtest: ask endianness of the target in qtest_init()

2016-10-07 Thread Peter Maydell
On 7 October 2016 at 08:31, Greg Kurz wrote: > On Fri, 7 Oct 2016 09:10:14 +0200 > Laurent Vivier wrote: > >> On 06/10/2016 22:45, Peter Maydell wrote: >> > On 6 October 2016 at 11:56, Laurent Vivier wrote: >> >> +/* ask endianness of the target */ >> >> + >> >> +qtest_sendf(s, "endianne

Re: [Qemu-devel] [PATCH] qtest: ask endianness of the target in qtest_init()

2016-10-07 Thread Peter Maydell
On 7 October 2016 at 00:55, David Gibson wrote: > It is an improvement. But I still think if we're relying on the > ill-defined "target endianness" we're already doing something wrong. Target endianness is not ill-defined. It's a clear and constant property of the bus the CPU is plugged into. It

Re: [Qemu-devel] [PATCH] vhost-user: don't poke at chardev internal QemuOpts

2016-10-07 Thread Marc-André Lureau
On Fri, Oct 7, 2016 at 1:15 PM Daniel P. Berrange wrote: > On Fri, Oct 07, 2016 at 09:10:27AM +, Marc-André Lureau wrote: > > Hi > > > > On Fri, Oct 7, 2016 at 1:04 PM Daniel P. Berrange > > wrote: > > > > > The vhost-user code is poking at the QemuOpts instance > > > in the CharDriverState

[Qemu-devel] [PATCH v2] vhost-user: don't poke at chardev internal QemuOpts

2016-10-07 Thread Daniel P. Berrange
The vhost-user code is poking at the QemuOpts instance in the CharDriverState struct, not realizing that it is valid for this to be NULL. e.g. the following crash shows a codepath where it will be NULL: Program terminated with signal SIGSEGV, Segmentation fault. #0 0x55baf6ab4adc in qemu_op

Re: [Qemu-devel] [PATCH] qtest: add read/write accessors with a specific endianness

2016-10-07 Thread Peter Maydell
On 7 October 2016 at 00:31, David Gibson wrote: > Honestly I think TAGET_WORDS_BIGENDIAN is just a hangover from when > nearly all CPUs worked exclusively in one endianness. It's never > terribly well defined. Feel free to try to get rid of it, but it's baked into the KVM ABI as a concept and al

Re: [Qemu-devel] [PATCH] qtest: ask endianness of the target in qtest_init()

2016-10-07 Thread Greg Kurz
On Fri, 7 Oct 2016 10:36:58 +0100 Peter Maydell wrote: > On 7 October 2016 at 08:31, Greg Kurz wrote: > > On Fri, 7 Oct 2016 09:10:14 +0200 > > Laurent Vivier wrote: > > > >> On 06/10/2016 22:45, Peter Maydell wrote: > >> > On 6 October 2016 at 11:56, Laurent Vivier wrote: > >> >> +/

Re: [Qemu-devel] [PATCH v2] vhost-user: don't poke at chardev internal QemuOpts

2016-10-07 Thread Peter Maydell
On 7 October 2016 at 10:49, Daniel P. Berrange wrote: > The vhost-user code is poking at the QemuOpts instance > in the CharDriverState struct, not realizing that it is > valid for this to be NULL. e.g. the following crash > shows a codepath where it will be NULL: > +typedef enum { > +/* Whet

Re: [Qemu-devel] [RFC 1/4] spapr_pci: Delegate placement of PCI host bridges to machine type

2016-10-07 Thread David Gibson
On Fri, Oct 07, 2016 at 04:34:59PM +1100, Alexey Kardashevskiy wrote: > On 07/10/16 16:10, David Gibson wrote: > > On Fri, Oct 07, 2016 at 02:57:43PM +1100, Alexey Kardashevskiy wrote: > >> On 06/10/16 14:03, David Gibson wrote: > >>> The 'spapr-pci-host-bridge' represents the virtual PCI host brid

[Qemu-devel] [PULL 01/20] trace: move colo trace events to net/ sub-directory

2016-10-07 Thread Stefan Hajnoczi
From: "Daniel P. Berrange" The colo patch series added various trace events to the top level trace-events file, despite the files using them being in a sub-dir. commit 30656b097e9dd7978d3fe9416cb9f5a421a9e63e Author: Zhang Chen Date: Tue Sep 27 10:22:34 2016 +0800 filter-rewriter:

[Qemu-devel] [PULL 00/20] Tracing patches

2016-10-07 Thread Stefan Hajnoczi
The following changes since commit e902754e3d0890945ddcc1b33748ed73762ddb8d: Merge remote-tracking branch 'remotes/dgibson/tags/ppc-for-2.8-20161006' into staging (2016-10-06 13:34:00 +0100) are available in the git repository at: git://github.com/stefanha/qemu.git tags/tracing-pull-request

[Qemu-devel] [PULL 10/20] trace: emit name <-> ID mapping in simpletrace header

2016-10-07 Thread Stefan Hajnoczi
From: "Daniel P. Berrange" Currently simpletrace assumes that events are given IDs starting from 0, based on the order in which they appear in the trace-events file, with no gaps. When the trace-events file is split up, this assumption becomes problematic. To deal with this, extend the simpletra

[Qemu-devel] [PULL 07/20] trace: break circular dependency in event-internal.h

2016-10-07 Thread Stefan Hajnoczi
From: "Daniel P. Berrange" Currently event-internal.h includes generated-events.h, while generated-events.h includes event-internal.h causing a circular dependency. event-internal.h requires that the content of generated-events.h comes first, so that it can see the typedefs for TraceEventID and

[Qemu-devel] [PULL 02/20] trace: add trace event iterator APIs

2016-10-07 Thread Stefan Hajnoczi
From: "Daniel P. Berrange" Currently methods which want to iterate over trace events, do so using the trace_event_count() and trace_event_id() methods. This leaks the concept of a single ID enum to the callers. There is an alternative trace_event_pattern() method which can be used in an iteration

[Qemu-devel] [PULL 04/20] trace: remove some now unused functions

2016-10-07 Thread Stefan Hajnoczi
From: "Daniel P. Berrange" The trace_event_count, trace_event_id and trace_event_pattern methods are no longer required now that everything is using the iterator APIs The trace_event_set_state and trace_event_set_vcpu_state macros were also unused. Reviewed-by: Stefan Hajnoczi Reviewed-by: Llu

Re: [Qemu-devel] [PATCH] qtest: ask endianness of the target in qtest_init()

2016-10-07 Thread Greg Kurz
On Fri, 7 Oct 2016 10:39:09 +0100 Peter Maydell wrote: > On 7 October 2016 at 00:55, David Gibson wrote: > > It is an improvement. But I still think if we're relying on the > > ill-defined "target endianness" we're already doing something wrong. > > Target endianness is not ill-defined. It's

[Qemu-devel] [PULL 12/20] trace: provide mechanism for registering trace events

2016-10-07 Thread Stefan Hajnoczi
From: "Daniel P. Berrange" Remove the notion of there being a single global array of trace events, by introducing a method for registering groups of events. The module_call_init() needs to be invoked at the start of any program that wants to make use of the trace support. Currently this covers s

[Qemu-devel] [PULL 06/20] trace: remove duplicate control.h includes in generated-tracers.h

2016-10-07 Thread Stefan Hajnoczi
From: "Daniel P. Berrange" The format/h.py file adds an include for control.h to generated-tracers.h. ftrace, log and syslog, then add more duplicate includes for control.h. Reviewed-by: Stefan Hajnoczi Reviewed-by: Lluís Vilanova Signed-off-by: Daniel P. Berrange Message-id: 1475588159-30598

[Qemu-devel] [PULL 03/20] trace: convert code to use event iterators

2016-10-07 Thread Stefan Hajnoczi
From: "Daniel P. Berrange" This converts the HMP/QMP monitor API implementations and some internal trace control methods to use the new trace event iterator APIs. Reviewed-by: Stefan Hajnoczi Signed-off-by: Daniel P. Berrange Reviewed-by: Lluís Vilanova Message-id: 1475588159-30598-5-git-send

[Qemu-devel] [PULL 11/20] trace: don't abort qemu if ftrace can't be initialized

2016-10-07 Thread Stefan Hajnoczi
From: "Daniel P. Berrange" If the ftrace backend is compiled into QEMU, any attempt to start QEMU while non-root will fail due to the inability to open /sys/kernel/debug/tracing/tracing_on. Add a fallback into the code so that it connects up the trace_marker_fd variable to /dev/null when getting

[Qemu-devel] [PULL 14/20] trace: dynamically allocate event IDs at runtime

2016-10-07 Thread Stefan Hajnoczi
From: "Daniel P. Berrange" Instead of having the code generator assign event IDs and event VCPU IDs, assign them when the events are registered at runtime. This will allow code to be generated from individual trace-events without having to figure out globally unique numbering at build time. Revi

[Qemu-devel] [PULL 05/20] trace: remove global 'uint16 dstate[]' array

2016-10-07 Thread Stefan Hajnoczi
From: "Daniel P. Berrange" Instead of having a global dstate array, declare a single 'uint16 TRACE_${EVENT_NAME}_DSTATE' variable for each trace event. Record a pointer to this variable in the TraceEvent struct too. By turning trace_event_get_state_dynamic_by_id into a macro, this still hits the

[Qemu-devel] [PULL 08/20] trace: give each trace event a named TraceEvent struct

2016-10-07 Thread Stefan Hajnoczi
From: "Daniel P. Berrange" Currently we only expose a TraceEvent array, which must be indexed via the TraceEventID enum constants. This changes the generator to expose a named TraceEvent instance for each event, with an _EVENT suffix. Reviewed-by: Lluís Vilanova Reviewed-by: Stefan Hajnoczi Si

[Qemu-devel] [PULL 13/20] trace: dynamically allocate trace_dstate in CPUState

2016-10-07 Thread Stefan Hajnoczi
From: "Daniel P. Berrange" The CPUState struct has a bitmap tracking which VCPU events are currently active. This is indexed based on the event ID values, and sized according the maximum TraceEventVCPUID enum value. When we start dynamically assigning IDs at runtime, we can't statically declare

[Qemu-devel] [PULL 15/20] trace: get rid of generated-events.h/generated-events.c

2016-10-07 Thread Stefan Hajnoczi
From: "Daniel P. Berrange" Currently the generated-events.[ch] files contain the event dstates, constants and TraceEvent structs, while the generated-tracers.[ch] files contain the actual trace probe logic. With the removal of usage of the event enums from the API there is no longer any compellin

[Qemu-devel] [PULL 16/20] trace: rename _read_events to read_events

2016-10-07 Thread Stefan Hajnoczi
From: "Daniel P. Berrange" The _read_events method is used by callers outside of its module, so should be a public method, not private. Reviewed-by: Stefan Hajnoczi Reviewed-by: Lluís Vilanova Signed-off-by: Daniel P. Berrange Message-id: 1475588159-30598-18-git-send-email-berra...@redhat.com

[Qemu-devel] [PULL 18/20] trace: pass trace-events to tracetool as a positional param

2016-10-07 Thread Stefan Hajnoczi
From: "Daniel P. Berrange" Instead of reading the contents of 'trace-events' from stdin, accept the filename as a positional parameter. This also allows for reading from multiple files, though this facility is not used at this time. Reviewed-by: Stefan Hajnoczi Reviewed-by: Lluís Vilanova Sign

[Qemu-devel] [PULL 09/20] trace: remove the TraceEventID and TraceEventVCPUID enums

2016-10-07 Thread Stefan Hajnoczi
From: "Daniel P. Berrange" The TraceEventID and TraceEventVCPUID enums constants are no longer actually used for anything critical. The TRACE_EVENT_COUNT limit is used to determine the size of the TraceEvents array, and can be removed if we just NULL terminate the array instead. The TRACE_VCPU_

[Qemu-devel] [PULL 17/20] trace: push reading of events up a level to tracetool main

2016-10-07 Thread Stefan Hajnoczi
From: "Daniel P. Berrange" Move the reading of events out of the 'tracetool.generate' method and into tracetool.main, so that the latter is not tied to generating from a single source of events. Reviewed-by: Stefan Hajnoczi Reviewed-by: Lluís Vilanova Signed-off-by: Daniel P. Berrange Message

Re: [Qemu-devel] Monitor brain dump

2016-10-07 Thread Kevin Wolf
Am 06.10.2016 um 13:07 hat Paolo Bonzini geschrieben: > On 05/10/2016 19:43, Dr. David Alan Gilbert wrote: > > > Speaking of the pocket calculator: my recommendation would be "nuke from > > > orbit". It adds surprising corner cases to the HMP language, and > > > provides next to no value. > > > >

Re: [Qemu-devel] [PATCH v2] vhost-user: don't poke at chardev internal QemuOpts

2016-10-07 Thread Marc-André Lureau
Hi On Fri, Oct 7, 2016 at 1:50 PM Daniel P. Berrange wrote: > The vhost-user code is poking at the QemuOpts instance > in the CharDriverState struct, not realizing that it is > valid for this to be NULL. e.g. the following crash > shows a codepath where it will be NULL: > > Program terminated w

[Qemu-devel] [PULL 20/20] trace: Add missing execution mode of guest events

2016-10-07 Thread Stefan Hajnoczi
From: Lluís Vilanova Add missing execution mode documentation for the 'guest_cpu_enter' and 'guest_cpu_reset' events. Signed-off-by: Lluís Vilanova Message-id: 147566900921.7708.656450813307396468.st...@fimbulvetr.bsc.es Signed-off-by: Stefan Hajnoczi --- trace-events | 2 ++ 1 file changed,

[Qemu-devel] [PULL 19/20] trace: introduce a formal group name for trace events

2016-10-07 Thread Stefan Hajnoczi
From: "Daniel P. Berrange" The declarations in the generated-tracers.h file are assuming there's only ever going to be one instance of this header, as they are not namespaced. When we have one header per event group, if a single source file needs to include multiple sets of trace events, the symb

Re: [Qemu-devel] [PULL 10/18] block: Move 'discard' option to bdrv_open_common()

2016-10-07 Thread Kevin Wolf
Am 07.10.2016 um 11:01 hat Gerd Hoffmann geschrieben: > On Di, 2016-09-27 at 15:53 +0200, Kevin Wolf wrote: > > This enables its use for nested child nodes. The compatibility > > between the 'discard' and 'detect-zeroes' setting is checked in > > bdrv_open_common() now as the former setting isn't a

Re: [Qemu-devel] [PATCH v2] vhost-user: don't poke at chardev internal QemuOpts

2016-10-07 Thread Daniel P. Berrange
On Fri, Oct 07, 2016 at 10:59:09AM +0100, Peter Maydell wrote: > On 7 October 2016 at 10:49, Daniel P. Berrange wrote: > > The vhost-user code is poking at the QemuOpts instance > > in the CharDriverState struct, not realizing that it is > > valid for this to be NULL. e.g. the following crash > >

[Qemu-devel] [PATCH v2] qtest: ask endianness of the target in qtest_init()

2016-10-07 Thread Laurent Vivier
The target endianness is not deduced anymore from the architecture name but asked directly to the guest, using a new qtest command: "endianness". As it can't change (this is the value of TARGET_WORDS_BIGENDIAN), we store it to not have to ask every time we want to know if we have to byte-swap a val

Re: [Qemu-devel] [PATCH v2] vhost-user: don't poke at chardev internal QemuOpts

2016-10-07 Thread Daniel P. Berrange
On Fri, Oct 07, 2016 at 10:12:23AM +, Marc-André Lureau wrote: > Hi > > On Fri, Oct 7, 2016 at 1:50 PM Daniel P. Berrange > wrote: > > > The vhost-user code is poking at the QemuOpts instance > > in the CharDriverState struct, not realizing that it is > > valid for this to be NULL. e.g. the

Re: [Qemu-devel] [PATCH v2] qtest: ask endianness of the target in qtest_init()

2016-10-07 Thread Greg Kurz
On Fri, 7 Oct 2016 12:14:27 +0200 Laurent Vivier wrote: > The target endianness is not deduced anymore from > the architecture name but asked directly to the guest, > using a new qtest command: "endianness". As it can't > change (this is the value of TARGET_WORDS_BIGENDIAN), > we store it to not

Re: [Qemu-devel] [PATCH] block: Add bdrv_runtime_opts to query-command-line-options

2016-10-07 Thread Gerd Hoffmann
On Do, 2016-10-06 at 11:40 +0200, Kevin Wolf wrote: > Recently we moved a few options from QemuOptsLists in blockdev.c to > bdrv_runtime_opts in block.c in order to make them accissble using > blockdev-add. However, this has the side effect that these options are > missing from query-command-line-o

Re: [Qemu-devel] [Qemu-block] [PATCH] qcow2: Optimize L2 table cache size based on image and cluster sizes

2016-10-07 Thread Alberto Garcia
On Fri 07 Oct 2016 10:14:32 AM CEST, Kevin Wolf wrote: >> Maybe pass a negative integer to indicate percentage, so string is not >> required?: >> l2-cache-size=-100(l2-cache-size=max, covers entire drive) >> l2-cache-size=-50 (l2-cache-size=50% of max, covers half of drive) >> l2-cache-si

Re: [Qemu-devel] [PATCH v2] qtest: ask endianness of the target in qtest_init()

2016-10-07 Thread Laurent Vivier
On 07/10/2016 12:48, Greg Kurz wrote: > On Fri, 7 Oct 2016 12:14:27 +0200 > Laurent Vivier wrote: > >> The target endianness is not deduced anymore from >> the architecture name but asked directly to the guest, >> using a new qtest command: "endianness". As it can't >> change (this is the valu

Re: [Qemu-devel] [PATCH] usb: xHCI: add check to limit command TRB processing

2016-10-07 Thread P J P
Hello Gerd, +-- On Fri, 7 Oct 2016, Gerd Hoffmann wrote --+ | I think it is better to apply the limit to link trbs only (which allow | to jump to another address so the guest can build loops with it). Also | I think the limit can be much stricter then without breaking stuff as | typically a lin

Re: [Qemu-devel] [PATCH v2] qmp: Disable query-cpu-* commands when they're unavailable

2016-10-07 Thread Markus Armbruster
Eduardo Habkost writes: > Instead of requiring clients to actually call the query-cpu-* > commands to find out if they are implemented, remove them from > the output of "query-commands", so clients know they are not > available. > > This is implemented by extending the existing hack at > qmp_unre

Re: [Qemu-devel] [PATCH] docs: Belatedly update for move of QMP/* to docs/

2016-10-07 Thread Markus Armbruster
Markus Armbruster writes: > Missed in commit 7537fe0 and commit 9b89b6a. > > Signed-off-by: Markus Armbruster Applied to my qapi-next branch.

Re: [Qemu-devel] [PATCH] docs: Belatedly update for move of qmp-commands.txt.

2016-10-07 Thread Markus Armbruster
Markus Armbruster writes: > Missed in commit d076a2a and commit bd6092e. > > Signed-off-by: Markus Armbruster Applied to my qapi-next branch, with a cosmetic change to the commit message.

Re: [Qemu-devel] [PATCH v2] qmp: Disable query-cpu-* commands when they're unavailable

2016-10-07 Thread Christian Borntraeger
On 10/05/2016 09:49 PM, Eduardo Habkost wrote: > Instead of requiring clients to actually call the query-cpu-* > commands to find out if they are implemented, remove them from > the output of "query-commands", so clients know they are not > available. > > This is implemented by extending the exist

[Qemu-devel] [PULL 01/12] qmp: fix object-add assert() without props

2016-10-07 Thread Markus Armbruster
From: Marc-André Lureau Since commit ad739706bbadee49, user_creatable_add_type() expects to be given a qdict. However, if object-add is called without props, you reach the assert: "qemu/qom/object_interfaces.c:115: user_creatable_add_type: Assertion `qdict' failed.", because the qdict isn't creat

Re: [Qemu-devel] [QEMU PATCH v5 3/6] migration: extend VMStateInfo

2016-10-07 Thread Dr. David Alan Gilbert
* Jianjun Duan (du...@linux.vnet.ibm.com) wrote: > Current migration code cannot handle some data structures such as > QTAILQ in qemu/queue.h. Here we extend the signatures of put/get > in VMStateInfo so that customized handling is supported. > > Signed-off-by: Jianjun Duan > --- > hw/net/vmxnet

[Qemu-devel] [PULL 00/12] QAPI patches for 2016-10-07

2016-10-07 Thread Markus Armbruster
The following changes since commit a65b6f27ce65e2e4f771f69d549ffa455a4d543a: Merge remote-tracking branch 'remotes/dgilbert/tags/pull-hmp-20161004' into staging (2016-10-04 18:57:12 +0100) are available in the git repository at: git://repo.or.cz/qemu/armbru.git tags/pull-qapi-2016-10-07 fo

[Qemu-devel] [PULL 06/12] qapi: assert list entry has a value

2016-10-07 Thread Markus Armbruster
From: Marc-André Lureau This helps to figure out the expectations. Signed-off-by: Marc-André Lureau Reviewed-by: Eric Blake Message-Id: <20160930095948.3154-3-marcandre.lur...@redhat.com> Reviewed-by: Markus Armbruster Signed-off-by: Markus Armbruster --- qapi/qmp-input-visitor.c | 1 + 1 f

[Qemu-devel] [PULL 12/12] docs: Belatedly update for move of QMP/* to docs/

2016-10-07 Thread Markus Armbruster
Missed in commit 7537fe0 and commit 9b89b6a. Signed-off-by: Markus Armbruster Message-Id: <1475766600-7273-1-git-send-email-arm...@redhat.com> Reviewed-by: Eric Blake --- docs/qmp-commands.txt | 2 +- docs/writing-qmp-commands.txt | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(

[Qemu-devel] [PULL 05/12] qapi: add assert about root value

2016-10-07 Thread Markus Armbruster
From: Marc-André Lureau qiv->root should not be null, make that clearer with some assert. Signed-off-by: Marc-André Lureau Reviewed-by: Eric Blake Message-Id: <20160930095948.3154-2-marcandre.lur...@redhat.com> Reviewed-by: Markus Armbruster Signed-off-by: Markus Armbruster --- qapi/qmp-inp

[Qemu-devel] [PULL 10/12] qmp: Disable query-cpu-* commands when they're unavailable

2016-10-07 Thread Markus Armbruster
From: Eduardo Habkost Instead of requiring clients to actually call the query-cpu-* commands to find out if they are implemented, remove them from the output of "query-commands", so clients know they are not available. This is implemented by extending the existing hack at qmp_unregister_commands

[Qemu-devel] [PULL 07/12] qapi: return a 'missing parameter' error

2016-10-07 Thread Markus Armbruster
From: Marc-André Lureau The 'old' dispatch code returned a QERR_MISSING_PARAMETER for missing parameters, but the qapi qmp_dispatch() code uses QERR_INVALID_PARAMETER_TYPE. Improve qapi code to return QERR_MISSING_PARAMETER where appropriate. Fix expected error message in iotests. Signed-off-b

[Qemu-devel] [PULL 09/12] MAINTAINERS: Pass the QObject staff from Luiz to Markus

2016-10-07 Thread Markus Armbruster
QObject is fairly tightly coupled to QAPI these days, and I've been effectively maintaining it together with QAPI for a while. Update MAINTAINERS to reflect that. Signed-off-by: Markus Armbruster Message-Id: <1475084022-30117-3-git-send-email-arm...@redhat.com> Acked-by: Luiz Capitulino --- MA

[Qemu-devel] [PULL 04/12] tests: start generic qemu-qmp tests

2016-10-07 Thread Markus Armbruster
From: Marc-André Lureau These 2 tests exhibit two qmp bugs fixed by the previous patches. Signed-off-by: Marc-André Lureau Reviewed-by: Daniel P. Berrange Reviewed-by: Eric Blake Message-Id: <20160922203927.28241-4-marcandre.lur...@redhat.com> [Rename tests/test-qemu-qmp.c to tests/qmp-test.c

[Qemu-devel] [PATCH] nvic: allow to set pending status for not active interrupts

2016-10-07 Thread marcin.krzeminski
From: Marcin Krzeminski According to ARM DUI 0552A 4.2.10. NVIC set pending status also for disabled interrupts. This patch adds possibility to emulate this in Qemu. Signed-off-by: Marcin Krzeminski --- hw/intc/arm_gic.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/hw/

[Qemu-devel] [PULL 02/12] qapi: Fix crash when 'any' or 'null' parameter is missing

2016-10-07 Thread Markus Armbruster
From: Marc-André Lureau Unlike the other visit methods, visit_type_any() and visit_type_null() neglect to check whether qmp_input_get_object() succeeded. They crash when it fails. Reproducer: { "execute": "qom-set", "arguments": { "path": "/machine", "property": "rtc-time" } } Will crash wi

[Qemu-devel] [PULL 03/12] tests/test-qmp-input-strict: Cover missing struct members

2016-10-07 Thread Markus Armbruster
These tests would have caught the bug fixed by the previous commit. Signed-off-by: Markus Armbruster Message-Id: <1475594630-24758-1-git-send-email-arm...@redhat.com> --- tests/test-qmp-input-strict.c | 46 +++ 1 file changed, 46 insertions(+) diff --git

[Qemu-devel] [PATCH v3] net: don't poke at chardev internal QemuOpts

2016-10-07 Thread Daniel P. Berrange
The vhost-user & colo code is poking at the QemuOpts instance in the CharDriverState struct, not realizing that it is valid for this to be NULL. e.g. the following crash shows a codepath where it will be NULL: Program terminated with signal SIGSEGV, Segmentation fault. #0 0x55baf6ab4adc in

[Qemu-devel] [PULL 11/12] docs: Belatedly update for move of qmp-commands.txt

2016-10-07 Thread Markus Armbruster
Missed in commit d076a2a and commit bd6092e. Signed-off-by: Markus Armbruster Message-Id: <1474546563-16332-1-git-send-email-arm...@redhat.com> Reviewed-by: Marc-André Lureau --- docs/xen-save-devices-state.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/xen-save-de

Re: [Qemu-devel] [PATCH] linux-user: Fix definition of target_sigevent for 32-bit guests

2016-10-07 Thread Riku Voipio
On Tue, Oct 04, 2016 at 02:08:24PM +0100, Peter Maydell wrote: > Ping ? Applied, thanks. > thanks > -- PMM > > On 2 September 2016 at 18:40, Peter Maydell wrote: > > The sigevent structure includes a union with some fields which > > are pointers. For the QEMU target_sigevent structure we must

Re: [Qemu-devel] [PATCH] linux-user: use libc wrapper instead of direct mremap syscall

2016-10-07 Thread Riku Voipio
On Fri, Sep 30, 2016 at 07:35:45PM -0700, Peter Maydell wrote: > On 30 September 2016 at 16:39, Felix Janda wrote: > > This commit essentially reverts commit > > 3af72a4d98dca033492102603734cbc63cd2694a, which has replaced > > five-argument calls to mremap() by direct mremap syscalls for > > compa

[Qemu-devel] [PULL 08/12] MAINTAINERS: Pass the HMP staff from Luiz to David

2016-10-07 Thread Markus Armbruster
David graciously volunteered to take this off Luiz's hands. Signed-off-by: Markus Armbruster Message-Id: <1475084022-30117-2-git-send-email-arm...@redhat.com> Reviewed-by: Dr. David Alan Gilbert Acked-by: Luiz Capitulino --- MAINTAINERS | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)

[Qemu-devel] [PATCH] replication: interrupt failover if the main device is closed

2016-10-07 Thread Paolo Bonzini
Without this change, there is a race condition in tests/test-replication. Depending on how fast the failover job (active commit) runs, there is a chance of two bad things happening: 1) replication_done can be called after the secondary has been closed and hence when the BDRVReplicationState is not

Re: [Qemu-devel] [PATCH v2] qtest: ask endianness of the target in qtest_init()

2016-10-07 Thread Greg Kurz
On Fri, 7 Oct 2016 12:57:41 +0200 Laurent Vivier wrote: > On 07/10/2016 12:48, Greg Kurz wrote: > > On Fri, 7 Oct 2016 12:14:27 +0200 > > Laurent Vivier wrote: > > > >> The target endianness is not deduced anymore from > >> the architecture name but asked directly to the guest, > >> using a

  1   2   3   4   >