Re: [Qemu-devel] [PATCH 08/10] tcg: add memory barriers in page_find_alloc accesses

2015-08-28 Thread Paolo Bonzini
On 28/08/2015 17:40, Peter Maydell wrote: > Don't we also need to use an atomic_rcu_read() for the load > pd = *lp; > (which is between hunk 1 and 2 in this patch) ? Yes. Paolo

Re: [Qemu-devel] [PATCH 07/10] tcg: comment on which functions have to be called with mmap_lock held

2015-08-28 Thread Paolo Bonzini
On 28/08/2015 17:33, Peter Maydell wrote: > Some overall documentation on what the mmap_lock is protecting > (and thus when it needs to be taken) would be nice. > > Otherwise > Reviewed-by: Peter Maydell > > I couldn't see where we take the mmap_lock when we call > tb_gen_code() from tb_find_s

Re: [Qemu-devel] [PATCH 04/10] exec-all: remove non-TCG stuff from exec-all.h header.

2015-08-28 Thread Paolo Bonzini
On 28/08/2015 16:53, Peter Maydell wrote: > sysemu.h is a bit of a huge grab-bag of stuff, so it seems > a shame to put qemu_in_vcpu_thread() into it, given that > (a) that function is only used by a couple of files and > (b) the files that do want that function don't want most of > what's in sys

Re: [Qemu-devel] [PATCH 02/10] cpus: remove tcg_halt_cond global variable.

2015-08-28 Thread Paolo Bonzini
On 28/08/2015 16:36, Peter Maydell wrote: > With this patch, code-wise tcg_halt_cond and tcg_cpu_thread > are used in pretty much parallel ways (first call into > qemu_tcg_init_vcpu() sets them up, all the rest just copy > them into the CPU struct). The only difference is that one > of them a sta

Re: [Qemu-devel] [PATCH 03/10] replace spinlock by QemuMutex.

2015-08-28 Thread Paolo Bonzini
On 28/08/2015 16:53, Frederic Konrad wrote: >> After this commit it looks like we have no users of spinlock_t >> at all. It would be good to have a followup patch which deleted >> include/exec/spinlock.h. > > Seems Paolo forget to pick up the following patch from the mttcg tree: > "remove unused

Re: [Qemu-devel] [PATCH] tcg/aarch64: Fix tcg_out_qemu_{ld, st} for linux-user

2015-08-28 Thread Paolo Bonzini
On 28/08/2015 01:47, Andreas Färber wrote: > The argument order for the !CONFIG_SOFTMMU case was jumbled up since > ffc6372851d8631a9f9fa56ec613b3244dc635b9 ("tcg/aarch64: use 32-bit > offset for 32-bit user-mode emulation"), regressing from -rc2 to v2.4.0. > Fix their order to avoid segfaults, e

Re: [Qemu-devel] [PATCH] monitor: allow object_del & device_del to accept QOM paths

2015-08-28 Thread Paolo Bonzini
On 28/08/2015 14:53, Markus Armbruster wrote: > I believe this makes sense no matter what we do about device IDs (see > thread "Should we auto-generate IDs?"). I haven't read that huge thread yet, but I think it gives the user too much power. There are internal objects that are not supposed to

Re: [Qemu-devel] [PATCH] tcg/aarch64: Fix tcg_out_qemu_{ld, st} for linux-user

2015-08-28 Thread Richard Henderson
On 08/28/2015 09:23 AM, Andreas Färber wrote: An otype argument is being inserted as next-to-last argument for the function definitions. Same for the softmmu callsites. Only in the *-user callsites the argument order is being changed with addr_reg and off_r switching order? I don't see why that s

[Qemu-devel] [PATCH v6 3/4] xlnx-zynqmp.c: Convert some of the error_propagate() calls to error_abort

2015-08-28 Thread Alistair Francis
Convert all of the non-realize error_propagate() calls into error_abort calls as they shouldn't be user visible failure cases. Signed-off-by: Alistair Francis Reviewed-by: Peter Crosthwaite --- hw/arm/xlnx-zynqmp.c | 14 ++ 1 files changed, 2 insertions(+), 12 deletions(-) diff

[Qemu-devel] [PATCH v6 2/4] ahci.c: Don't assume AHCIState's parent is AHCIPCIState

2015-08-28 Thread Alistair Francis
The AHCIState struct can either have AHCIPCIState or SysbusAHCIState as a parent. The ahci_irq_lower() and ahci_irq_raise() functions assume that it is always AHCIPCIState, which is not always the case, which causes a seg fault. Verify what the container of AHCIState is before setting the PCIDevice

[Qemu-devel] [PATCH v6 0/4] xlnx-zynqmp: Connect the AHCI SATA device

2015-08-28 Thread Alistair Francis
This series connects the AHCI SATA device to the ZynqMP machine. It requires a restructure of the AHCI file to make the AHCI state struct visible. It also requires a small change to the ahci_irq_lower() and ahci_irq_raise() functions to avoid assuming that the AHCIState is a child of AHCIPCIState.

[Qemu-devel] [PATCH v6 1/4] ahci: Separate the AHCI state structure into the header

2015-08-28 Thread Alistair Francis
Pull the AHCI state structure out into the header. This allows other containers to access the struct. This is required to add the device to modern SoC containers. Signed-off-by: Alistair Francis Reviewed-by: Sai Pavan Boddu Reviewed-by: Peter Crosthwaite --- hw/ide/ahci.c | 13 -

Re: [Qemu-devel] [PATCH] docs: fix a qga/qapi-schema.json comment

2015-08-28 Thread Eric Blake
On 08/27/2015 04:48 AM, marcandre.lur...@redhat.com wrote: > From: Marc-André Lureau > > For consistency with the rest of the comment blocks. > > Signed-off-by: Marc-André Lureau > --- > qga/qapi-schema.json | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > Reviewed-by: Eric Blake

Re: [Qemu-devel] [PATCH COLO-Frame v8 31/34] COLO: Add colo-set-checkpoint-period command

2015-08-28 Thread Eric Blake
On 07/29/2015 02:45 AM, zhanghailiang wrote: > With this command, we can control the period of checkpoint, if > there is no comparison of net packets. > > Cc: Luiz Capitulino > Cc: Eric Blake > Cc: Markus Armbruster > Signed-off-by: zhanghailiang > Signed-off-by: Li Zhijian > --- > hmp-comma

Re: [Qemu-devel] [PATCH COLO-Frame v8 21/34] COLO: Add new command parameter 'forward_nic' 'colo_script' for net

2015-08-28 Thread Eric Blake
On 07/29/2015 02:45 AM, zhanghailiang wrote: > The 'forward_nic' should be assigned with network name, > for exmple, 'eth2'. It will be parameter of 'colo_script', s/exmple/example/ > 'colo_script' should be assigned with an scirpt path. s/scirpt/script/ > > We parse these parameter in tap. s

Re: [Qemu-devel] [PATCH COLO-Frame v8 19/34] qmp event: Add event notification for COLO error

2015-08-28 Thread Eric Blake
On 07/29/2015 02:45 AM, zhanghailiang wrote: > If some errors happen during VM's COLO FT stage, it's import to notify the > users s/import/important/ > this event, Togehter with 'colo_lost_heartbeat', users can intervene in COLO's s/this event,/of this event./ s/Togehter/Together/ > failover w

Re: [Qemu-devel] [PATCH COLO-Frame v8 16/34] COLO failover: Introduce a new command to trigger a failover

2015-08-28 Thread Eric Blake
On 07/29/2015 02:45 AM, zhanghailiang wrote: > We leave users to use whatever heartbeat solution they want, if the heartbeat > is lost, or other errors they detect, they can use command > 'colo_lost_heartbeat' to tell COLO to do failover, COLO will do operations > accordingly. > > For example, > I

Re: [Qemu-devel] [PATCH COLO-Frame v8 09/34] COLO: Add a new RunState RUN_STATE_COLO

2015-08-28 Thread Eric Blake
On 07/29/2015 02:45 AM, zhanghailiang wrote: > Guest will enter this state when paused to save/restore VM state > under colo checkpoint. > > Cc: Eric Blake > Cc: Markus Armbruster > Signed-off-by: zhanghailiang > Signed-off-by: Li Zhijian > Signed-off-by: Gonglei > Reviewed-by: Dr. David Alan

Re: [Qemu-devel] [PATCH COLO-Frame v8 06/34] migration: Integrate COLO checkpoint process into migration

2015-08-28 Thread Eric Blake
On 07/29/2015 02:45 AM, zhanghailiang wrote: > Add a migrate state: MIGRATION_STATUS_COLO, enter this migration state > after the first live migration successfully finished. > > Signed-off-by: zhanghailiang > Signed-off-by: Li Zhijian > Signed-off-by: Gonglei > --- > include/migration/colo.h |

Re: [Qemu-devel] [PATCH COLO-Frame v8 02/34] migration: Introduce capability 'colo' to migration

2015-08-28 Thread Eric Blake
On 07/29/2015 02:45 AM, zhanghailiang wrote: > We add helper function colo_supported() to indicate whether > colo is supported or not, with which we use to control whether or not > showing 'colo' string to users, they can use qmp command > 'query-migrate-capabilities' or hmp command 'info migrate_c

Re: [Qemu-devel] [PATCH v4 13/13] qga: start a man page

2015-08-28 Thread Eric Blake
On 08/26/2015 05:34 PM, marcandre.lur...@redhat.com wrote: > From: Marc-André Lureau > > Add a simple man page for the qemu agent. > > Signed-off-by: Marc-André Lureau > Reviewed-by: Michael Roth > --- > Makefile | 14 +- > qemu-doc.texi | 6 +++ > qemu-ga.texi | 136 > +

[Qemu-devel] [PATCH] target-arm: Fix general-purpose register mapping between AArch32 state and AArch64 state

2015-08-28 Thread Sergey Sorokin
There is an error in functions aarch64_sync_32_to_64() and aarch64_sync_64_to_32() with mapping of registers between AArch32 and AArch64. The patch fixes it according to ARM ARM D1.20.1 (table D1-77). Signed-off-by: Sergey Sorokin --- target-arm/helper.c | 64 ++--

Re: [Qemu-devel] [PATCH v5 8/9] ui: fix return type for VNC I/O functions to be ssize_t

2015-08-28 Thread Eric Blake
On 08/26/2015 09:05 AM, Daniel P. Berrange wrote: > Various VNC server I/O functions return 'long' and then > also pass this to a method accepting 'int'. All these > should be ssize_t to match the signature of read/write > APIs and thus avoid potential for integer truncation / > wraparound. > > Si

Re: [Qemu-devel] [FIX PATCH] spapr_rtas: Prevent QEMU crash during hotplug without a prior device_add

2015-08-28 Thread Michael Roth
Quoting Bharata B Rao (2015-08-27 00:28:57) > On Wed, Aug 26, 2015 at 09:17:09AM -0500, Michael Roth wrote: > > Quoting Bharata B Rao (2015-08-25 23:04:11) > > > If drmgr is used in the guest to hotplug a device before a device_add > > > has been issued via the QEMU monitor, QEMU segfaults in > >

[Qemu-devel] [RFC] docs: describe QEMU's VMGenID design

2015-08-28 Thread Laszlo Ersek
Cc: Paolo Bonzini Cc: Gal Hammer Cc: Igor Mammedov Cc: "Michael S. Tsirkin" Signed-off-by: Laszlo Ersek --- Notes: This is based on the super long private email discussion we had two months ago, plus on the IRL discussion between Michael and myself @ the KVM Forum 2015. docs/spe

Re: [Qemu-devel] ARM softmmu breakpoint misbehavior

2015-08-28 Thread Peter Maydell
On 24 August 2015 at 18:36, Sergey Fedorov wrote: > Hi all, > > Seems there is a bug in ARM breakpoint emulation. I am not sure how to > fix it and I would appreciate any suggestion. It is best illustrated by > a simple test which sets up and enables an unlinked address match > breakpoint but does

[Qemu-devel] [PATCH v2] hw/usb/bus.c: print device ID when 'info usb' used

2015-08-28 Thread Programmingkid
Print the ID (if available) of each device when 'info usb' is used in the monitor. Signed-off-by: John Arbuckle --- Added conditional code that only prints the ID if it is available. hw/usb/bus.c | 14 +++--- 1 files changed, 11 insertions(+), 3 deletions(-) diff --git a/hw/usb/bus

Re: [Qemu-devel] [PATCH] vnc: allow fall back to RAW encoding

2015-08-28 Thread Peter Lieven
Am 28.08.2015 um 13:56 schrieb Gerd Hoffmann: > On Do, 2015-08-27 at 14:46 +0200, Peter Lieven wrote: >> I have observed that depending on the contents and the encoding it happens >> that sending data as RAW sometimes would take less space than the encoded >> data. >> This is especially the case f

Re: [Qemu-devel] [PATCH V3] block/nfs: cache allocated filesize for read-only files

2015-08-28 Thread Jeff Cody
On Thu, Aug 27, 2015 at 12:30:41PM +0200, Peter Lieven wrote: > If the file is readonly its not expected to grow so > save the blocking call to nfs_fstat_async and use > the value saved at connection time. Also important > the monitor (and thus the main loop) will not hang > if block device info is

[Qemu-devel] [PATCH v5 3/4] xlnx-zynqmp.c: Convert some of the error_propagate() calls to error_abort

2015-08-28 Thread Alistair Francis
Convert all of the non-realize error_propagate() calls into error_abort calls as they shouldn't be user visible failure cases. Signed-off-by: Alistair Francis Reviewed-by: Peter Crosthwaite --- hw/arm/xlnx-zynqmp.c | 14 ++ 1 files changed, 2 insertions(+), 12 deletions(-) diff

[Qemu-devel] [PATCH v5 1/4] ahci: Separate the AHCI state structure into the header

2015-08-28 Thread Alistair Francis
Pull the AHCI state structure out into the header. This allows other containers to access the struct. This is required to add the device to modern SoC containers. Signed-off-by: Alistair Francis Reviewed-by: Sai Pavan Boddu Reviewed-by: Peter Crosthwaite --- hw/ide/ahci.c | 13 -

[Qemu-devel] [PATCH v5 2/4] ahci.c: Don't assume AHCIState's parent is AHCIPCIState

2015-08-28 Thread Alistair Francis
The AHCIState struct can either have AHCIPCIState or SysbusAHCIState as a parent. The ahci_irq_lower() and ahci_irq_raise() functions assume that it is always AHCIPCIState, which is not always the case, which causes a seg fault. Verify what the container of AHCIState is before setting the PCIDevice

[Qemu-devel] [PATCH v5 0/4] xlnx-zynqmp: Connect the AHCI SATA device

2015-08-28 Thread Alistair Francis
This series connects the AHCI SATA device to the ZynqMP machine. It requires a restructure of the AHCI file to make the AHCI state struct visible. It also requires a small change to the ahci_irq_lower() and ahci_irq_raise() functions to avoid assuming that the AHCIState is a child of AHCIPCIState.

Re: [Qemu-devel] [PATCH v2 07/18] nvdimm: reserve address range for NVDIMM

2015-08-28 Thread Eduardo Habkost
On Fri, Aug 14, 2015 at 10:52:00PM +0800, Xiao Guangrong wrote: > NVDIMM reserves all the free range above 4G to do: > - Persistent Memory (PMEM) mapping > - implement NVDIMM ACPI device _DSM method > > Signed-off-by: Xiao Guangrong [...] > @@ -1302,6 +1303,7 @@ FWCfgState *pc_memory_init(Machine

Re: [Qemu-devel] [PATCH] q35: Remove old machine versions

2015-08-28 Thread Eduardo Habkost
On Fri, Aug 28, 2015 at 12:00:58PM +0200, Markus Armbruster wrote: > Eduardo Habkost writes: > > > On Thu, Aug 27, 2015 at 01:50:10PM +0300, Michael S. Tsirkin wrote: > >> On Tue, Aug 25, 2015 at 05:21:16PM +0100, Daniel P. Berrange wrote: > >> > On Mon, Aug 24, 2015 at 11:54:48AM +0200, Markus A

[Qemu-devel] [PATCH v2 22/26] qapi-commands: Fix gen_err_check(e) for e and e != 'local_err'

2015-08-28 Thread Markus Armbruster
gen_err_check() hard-codes 'local_err' instead of substituting the argument. Currently harmless, since all callers pass either None or 'local_err'. Signed-off-by: Markus Armbruster Reviewed-by: Eric Blake --- scripts/qapi-commands.py | 13 +++-- 1 file changed, 7 insertions(+), 6 delet

[Qemu-devel] [PATCH v2 24/26] qapi-commands: Don't feed output of mcgen() to mcgen() again

2015-08-28 Thread Markus Armbruster
Multiple passes through mcgen() is prone to produce unwanted blank lines, which we then combat by sprinkling .rstrip() on top. Just don't do it. Signed-off-by: Markus Armbruster Reviewed-by: Eric Blake --- scripts/qapi-commands.py | 52 +++- 1 file c

[Qemu-devel] [PATCH v2 18/26] tests/qapi-schema: Rename tests from data- to args-

2015-08-28 Thread Markus Armbruster
Since every schema entity has 'data', the data- prefix conveys no information. These tests actually exercise commands. Only commands have arguments, so change the prefix to to args-. Signed-off-by: Markus Armbruster Reviewed-by: Eric Blake --- tests/Makefile

[Qemu-devel] [PATCH v2 20/26] qapi: Fix to reject union command and event arguments

2015-08-28 Thread Markus Armbruster
A command's or event's 'data' must be a struct type, given either as a dictionary, or as struct type name. Commit dd883c6 tightened the checking there, but not enough: we still accept 'union'. Fix to reject it. We may want to support union types there, but we'll have to extend qapi-commands.py a

[Qemu-devel] [PATCH v2 25/26] qapi-commands: Drop useless initialization

2015-08-28 Thread Markus Armbruster
In generated command handlers, the assignment to retval dominates its only use. Therefore, its initialization is useless. Drop it. Suggested-by: Eric Blake Signed-off-by: Markus Armbruster Reviewed-by: Eric Blake --- docs/qapi-code-gen.txt | 2 +- scripts/qapi-commands.py | 8 ++-- 2 f

[Qemu-devel] [PATCH v2 15/26] qapi: Document shortcoming with union 'data' branch

2015-08-28 Thread Markus Armbruster
From: Eric Blake Add a FIXME to remind us to fully audit whether removing the 'void *data' branch of each qapi union type can be done safely. Signed-off-by: Eric Blake Message-Id: <1438297637-26789-1-git-send-email-ebl...@redhat.com> Signed-off-by: Markus Armbruster --- scripts/qapi-types.py

[Qemu-devel] [PATCH v2 21/26] qapi: Command returning anonymous type doesn't work, outlaw

2015-08-28 Thread Markus Armbruster
Reproducer: with { 'command': 'user_def_cmd4', 'returns': { 'a': 'int' } } added to qapi-schema-test.json, qapi-commands.py dies when it tries to generate the command handler function Traceback (most recent call last): File "/work/armbru/qemu/scripts/qapi-commands.py", line 359, in

[Qemu-devel] [PATCH v2 26/26] qapi: Generated code cleanup

2015-08-28 Thread Markus Armbruster
Clean up white-space, brace placement, and superfluous #ifdef QAPI_TYPES_BUILTIN_CLEANUP_DEF. Signed-off-by: Markus Armbruster Reviewed-by: Eric Blake --- docs/qapi-code-gen.txt | 12 - scripts/qapi-commands.py | 1 + scripts/qapi-event.py| 3 +-- scripts/qapi-types.py| 66 +

[Qemu-devel] [PATCH v2 19/26] qapi-tests: New tests for union, alternate command arguments

2015-08-28 Thread Markus Armbruster
A command's 'data' must be a struct type, given either as a dictionary, or as struct type name. Existing test case data-int.json covers simple type 'int'. Add test cases for type names referring to union and alternate types. The latter is caught (good), but the former is not (bug). Events have

[Qemu-devel] [PATCH v2 14/26] qapi: Document that input visitor semantics are prone to leaks

2015-08-28 Thread Markus Armbruster
From: Eric Blake Most functions that can return a pointer or set an Error ** value are decent enough to guarantee a NULL return when reporting an error. Not so with our generated qapi visitor functions. If the caller is not careful to clean up partially-allocated objects on error, then the calle

[Qemu-devel] [PATCH v2 23/26] qapi-commands: Inline gen_marshal_output_call()

2015-08-28 Thread Markus Armbruster
Signed-off-by: Markus Armbruster Reviewed-by: Eric Blake --- scripts/qapi-commands.py | 12 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/scripts/qapi-commands.py b/scripts/qapi-commands.py index 3965ca8..6de5229 100644 --- a/scripts/qapi-commands.py +++ b/scripts/qa

[Qemu-devel] [PATCH v2 13/26] tests/qapi-schema: Document events with base don't work

2015-08-28 Thread Markus Armbruster
When event FOO's 'data' is a struct with a base, we consider only the struct's direct members, and ignore its base. The generated qapi_event_send_foo() doesn't take arguments for base members. No such events currently exist in the QMP schema. Signed-off-by: Markus Armbruster Reviewed-by: Eric B

[Qemu-devel] [PATCH v2 17/26] tests/qapi-schema: Restore test case for flat union base bug

2015-08-28 Thread Markus Armbruster
Test case added in commit 2fc0043, and messed up in commit 5223070. Signed-off-by: Markus Armbruster Reviewed-by: Eric Blake --- tests/qapi-schema/qapi-schema-test.json | 5 +++-- tests/qapi-schema/qapi-schema-test.out | 8 2 files changed, 7 insertions(+), 6 deletions(-) diff --git

[Qemu-devel] [PATCH v2 09/26] qapi-visit: Fix generated code when schema has forward refs

2015-08-28 Thread Markus Armbruster
The visit_type_implicit_FOO() are generated on demand, right before their first use. Used by visit_type_STRUCT_fields() when STRUCT has base FOO, and by visit_type_UNION() when flat UNION has member a FOO. If the schema defines FOO after its first use as struct base or flat union member, visit_ty

[Qemu-devel] [PATCH v2 07/26] qapi: Fix generated code when flat union has member 'kind'

2015-08-28 Thread Markus Armbruster
A flat union's tag member gets renamed to 'kind' in the generated code. Breaks when another member named 'kind' exists. Example, adapted from qapi-schema-test.json: { 'struct': 'UserDefUnionBase', 'data': { 'kind': 'str', 'enum1': 'EnumOne' } } We generate: struct UserDefFlatUnio

[Qemu-devel] [PATCH v2 08/26] qapi: Generate a nicer struct for flat unions

2015-08-28 Thread Markus Armbruster
The struct generated for a flat union is weird: the members of its base are at the end, except for the union tag, which is at the beginning. Example: qapi-schema-test.json has { 'struct': 'UserDefUnionBase', 'data': { 'string': 'str', 'enum1': 'EnumOne' } } { 'union': 'UserDefFlatU

[Qemu-devel] [PATCH v2 11/26] qapi-visit: Fix two name arguments passed to visitors

2015-08-28 Thread Markus Armbruster
The generated code passes mangled schema names to visit_type_enum() and union's visit_start_struct(). Fix it to pass the names unadulterated, like we do everywhere else. Only qapi-schema-test.json actually has names where this makes a difference: enum __org.qemu_x-Enum, flat union __org.qemu_x-Un

[Qemu-devel] [PATCH v2 02/26] qapi: Clean up cgen() and mcgen()

2015-08-28 Thread Markus Armbruster
Commit 05dfb26 added eatspace stripping to mcgen(). Move it to cgen(), just in case somebody gets tempted to use cgen() directly instead of via mcgen(). cgen() indents blank lines. No such lines get generated right now, but fix it anyway. We use triple-quoted strings for program text, like this

[Qemu-devel] [PATCH v2 16/26] qapi: Document flaws in checking of names

2015-08-28 Thread Markus Armbruster
We don't actually enforce our "other than downstream extensions [...], all names should begin with a letter" rule. Add a FIXME. We should reject names that differ only in '_' vs. '.' vs. '-', because they're liable to clash in generated C. Add a FIXME. Signed-off-by: Markus Armbruster Reviewe

[Qemu-devel] [PATCH v2 06/26] qapi: Drop unused and useless parameters and variables

2015-08-28 Thread Markus Armbruster
gen_sync_call()'s parameter indent is useless: gen_sync_call() uses it only as optional argument for push_indent() and pop_indent(), their default is four, and gen_sync_call()'s only caller passes four. Drop the parameter. gen_visitor_input_containers_decl()'s parameter obj is always "QOBJECT(arg

[Qemu-devel] [PATCH v2 03/26] qapi: Simplify guardname()

2015-08-28 Thread Markus Armbruster
The guards around built-in declarations lose their _H. It never made much sense anyway. Signed-off-by: Markus Armbruster Reviewed-by: Eric Blake --- scripts/qapi.py | 10 +++--- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/scripts/qapi.py b/scripts/qapi.py index e656beb..b

[Qemu-devel] [PATCH v2 00/26] qapi: Another round of fixes and cleanups

2015-08-28 Thread Markus Armbruster
v2: * Trivially rebased, R-bys retained * [PATCH 02] Clean up string literal to please pylint * [PATCH 07] Commit message fix [Eric] * [PATCH 20] Doc fix [Eric] * [PATCH 21] Update test cases for the change even though they fail for other reasons [Eric] Previously posted as part of "[PATCH RFC v

[Qemu-devel] [PATCH v2 01/26] qapi: Clarify docs on including the same file multiple times

2015-08-28 Thread Markus Armbruster
It's idempotent. While there, update examples to current code. Signed-off-by: Markus Armbruster Reviewed-by: Eric Blake --- docs/qapi-code-gen.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/qapi-code-gen.txt b/docs/qapi-code-gen.txt index 61b5be4..e7e7281 1006

[Qemu-devel] [PATCH v2 10/26] qapi-visit: Replace list implicit_structs by set

2015-08-28 Thread Markus Armbruster
Use set because that's what it is. While there, rename to implicit_structs_seen. Signed-off-by: Markus Armbruster Reviewed-by: Eric Blake --- scripts/qapi-visit.py | 7 +++ 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/scripts/qapi-visit.py b/scripts/qapi-visit.py index b3a

[Qemu-devel] [PATCH v2 04/26] qapi-event: Clean up how name of enum QAPIEvent is made

2015-08-28 Thread Markus Armbruster
Use c_name() instead of ad hoc code. Doesn't upcase the -p prefix, which is an improvement in my book. Unbreaks prefix containing '.', but other funny characters remain broken. To be fixed next. Signed-off-by: Markus Armbruster Reviewed-by: Eric Blake --- docs/qapi-code-gen.txt | 8

[Qemu-devel] [PATCH v2 12/26] tests/qapi-schema: Document alternate's enum lacks visit function

2015-08-28 Thread Markus Armbruster
We generate a declaration, but no definition. The QMP schema has two: Qcow2OverlapChecks and BlockdevRef. Neither visit_type_Qcow2OverlapChecksKind() nor visit_type_BlockdevRefKind() is actually used. Signed-off-by: Markus Armbruster Reviewed-by: Eric Blake --- tests/qapi-schema/qapi-schema-t

[Qemu-devel] [PATCH v2 05/26] qapi: Reject -p arguments that break qapi-event.py

2015-08-28 Thread Markus Armbruster
qapi-event.py breaks when you ask for a funny prefix like '@'. Protect it. Signed-off-by: Markus Armbruster Reviewed-by: Eric Blake --- scripts/qapi.py | 6 ++ 1 file changed, 6 insertions(+) diff --git a/scripts/qapi.py b/scripts/qapi.py index ba11c54..bc3f4d3 100644 --- a/scripts/qapi.py

Re: [Qemu-devel] [PATCH v4 2/4] ahci.c: Don't assume AHCIState's parent is AHCIPCIState

2015-08-28 Thread Alistair Francis
On Thu, Aug 27, 2015 at 5:27 PM, Peter Crosthwaite wrote: > On Thu, Aug 27, 2015 at 5:16 PM, Alistair Francis > wrote: >> The AHCIState struct can either have AHCIPCIState or SysbusAHCIState >> as a parent. The ahci_irq_lower() and ahci_irq_raise() functions >> assume that it is always AHCIPCISta

Re: [Qemu-devel] [PATCH] tcg/aarch64: Fix tcg_out_qemu_{ld, st} for linux-user

2015-08-28 Thread Andreas Färber
Am 27.08.2015 um 22:30 schrieb Richard Henderson: > On 08/27/2015 04:47 PM, Andreas Färber wrote: >> The argument order for the !CONFIG_SOFTMMU case was jumbled up since >> ffc6372851d8631a9f9fa56ec613b3244dc635b9 ("tcg/aarch64: use 32-bit >> offset for 32-bit user-mode emulation"), regressing from

Re: [Qemu-devel] [PATCH 0/8] Disas QOMification, round 2

2015-08-28 Thread Peter Maydell
On 28 August 2015 at 17:19, Peter Crosthwaite wrote: > Longer term though, maybe these homogeneous every-arch change patterns > should only need a critical mass of acks from the arch maintainers for > the whole thing to go through. It's unlikely that I botched moxie with > most of the other arches

Re: [Qemu-devel] [PATCH 0/8] Disas QOMification, round 2

2015-08-28 Thread Peter Crosthwaite
On Fri, Aug 28, 2015 at 9:02 AM, Peter Maydell wrote: > On 28 August 2015 at 16:46, Andreas Färber wrote: >> Two to go, moxie as the next one untested by Peter. > > The last email on qemu-devel from the moxie maintainer was > in 2013, so I wouldn't hold your breath. > It is also unfortunately th

Re: [Qemu-devel] [PATCH] hw/usb/bus.c: print device ID when 'info usb' used

2015-08-28 Thread Programmingkid
On Aug 28, 2015, at 12:07 PM, Peter Maydell wrote: > On 28 August 2015 at 14:55, Programmingkid wrote: >> On Aug 28, 2015, at 9:50 AM, Gerd Hoffmann wrote: >>> Even better: Don't print "ID: ..." in the first place in case it is not >>> present. >> >> The ID is printed so if the user needs to re

Re: [Qemu-devel] [PATCH] hw/usb/bus.c: print device ID when 'info usb' used

2015-08-28 Thread Peter Maydell
On 28 August 2015 at 14:55, Programmingkid wrote: > On Aug 28, 2015, at 9:50 AM, Gerd Hoffmann wrote: >> Even better: Don't print "ID: ..." in the first place in case it is not >> present. > > The ID is printed so if the user needs to remove the device, device_del > can be used. > > If the ID is

Re: [Qemu-devel] [PATCH 0/8] Disas QOMification, round 2

2015-08-28 Thread Peter Maydell
On 28 August 2015 at 16:46, Andreas Färber wrote: > Two to go, moxie as the next one untested by Peter. The last email on qemu-devel from the moxie maintainer was in 2013, so I wouldn't hold your breath. -- PMM

Re: [Qemu-devel] [PATCH 10/10] cpu-exec: fix lock hierarchy for user-mode emulation

2015-08-28 Thread Peter Maydell
On 12 August 2015 at 17:41, Paolo Bonzini wrote: > tb_lock has to be taken inside the mmap_lock (example: > tb_invalidate_phys_range is called by target_mmap), but > tb_link_page is taking the mmap_lock and it is called > with the tb_lock held. > > To fix this, take the mmap_lock in tb_find_slow,

Re: [Qemu-devel] [PATCH 0/8] Disas QOMification, round 2

2015-08-28 Thread Andreas Färber
Am 27.08.2015 um 22:20 schrieb Richard Henderson: > On 08/27/2015 03:47 PM, Andreas Färber wrote: >> Am 12.07.2015 um 06:18 schrieb Andreas Färber: >>> Am 12.07.2015 um 03:59 schrieb Peter Crosthwaite: Continue QOMifying target-specific disassembly. Convert all arches except for X86

Re: [Qemu-devel] [PATCH 09/10] exec: make mmap_lock/mmap_unlock globally available

2015-08-28 Thread Peter Maydell
On 12 August 2015 at 17:41, Paolo Bonzini wrote: > There is some iffy lock hierarchy going on in translate-all.c. To > fix it, we need to take the mmap_lock in cpu-exec.c. Make the > functions globally available. > > Signed-off-by: Paolo Bonzini > --- > bsd-user/qemu.h | 2 -- > includ

Re: [Qemu-devel] [PATCH 08/10] tcg: add memory barriers in page_find_alloc accesses

2015-08-28 Thread Peter Maydell
On 12 August 2015 at 17:41, Paolo Bonzini wrote: > page_find is reading the radix tree outside all locks, so it has to > use the RCU primitives. It does not need RCU critical sections > because the PageDescs are never removed, so there is never a need > to wait for the end of code sections that u

Re: [Qemu-devel] [PATCH v2] s390: fix softmmu compilation

2015-08-28 Thread Peter Maydell
On 28 August 2015 at 11:23, Laurent Vivier wrote: > guest_base must be used only in linux-user mode. > > Signed-off-by: Laurent Vivier > --- > v2: minor cleanup, drop TCG_GUEST_BASE_REG if CONFIG_SOFTMMU > tcg/s390/tcg-target.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) Thanks;

Re: [Qemu-devel] [PATCH 07/10] tcg: comment on which functions have to be called with mmap_lock held

2015-08-28 Thread Peter Maydell
On 12 August 2015 at 17:40, Paolo Bonzini wrote: > Signed-off-by: Paolo Bonzini > --- > translate-all.c | 29 ++--- > 1 file changed, 22 insertions(+), 7 deletions(-) Some overall documentation on what the mmap_lock is protecting (and thus when it needs to be taken) woul

Re: [Qemu-devel] [PATCH 2/3] monitor: remove target-specific code from monitor.c

2015-08-28 Thread Pavel Butsykin
On 28.08.2015 13:12, Peter Maydell wrote: On 28 August 2015 at 10:21, Pavel Butsykin wrote: Yes, this is a good way if we make the interface: const MonitorDef *target_monitor_defs(void); But we can't include the 'monitor/monitor-common.h' to stubs/target-monitor-defs.c, because there is a dep

Re: [Qemu-devel] [PATCH 06/10] tcg: code_bitmap is not used by user-mode emulation

2015-08-28 Thread Peter Maydell
On 12 August 2015 at 17:40, Paolo Bonzini wrote: > More #ifdefs are not nice, but this clarifies why its usage is not > protected by tb_lock. Does it? I thought the idea of this series was to add locking which we needed for adding multi-threading to softmmu, in which case presumably we need to pr

Re: [Qemu-devel] Steal time MSR not set properly during live migration?

2015-08-28 Thread Alexandre DERUMIER
Hi, I have add this bug today on 3 debian jessie guests (kernel 3.16), after migration from qemu 2.3 to qemu 2.4. Is it a qemu bug or guest kernel 3.16 ? Regards, Alexandre Derumier - Mail original - De: "Michael Tokarev" À: "qemu-devel" , debian-ad...@lists.debian.org Cc: "Marcelo

Re: [Qemu-devel] [PATCH 05/10] cpu-exec: elide more icount code if CONFIG_USER_ONLY

2015-08-28 Thread Peter Maydell
On 12 August 2015 at 17:40, Paolo Bonzini wrote: > Signed-off-by: Paolo Bonzini > --- > cpu-exec.c | 6 ++ > 1 file changed, 6 insertions(+) > > diff --git a/cpu-exec.c b/cpu-exec.c > index 599e64d..bde5fd1 100644 > --- a/cpu-exec.c > +++ b/cpu-exec.c > @@ -228,6 +228,7 @@ static inline tcg_

Re: [Qemu-devel] [PATCH 3/3] monitor: added generation of documentation for hmp-commands-info.hx

2015-08-28 Thread Pavel Butsykin
On 28.08.2015 11:19, Peter Maydell wrote: On 28 August 2015 at 08:00, Pavel Butsykin wrote: On 27.08.2015 20:39, Peter Maydell wrote: On 12 August 2015 at 12:50, Denis V. Lunev wrote: From: Pavel Butsykin It will be easier if you need to add info-commands to edit only hmp-commands-info.

Re: [Qemu-devel] [PATCH 04/10] exec-all: remove non-TCG stuff from exec-all.h header.

2015-08-28 Thread Peter Maydell
On 12 August 2015 at 17:40, Paolo Bonzini wrote: > The header is included from basically everywhere, thanks to cpu.h. > It should be moved to the (TCG only) files that actually need it. > As a start, remove non-TCG stuff. > > While adding a #ifndef CONFIG_USER_ONLY include section to cpu-exec.c, >

Re: [Qemu-devel] [PATCH 03/10] replace spinlock by QemuMutex.

2015-08-28 Thread Frederic Konrad
On 28/08/2015 16:49, Peter Maydell wrote: On 12 August 2015 at 17:40, Paolo Bonzini wrote: From: KONRAD Frederic spinlock is only used in two cases: * cpu-exec.c: to protect TranslationBlock * mem_helper.c: for lock helper in target-i386 (which seems broken). It's a pthread_mutex_t in

Re: [Qemu-devel] [PATCH 03/10] replace spinlock by QemuMutex.

2015-08-28 Thread Peter Maydell
On 12 August 2015 at 17:40, Paolo Bonzini wrote: > From: KONRAD Frederic > > spinlock is only used in two cases: > * cpu-exec.c: to protect TranslationBlock > * mem_helper.c: for lock helper in target-i386 (which seems broken). > > It's a pthread_mutex_t in user-mode so better using QemuMutex

Re: [Qemu-devel] [PATCH 02/10] cpus: remove tcg_halt_cond global variable.

2015-08-28 Thread Peter Maydell
On 12 August 2015 at 17:40, Paolo Bonzini wrote: > From: KONRAD Frederic > > This removes tcg_halt_cond global variable. > We need one QemuCond per virtual cpu for multithread TCG. > > Signed-off-by: KONRAD Frederic > Message-Id: <1439220437-23957-9-git-send-email-fred.kon...@greensocs.com> > [K

Re: [Qemu-devel] [PATCH 01/10] cpus: protect work list with work_mutex

2015-08-28 Thread Peter Maydell
On 12 August 2015 at 17:40, Paolo Bonzini wrote: > From: KONRAD Frederic > > Protect the list of queued work items with something other than > the BQL, as a preparation for running the work items outside it. > > Signed-off-by: KONRAD Frederic > Signed-off-by: Paolo Bonzini Reviewed-by: Peter M

Re: [Qemu-devel] [PATCH v3 9/9] net: remove muldiv64()

2015-08-28 Thread Stefan Hajnoczi
On Thu, Aug 27, 2015 at 09:33:07PM +0200, Laurent Vivier wrote: > muldiv64() is used to convert nanoseconds to microseconds. > > x = muldiv64(qemu_clock_get_ns(..), 100, get_ticks_per_sec()); > > As get_ticks_per_sec() is 10^9, it can be replaced by: > > x = qemu_clock_get_us(..); >

Re: [Qemu-devel] [PATCH v3 3/9] pcnet: remove muldiv64()

2015-08-28 Thread Stefan Hajnoczi
On Thu, Aug 27, 2015 at 09:33:01PM +0200, Laurent Vivier wrote: > Originally, timers were ticks based, and it made sense to > add ticks to current time to know when to trigger an alarm. > > But since commit: > > 7447545 change all other clock references to use nanosecond resolution > accessors >

Re: [Qemu-devel] [PATCH v3 2/9] rtl8139: remove muldiv64()

2015-08-28 Thread Stefan Hajnoczi
On Thu, Aug 27, 2015 at 09:33:00PM +0200, Laurent Vivier wrote: > Originally, timers were ticks based, and it made sense to > add ticks to current time to know when to trigger an alarm. > > But since commit: > > 7447545 change all other clock references to use nanosecond resolution > accessors >

[Qemu-devel] [PATCH v3 1/2] rtl8139: Do not consume the packet during overflow in standard mode.

2015-08-28 Thread Vladislav Yasevich
When operation in standard mode, we currently return the size of packet during buffer overflow. This consumes the overflow packet. Return 0 instead so we can re-process the overflow packet when we have room. This fixes issues with lost/dropped fragments of large messages. Signed-off-by: Vladisl

[Qemu-devel] [PATCH v3 0/2] rtl8139: Fix buffer overflow in standard mode

2015-08-28 Thread Vladislav Yasevich
When rtl8139 card is running in standard mode, it is very easy to overlflow and the receive buffer and get into a siutation where all packets are dropped. Simply reproduction case is to ping the guest from the host with 6500 byte packets. There are actually 2 problems here. 1) When the rtl8129

[Qemu-devel] [PATCH v3 2/2] rtl8139: correctly track full receive buffer in standard mode

2015-08-28 Thread Vladislav Yasevich
In standard operation mode, when the receive ring buffer is full, the buffer actually appears empty to the driver since the RxBufAddr (the location we wirte new data to) and RxBufPtr (the location guest would stat reading from) are the same. As a result, the call to rtl8139_RxBufferEmpty ends up re

Re: [Qemu-devel] [PATCH] hw/usb/bus.c: print device ID when 'info usb' used

2015-08-28 Thread Programmingkid
On Aug 28, 2015, at 9:50 AM, Gerd Hoffmann wrote: > On Fr, 2015-08-28 at 09:39 -0400, Programmingkid wrote: >> On Aug 28, 2015, at 9:35 AM, Daniel P. Berrange wrote: >> >>> On Fri, Aug 28, 2015 at 09:08:12AM -0400, Programmingkid wrote: On Aug 28, 2015, at 7:50 AM, Gerd Hoffmann wrote

Re: [Qemu-devel] [PATCH] hw/usb/bus.c: print device ID when 'info usb' used

2015-08-28 Thread Gerd Hoffmann
On Fr, 2015-08-28 at 09:39 -0400, Programmingkid wrote: > On Aug 28, 2015, at 9:35 AM, Daniel P. Berrange wrote: > > > On Fri, Aug 28, 2015 at 09:08:12AM -0400, Programmingkid wrote: > >> > >> On Aug 28, 2015, at 7:50 AM, Gerd Hoffmann wrote: > >> > >>> On Mo, 2015-08-24 at 15:13 -0400, Programm

Re: [Qemu-devel] [PATCH] hw/usb/bus.c: print device ID when 'info usb' used

2015-08-28 Thread Daniel P. Berrange
On Fri, Aug 28, 2015 at 09:39:43AM -0400, Programmingkid wrote: > > On Aug 28, 2015, at 9:35 AM, Daniel P. Berrange wrote: > > > On Fri, Aug 28, 2015 at 09:08:12AM -0400, Programmingkid wrote: > >> > >> On Aug 28, 2015, at 7:50 AM, Gerd Hoffmann wrote: > >> > >>> On Mo, 2015-08-24 at 15:13 -040

Re: [Qemu-devel] [Qemu-ppc] [PATCH v7 3/8] scripts: Submit changes while updating linux headers

2015-08-28 Thread Gavin Shan
On Fri, Aug 28, 2015 at 10:30:48PM +1000, Gavin Shan wrote: >On Fri, Aug 28, 2015 at 01:50:47PM +0200, Laurent Vivier wrote: >>On 28/08/2015 09:15, Gavin Shan wrote: >>> This submits changes with formatted commit log while updating Linux >>> headers using scripts/update-linux-headers.sh. >>> >>> S

Re: [Qemu-devel] [PATCH] hw/usb/bus.c: print device ID when 'info usb' used

2015-08-28 Thread Programmingkid
On Aug 28, 2015, at 9:35 AM, Daniel P. Berrange wrote: > On Fri, Aug 28, 2015 at 09:08:12AM -0400, Programmingkid wrote: >> >> On Aug 28, 2015, at 7:50 AM, Gerd Hoffmann wrote: >> >>> On Mo, 2015-08-24 at 15:13 -0400, Programmingkid wrote: +monitor_printf(mon, " Device %d.%d,

Re: [Qemu-devel] [PATCH] hw/usb/bus.c: print device ID when 'info usb' used

2015-08-28 Thread Daniel P. Berrange
On Fri, Aug 28, 2015 at 09:08:12AM -0400, Programmingkid wrote: > > On Aug 28, 2015, at 7:50 AM, Gerd Hoffmann wrote: > > > On Mo, 2015-08-24 at 15:13 -0400, Programmingkid wrote: > >> +monitor_printf(mon, " Device %d.%d, Port %s, Speed %s > >> Mb/s," > >> +

Re: [Qemu-devel] [PATCH] hw/usb/bus.c: print device ID when 'info usb' used

2015-08-28 Thread Programmingkid
On Aug 28, 2015, at 7:50 AM, Gerd Hoffmann wrote: > On Mo, 2015-08-24 at 15:13 -0400, Programmingkid wrote: >> +monitor_printf(mon, " Device %d.%d, Port %s, Speed %s >> Mb/s," >> +"Product %s, ID %s\n", >> + bus->busnr, dev->a

Re: [Qemu-devel] hd-geo-test creates 4GB files on FSes that don't support sparse images, doesn't delete them on error

2015-08-28 Thread Markus Armbruster
John Snow writes: > On 08/27/2015 11:29 AM, Eric Blake wrote: >> On 08/27/2015 09:17 AM, Peter Maydell wrote: >>> I've noticed recently that tests/hd-geo-test.c creates test disk >>> images which are 4GB in size, which is a problem if the filesystem >>> on the host doesn't support sparse files. I

Re: [Qemu-devel] [PATCH v5 7/9] crypto: introduce new module for handling TLS sessions

2015-08-28 Thread Daniel P. Berrange
On Thu, Aug 27, 2015 at 08:33:43AM -0600, Eric Blake wrote: > On 08/26/2015 09:05 AM, Daniel P. Berrange wrote: > > Introduce a QCryptoTLSSession object that will encapsulate > > all the code for setting up and using a client/sever TLS > > session. This isolates the code which depends on the gnutls

  1   2   >