[Qemu-devel] [PATCH 10/11] pseries: Clean up error handling in ppc_spapr_init()

2015-12-10 Thread David Gibson
This function includes a number of explicit fprintf()s and exit()s for error conditions. Change these to use error_setg() and _fatal instead. Signed-off-by: David Gibson --- hw/ppc/spapr.c | 53 + 1 file changed,

[Qemu-devel] [PATCH 07/18] slirp: Make udp_attach IPv6 compatible

2015-12-10 Thread Samuel Thibault
From: Guillaume Subiron A sa_family_t is now passed in argument to udp_attach instead of using a hardcoded "AF_INET" to call qemu_socket(). Signed-off-by: Guillaume Subiron Signed-off-by: Samuel Thibault ---

[Qemu-devel] [PATCH 12/18] slirp: Adding IPv6 UDP support

2015-12-10 Thread Samuel Thibault
From: Guillaume Subiron This adds the sin6 case in the fhost and lhost unions and related macros. It adds udp6_input() and udp6_output(). It adds the IPv6 case in sorecvfrom(). Finally, udp_input() is called by ip6_input(). Signed-off-by: Guillaume Subiron

[Qemu-devel] [PATCH 14/18] slirp: Generalizing and neutralizing various TCP functions before adding IPv6 stuff

2015-12-10 Thread Samuel Thibault
From: Guillaume Subiron Basically, this patch adds some switch in various TCP functions to prepare them for the IPv6 case. To have something to "switch" in tcp_input() and tcp_respond(), a new argument is used to give them the sa_family of the addresses they are working on.

[Qemu-devel] [PATCH 11/18] slirp: Adding ICMPv6 error sending

2015-12-10 Thread Samuel Thibault
From: Yann Bordenave Disambiguation : icmp_error is renamed into icmp_send_error, since it doesn't manage errors, but only sends ICMP Error messages. Adding icmp6_send_error to send ICMPv6 Error messages. This function is simpler than the v4 version. Adding some calls in

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

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

[Qemu-devel] [PATCH 03/11] qapi: Factor out JSON string escaping

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

[Qemu-devel] [PATCH 05/11] qapi: Use qstring_append_chr() where appropriate

2015-12-10 Thread Eric Blake
No need to create a temporary buffer, when we already have a function available for our needs. Signed-off-by: Eric Blake --- qobject/json-parser.c | 7 +-- 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/qobject/json-parser.c b/qobject/json-parser.c index

[Qemu-devel] [RFC PATCH 00/11] Add qapi-to-JSON output visitor

2015-12-10 Thread Eric Blake
I wrote this series for several reasons: 1. I've been doing a lot of churn in the qapi visitor interfaces lately; adding a new visitor is good proof whether the changes still make sense 2. Alexander ended up writing his own simple JSON generator as qjson.c in his work for vmstate self-description,

[Qemu-devel] [PATCH 08/11] pseries: Clean up error handling in spapr_rtas_register()

2015-12-10 Thread David Gibson
The errors detected in this function indicate problems with the rest of the machine type code, rather than configuration or runtime problems. Use error_setg() and _abort instead of explicit fprintf() and exit(). Signed-off-by: David Gibson --- hw/ppc/spapr_rtas.c |

[Qemu-devel] [PATCH 00/11] Error handling cleanups for pseries machine type

2015-12-10 Thread David Gibson
The code for the pseries machine type is a bit of a hodge podge in terms of error handling. Some parts use the modern error handling APIs, others use old explicit fprintf()s and exit()s. This patch makes a start on cleaning this up, modernizing the error handling in a number of places to use the

[Qemu-devel] [PATCH 02/11] pseries: Cleanup error handling of spapr_cpu_init()

2015-12-10 Thread David Gibson
Currently spapr_cpu_init() is hardcoded to handle any errors as fatal. That works for now, since it's only called from initial setup where an error here means we really can't proceed. However, we'll want to handle this more flexibly for cpu hotplug in future so generalize this using the error

[Qemu-devel] [PATCH 16/18] slirp: Handle IPv6 in TCP functions

2015-12-10 Thread Samuel Thibault
From: Guillaume Subiron This patch adds IPv6 case in TCP functions refactored by the last patches. This also adds IPv6 pseudo-header in tcpiphdr structure. Finally, tcp_input() is called by ip6_input(). Signed-off-by: Guillaume Subiron Signed-off-by:

[Qemu-devel] [PATCH 02/18] slirp: Generalizing and neutralizing code before adding IPv6 stuff

2015-12-10 Thread Samuel Thibault
From: Guillaume Subiron Basically, this patch replaces "arp" by "resolution" every time "arp" means "mac resolution" and not specifically ARP. Some indentation problems are solved in functions that will be modified in the next patches (ip_input…). In if_encap, a switch is

Re: [Qemu-devel] [ANNOUNCE] QEMU 2.5.0-rc3 is now available

2015-12-10 Thread Eric Blake
On 12/08/2015 01:26 AM, Peter Maydell wrote: > On 8 December 2015 at 00:16, Michael Roth wrote: >> Hello, >> >> On behalf of the QEMU Team, I'd like to announce the availability of the >> fourth release candidate for the QEMU 2.5 release. This release is meant >> for

Re: [Qemu-devel] [PATCH v4 0/4] Extend TPM support with a QEMU-external

2015-12-10 Thread Stefan Berger
silviuvlasce...@gmail.com wrote on 12/09/2015 02:24:50 AM: > > Hi, is there any progress with upstreaming this patch or with adding > support for CUSE TPM, in general? Or are there other plans for vTPM support? > There's a lack of reviewers for the code. Stefan > Thank you, > Silviu

[Qemu-devel] [PATCH 09/12] isa: Clean up error handling around isa_bus_new()

2015-12-10 Thread Markus Armbruster
We can have at most one ISA bus. If you try to create another one, isa_bus_new() complains to stderr and returns null. isa_bus_new() is called in two contexts, machine's init() and device's realize() methods. Since complaining to stderr is not proper in the latter context, convert isa_bus_new()

[Qemu-devel] [PATCH 00/12] Clean up some hw_error() misuse

2015-12-10 Thread Markus Armbruster
I intend to take this trough my tree, but I'm certainly fine with maintainers picking up their parts if that makes their job easier. Just be clear about it. Markus Armbruster (12): hw: Don't use hw_error() for machine initialization errors omap: Don't use hw_error() in device init() methods

Re: [Qemu-devel] [PATCH 02/12] omap: Don't use hw_error() in device init() methods

2015-12-10 Thread Peter Maydell
On 10 December 2015 at 10:29, Markus Armbruster wrote: > Device init() methods aren't supposed to call hw_error(), they should > report the error and fail cleanly. Do that. > > Cc: Peter Maydell > Signed-off-by: Markus Armbruster

Re: [Qemu-devel] Error handling in realize() methods

2015-12-10 Thread Dr. David Alan Gilbert
* Markus Armbruster (arm...@redhat.com) wrote: > Paolo Bonzini writes: > > > On 09/12/2015 10:30, Markus Armbruster wrote: > >> My current working assumption is that passing _fatal to > >> memory_region_init_ram() & friends is okay even in realize() methods and > >> their

Re: [Qemu-devel] [PATCH] Use error_fatal to simplify obvious fatal errors

2015-12-10 Thread Marcel Apfelbaum
On 12/10/2015 12:19 PM, Markus Armbruster wrote: Done with this admittedly crude Coccinelle semantic patch with manual burial of dead Error * variables squashed in: @@ identifier FUN; expression ERR, EC; @@ -FUN(); -if (ERR != NULL) { -

Re: [Qemu-devel] live migration vs device assignment (motivation)

2015-12-10 Thread Dr. David Alan Gilbert
* Yang Zhang (yang.zhang...@gmail.com) wrote: > On 2015/12/10 18:18, Dr. David Alan Gilbert wrote: > >* Lan, Tianyu (tianyu@intel.com) wrote: > >>On 12/8/2015 12:50 AM, Michael S. Tsirkin wrote: > >>>I thought about what this is doing at the high level, and I do have some > >>>value in what

Re: [Qemu-devel] [PATCH 09/12] isa: Clean up error handling around isa_bus_new()

2015-12-10 Thread Marcel Apfelbaum
On 12/10/2015 12:29 PM, Markus Armbruster wrote: We can have at most one ISA bus. If you try to create another one, isa_bus_new() complains to stderr and returns null. isa_bus_new() is called in two contexts, machine's init() and device's realize() methods. Since complaining to stderr is not

[Qemu-devel] [PATCH] Use error_fatal to simplify obvious fatal errors

2015-12-10 Thread Markus Armbruster
Done with this admittedly crude Coccinelle semantic patch with manual burial of dead Error * variables squashed in: @@ identifier FUN; expression ERR, EC; @@ -FUN(); -if (ERR != NULL) { -error_report_err(ERR); -exit(EC); -} +

[Qemu-devel] [PATCH 10/12] isa: Clean up inappropriate hw_error()

2015-12-10 Thread Markus Armbruster
isa_bus_irqs(), isa_create() and isa_try_create() call hw_error() when passed a null bus. Use of hw_error() has always been questionable, because these are used only during machine initialization, and printing CPU registers isn't useful there. Since the previous commit, passing a null bus is a

[Qemu-devel] [PATCH 02/12] omap: Don't use hw_error() in device init() methods

2015-12-10 Thread Markus Armbruster
Device init() methods aren't supposed to call hw_error(), they should report the error and fail cleanly. Do that. Cc: Peter Maydell Signed-off-by: Markus Armbruster --- hw/gpio/omap_gpio.c | 19 +++ hw/i2c/omap_i2c.c | 8 ++--

[Qemu-devel] [PATCH 03/12] arm_mptimer: Don't use hw_error() in realize() method

2015-12-10 Thread Markus Armbruster
Device realize() methods aren't supposed to call hw_error(), they should set an error and fail cleanly. Do that. Cc: Peter Maydell Cc: qemu-...@nongnu.org Signed-off-by: Markus Armbruster --- hw/timer/arm_mptimer.c | 5 +++-- 1 file changed, 3

Re: [Qemu-devel] [PATCH 04/12] etraxfs_eth: Don't use hw_error() in init() method

2015-12-10 Thread Edgar E. Iglesias
On Thu, Dec 10, 2015 at 11:29:24AM +0100, Markus Armbruster wrote: > Device init() methods aren't supposed to call hw_error(), they should > report the error and fail cleanly. Do that. > > Cc: "Edgar E. Iglesias" > Signed-off-by: Markus Armbruster

Re: [Qemu-devel] [PATCH 03/12] arm_mptimer: Don't use hw_error() in realize() method

2015-12-10 Thread Peter Maydell
On 10 December 2015 at 10:29, Markus Armbruster wrote: > Device realize() methods aren't supposed to call hw_error(), they > should set an error and fail cleanly. Do that. > > Cc: Peter Maydell > Cc: qemu-...@nongnu.org > Signed-off-by: Markus

Re: [Qemu-devel] [PATCH] Use error_fatal to simplify obvious fatal errors

2015-12-10 Thread Paolo Bonzini
On 10/12/2015 11:19, Markus Armbruster wrote: > +object_property_set_int(OBJECT(cpu), ZYNQ_BOARD_MIDR, "midr", > + > _fatal);object_property_set_int(OBJECT(cpu), > + > MPCORE_PERIPHBASE, > +

Re: [Qemu-devel] Error handling in realize() methods

2015-12-10 Thread Paolo Bonzini
On 10/12/2015 12:06, Markus Armbruster wrote: > Paolo Bonzini writes: > >> On 09/12/2015 10:30, Markus Armbruster wrote: >>> My current working assumption is that passing _fatal to >>> memory_region_init_ram() & friends is okay even in realize() methods and >>> their

Re: [Qemu-devel] Error handling in realize() methods

2015-12-10 Thread Markus Armbruster
Paolo Bonzini writes: > On 10/12/2015 12:06, Markus Armbruster wrote: >> Paolo Bonzini writes: >> >>> On 09/12/2015 10:30, Markus Armbruster wrote: My current working assumption is that passing _fatal to memory_region_init_ram() & friends is

Re: [Qemu-devel] live migration vs device assignment (motivation)

2015-12-10 Thread Dr. David Alan Gilbert
* Lan, Tianyu (tianyu@intel.com) wrote: > On 12/8/2015 12:50 AM, Michael S. Tsirkin wrote: > >I thought about what this is doing at the high level, and I do have some > >value in what you are trying to do, but I also think we need to clarify > >the motivation a bit more. What you are saying

[Qemu-devel] [PATCH 04/12] etraxfs_eth: Don't use hw_error() in init() method

2015-12-10 Thread Markus Armbruster
Device init() methods aren't supposed to call hw_error(), they should report the error and fail cleanly. Do that. Cc: "Edgar E. Iglesias" Signed-off-by: Markus Armbruster --- hw/net/etraxfs_eth.c | 4 +++- 1 file changed, 3 insertions(+), 1

[Qemu-devel] [PATCH 06/12] hw/arm/virt: Fix property "gic-version" error handling

2015-12-10 Thread Markus Armbruster
virt_set_gic_version() calls exit(1) when passed an invalid property value. Property setters are not supposed to do that. Screwed up in commit b92ad39. Harmless, because the property belongs to a machine. Set an error object instead. Cc: Peter Maydell Cc:

[Qemu-devel] [PATCH 05/12] raven: Mark use of hw_error() in realize() FIXME

2015-12-10 Thread Markus Armbruster
Device realize() methods aren't supposed to call hw_error(), they should set an error and fail cleanly. Blindly doing that would be easy enough, but then realize() would fail without undoing its side effects. Just mark it FIXME for now. Cc: "Andreas Färber" Cc:

[Qemu-devel] [PATCH 08/12] isa: Trivially convert remaining PCI-ISA bridges to realize()

2015-12-10 Thread Markus Armbruster
These are "ICH9-LPC" and "ebus". Cc: "Michael S. Tsirkin" Cc: Mark Cave-Ayland Signed-off-by: Markus Armbruster --- hw/isa/lpc_ich9.c | 5 ++--- hw/sparc64/sun4u.c | 6 ++ 2 files changed, 4 insertions(+), 7 deletions(-)

Re: [Qemu-devel] [Qemu-arm] [PATCH 01/12] hw: Don't use hw_error() for machine initialization errors

2015-12-10 Thread Peter Maydell
On 10 December 2015 at 10:29, Markus Armbruster wrote: > Printing CPU registers is not helpful during machine initialization. > Moreover, these are straightforward configuration or "can get > resources" errors, so dumping core isn't appropriate either. Replace > hw_error() by

Re: [Qemu-devel] Error handling in realize() methods

2015-12-10 Thread Markus Armbruster
Paolo Bonzini writes: > On 09/12/2015 10:30, Markus Armbruster wrote: >> My current working assumption is that passing _fatal to >> memory_region_init_ram() & friends is okay even in realize() methods and >> their supporting code, except when the allocation can be large. > >

Re: [Qemu-devel] [PATCH 23/74] acpi: extend aml_and() to accept target argument

2015-12-10 Thread Igor Mammedov
On Thu, 10 Dec 2015 10:07:43 +0800 Shannon Zhao wrote: > > > On 2015/12/10 7:41, Igor Mammedov wrote: > > Signed-off-by: Igor Mammedov > > --- > > hw/acpi/aml-build.c | 4 ++-- > > hw/arm/virt-acpi-build.c| 2 +- > >

Re: [Qemu-devel] [RFC PATCH v0 1/9] vl: Don't allow CPU toplogies with partially filled cores

2015-12-10 Thread Daniel P. Berrange
On Thu, Dec 10, 2015 at 11:45:36AM +0530, Bharata B Rao wrote: > Prevent guests from booting with CPU topologies that have partially > filled CPU cores or can result in partially filled CPU cores after CPU > hotplug like > > -smp 15,sockets=1,cores=4,threads=4,maxcpus=16 or > -smp

[Qemu-devel] [PATCH 12/12] xen-hvm: Mark inappropriate error handling FIXME

2015-12-10 Thread Markus Armbruster
Cc: Stefano Stabellini Cc: xen-de...@lists.xensource.com Signed-off-by: Markus Armbruster --- xen-hvm.c | 7 +++ 1 file changed, 7 insertions(+) diff --git a/xen-hvm.c b/xen-hvm.c index 3d78a0c..2a93390 100644 --- a/xen-hvm.c +++

[Qemu-devel] [PATCH 11/12] audio: Clean up inappropriate and unreachable use of hw_error()

2015-12-10 Thread Markus Armbruster
audio_init() should not use hw_error(), because dumping CPU registers is unhelpful there, and aborting is wrong, because it can be called called from an audio device's realize() method. The two uses of hw_error() come from commit 0d9acba: * When qemu_new_timer() fails. It couldn't fail back

Re: [Qemu-devel] Error handling in realize() methods

2015-12-10 Thread Laszlo Ersek
On 12/10/15 10:22, Markus Armbruster wrote: > Laszlo Ersek writes: > >> I've been following this discussion with great interest. >> >> My opinion should not be considered, because I won't be turning my >> opinion into new code, or an agreement to support / maintain code. :) >>

Re: [Qemu-devel] [PATCH] MAINTAINERS: add maintainer to virtio-9p

2015-12-10 Thread Peter Maydell
On 1 December 2015 at 10:50, Aneesh Kumar K.V wrote: > Greg Kurz writes: > >> As suggested by Paolo, I add myself as maintainer for virtio-9p. >> >> Signed-off-by: Greg Kurz > > Acked-by: Aneesh Kumar K.V

Re: [Qemu-devel] [PATCH for-2.5] virtio-9p-device: add minimal unrealize handler

2015-12-10 Thread Peter Maydell
On 8 December 2015 at 16:19, Michael S. Tsirkin wrote: > On Tue, Dec 08, 2015 at 04:54:57PM +0100, Greg Kurz wrote: >> Since commit 4652f1640e029e1f2433fa77ba6af285 "virtio-9p: add savevm >> handlers", >> if the user hot-unplugs a quiescent 9p device and live migrates, the

Re: [Qemu-devel] Error handling in realize() methods

2015-12-10 Thread Paolo Bonzini
On 10/12/2015 12:21, Dr. David Alan Gilbert wrote: > I guess the use of abort() could tell us > that - however it's a really big assumption that in an OOM case we'd > be able to dump the information. If it's not OOM, but just a multi-gigabyte allocation, we should. Paolo

Re: [Qemu-devel] [PATCH for-2.5] sparc: allow CASA with ASI 0xa from user space

2015-12-10 Thread Peter Maydell
On 9 December 2015 at 23:24, Mark Cave-Ayland wrote: > On 08/12/15 21:28, Peter Maydell wrote: > >> On 8 December 2015 at 19:59, Richard Henderson wrote: >>> On 12/04/2015 07:01 AM, Alex Zuepke wrote: LEON3 allows the CASA instruction to be

[Qemu-devel] [PATCH 01/12] hw: Don't use hw_error() for machine initialization errors

2015-12-10 Thread Markus Armbruster
Printing CPU registers is not helpful during machine initialization. Moreover, these are straightforward configuration or "can get resources" errors, so dumping core isn't appropriate either. Replace hw_error() by error_report(); exit(1). Matches how we report these errors in other machine

[Qemu-devel] [PATCH 07/12] sysbus: Don't use hw_error() in machine_init_done_notifiers

2015-12-10 Thread Markus Armbruster
platform_bus_map_irq() and platform_bus_map_mmio() use hw_error() to fail. They run in machine_init_done_notifiers, via platform_bus_init_notify() and link_sysbus_device(). Printing CPU registers is not helpful there. Replace hw_error() by error_report(); exit(1). If these are programming

Re: [Qemu-devel] [PATCH 07/74] acpi: aml: add helper for Opcode Arg2 Arg2 [Dst] AML pattern

2015-12-10 Thread Igor Mammedov
On Thu, 10 Dec 2015 09:59:16 +0800 Shannon Zhao wrote: > > > On 2015/12/10 7:41, Igor Mammedov wrote: > > Currently AML API doesn't compose terms in form of > > following pattern: > > > >Opcode Arg2 Arg2 [Dst] > > > > but ASL used in piix4/q35 DSDT ACPI tables

Re: [Qemu-devel] [PATCH 00/16] pc: Eliminate struct PcGuestInfo

2015-12-10 Thread Marcel Apfelbaum
On 12/08/2015 07:53 PM, Eduardo Habkost wrote: On Mon, Dec 07, 2015 at 08:57:03PM +0200, Marcel Apfelbaum wrote: On 12/02/2015 03:46 AM, Eduardo Habkost wrote: This moves all data from PcGuestInfo to either PCMachineState or PCMachineClass. This series depends on other two series: * [PATCH v3

Re: [Qemu-devel] [PATCH 08/12] isa: Trivially convert remaining PCI-ISA bridges to realize()

2015-12-10 Thread Marcel Apfelbaum
On 12/10/2015 12:29 PM, Markus Armbruster wrote: These are "ICH9-LPC" and "ebus". Cc: "Michael S. Tsirkin" Cc: Mark Cave-Ayland Signed-off-by: Markus Armbruster --- hw/isa/lpc_ich9.c | 5 ++--- hw/sparc64/sun4u.c | 6

[Qemu-devel] [PATCH v2 24/74] acpi: extend aml_interrupt() to support multiple irqs

2015-12-10 Thread Igor Mammedov
ASL Interrupt() macro translates to Extended Interrupt Descriptor which supports variable number of IRQs. It will be used for conversion of ASL code for pc/q35 machines that use it for returning several IRQs in _PSR object. Signed-off-by: Igor Mammedov --- v2: - fix

Re: [Qemu-devel] [PATCH for-2.5] virtio-9p-device: add minimal unrealize handler

2015-12-10 Thread Greg Kurz
On Thu, 10 Dec 2015 11:17:09 + Peter Maydell wrote: > On 8 December 2015 at 16:19, Michael S. Tsirkin wrote: > > On Tue, Dec 08, 2015 at 04:54:57PM +0100, Greg Kurz wrote: > >> Since commit 4652f1640e029e1f2433fa77ba6af285 "virtio-9p: add savevm >

Re: [Qemu-devel] [PATCH 10/12] isa: Clean up inappropriate hw_error()

2015-12-10 Thread Marcel Apfelbaum
On 12/10/2015 12:29 PM, Markus Armbruster wrote: isa_bus_irqs(), isa_create() and isa_try_create() call hw_error() when passed a null bus. Use of hw_error() has always been questionable, because these are used only during machine initialization, and printing CPU registers isn't useful there.

Re: [Qemu-devel] [PATCH] Use error_fatal to simplify obvious fatal errors

2015-12-10 Thread Markus Armbruster
Paolo Bonzini writes: > On 10/12/2015 11:19, Markus Armbruster wrote: >> +object_property_set_int(OBJECT(cpu), ZYNQ_BOARD_MIDR, "midr", >> + _fatal);object_property_set_int(OBJECT(cpu), >> + MPCORE_PERIPHBASE, >> + "reset-cbar", >> +

[Qemu-devel] [PATCH 32/34] scripts/kvm/kvm_stat: Fix rlimit for unprivileged users

2015-12-10 Thread Janosch Frank
Setting the hard limit as a unprivileged user either returns an error when it is higher than the current one or irreversibly sets it lower. Therefore we leave the hardlimit untouched as long as we don't need to raise it as this needs CAP_SYS_RESOURCE. This gives admins the possibility to run the

[Qemu-devel] [PATCH 01/34] scripts/kvm/kvm_stat: Cleanup of multiple imports

2015-12-10 Thread Janosch Frank
Removed multiple imports of the same module and moved all imports to the top. It is not necessary to import a module each time one of its functions/classes is used. For readability each import should get its own line. --- scripts/kvm/kvm_stat | 26 +++--- 1 file changed, 11

[Qemu-devel] [PATCH 19/34] scripts/kvm/kvm_stat: Cleanup of TracepointProvider

2015-12-10 Thread Janosch Frank
Variables with bad names like f and m were renamed to their full name, so it is clearer which data they contain. Unneeded variables were removed and the field generating code was moved in an own function. dict.iteritems() was removed as directly iterating over a dictionary also yields the needed

[Qemu-devel] [PATCH 27/34] scripts/kvm/kvm_stat: Make tui function a class

2015-12-10 Thread Janosch Frank
The tui function itself had a few sub-functions and therefore basically already was class-like. Making it an actual one with proper methods improved readability. The tui function lives on as a wrapper for the class. Also renamed single character variable name, so the name reflects the content.

Re: [Qemu-devel] freeze host when injecting NMIs in the guest, at least in 4.4-rc4+

2015-12-10 Thread Paolo Bonzini
On 10/12/2015 17:44, Borislav Petkov wrote: > Yap, > > this is clearly a qemu/kvm issue. Lemme remove ext4 folks from CC. So > here's what happens: > > I boot a kvm guest, connect to its monitor (qemu is started with > "-monitor pty") and on the monitor I issue a couple of times the "nmi" >

[Qemu-devel] [PATCH 1/4] error: Strip trailing '\n' from error string arguments (again)

2015-12-10 Thread Markus Armbruster
Commit 6daf194d, be62a2eb and 312fd5f got rid of a bunch, but they keep coming back. Tracked down with the Coccinelle semantic patch from commit 312fd5f. Cc: Fam Zheng Cc: Peter Crosthwaite Cc: Bharata B Rao Cc: Dominik

[Qemu-devel] [PATCH 2/4] error: Clean up errors with embedded newlines (again), part 1

2015-12-10 Thread Markus Armbruster
The arguments of error_report() should yield a short error string without newlines. A few places try to print additional help after the error message by embedding newlines in the error string. That's nice, but let's do it the right way. Commit 474c213 cleaned up some, but they keep comint back.

[Qemu-devel] [PATCH 0/4] Error reporting cleanups

2015-12-10 Thread Markus Armbruster
Mostly newlines. Making checkpatch catch them would be nice, but that's more than I can do today. Help welcome, of course. I intend to take these patches through my tree. Markus Armbruster (4): error: Strip trailing '\n' from error string arguments (again) error: Clean up errors with

Re: [Qemu-devel] [PATCH 00/16] pc: Eliminate struct PcGuestInfo

2015-12-10 Thread Eduardo Habkost
On Thu, Dec 10, 2015 at 01:27:50PM +0200, Marcel Apfelbaum wrote: > On 12/08/2015 07:53 PM, Eduardo Habkost wrote: > >On Mon, Dec 07, 2015 at 08:57:03PM +0200, Marcel Apfelbaum wrote: > >>On 12/02/2015 03:46 AM, Eduardo Habkost wrote: > >>>This moves all data from PcGuestInfo to either

[Qemu-devel] [PATCH 17/34] scripts/kvm/kvm_stat: Rename _perf_event_open

2015-12-10 Thread Janosch Frank
The underscore in front of the function name does not comply with the python coding guidelines. Reviewed-by: Jason J. Herne --- scripts/kvm/kvm_stat | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/kvm/kvm_stat b/scripts/kvm/kvm_stat

[Qemu-devel] [PATCH 15/34] scripts/kvm/kvm_stat: Cleanup of platform detection

2015-12-10 Thread Janosch Frank
s390 machines can also be detected via uname -m, i.e. python's os.uname, no need for more complicated checks. Calling uname once and saving its value for multiple checks is perfectly sufficient. We don't expect the machine's architecture to change when the script is running anyway. On multi-cpu

[Qemu-devel] [PATCH 33/34] scripts/kvm/kvm_stat: Fixup filtering

2015-12-10 Thread Janosch Frank
When filtering, the group leader event should not be disabled, as all other events under it will also be disabled. Also we should make sure that values from disabled fields will not be displayed. This also filters the fields from the log and batch output for better readability. Also the

[Qemu-devel] [Patch V2 1/2] x86, mce: Basic support to add LMCE support to QEMU

2015-12-10 Thread Ashok Raj
This patch adds basic enumeration, control msr's required to support Local Machine Check Exception Support (LMCE). - Added Local Machine Check definitions, changed MCG_CAP - Added support for IA32_FEATURE_CONTROL. - When delivering MCE to guest, we deliver to just a single CPU when guest OS has

[Qemu-devel] [PATCH 34/34] scripts/kvm/kvm_stat: Add interactive filtering

2015-12-10 Thread Janosch Frank
Interactively changing the filter is much more useful than the drilldown, because it is more versatile. With this patch, the filter can be changed by pressing 'f' in the text ui and entering a new filter regex. --- scripts/kvm/kvm_stat | 26 ++ 1 file changed, 26

Re: [Qemu-devel] live migration vs device assignment (motivation)

2015-12-10 Thread Yang Zhang
On 2015/12/10 18:18, Dr. David Alan Gilbert wrote: * Lan, Tianyu (tianyu@intel.com) wrote: On 12/8/2015 12:50 AM, Michael S. Tsirkin wrote: I thought about what this is doing at the high level, and I do have some value in what you are trying to do, but I also think we need to clarify the

[Qemu-devel] [PATCH] fix:readcapacity 10 failure shown even 16 sent

2015-12-10 Thread Zhu Lingshan
This Patch would fix a bug that readcapacity10 failuare would be shown no matter readcapacy10 or readcapacity16 actually sent. Signed-off-by: Zhu Lingshan --- block/iscsi.c | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/block/iscsi.c b/block/iscsi.c

[Qemu-devel] [PATCH 12/34] scripts/kvm/kvm_stat: Moved DebugfsProvider

2015-12-10 Thread Janosch Frank
When it is next to the TracepointProvider less scrolling is needed to change related, surrounding code. Reviewed-by: Jason J. Herne --- scripts/kvm/kvm_stat | 24 1 file changed, 12 insertions(+), 12 deletions(-) diff --git

[Qemu-devel] [PATCH 10/34] scripts/kvm/kvm_stat: Fix spaces around keyword assignments

2015-12-10 Thread Janosch Frank
Keyword assignments should not not have spaces around the equal character according to PEP8. Reviewed-by: Jason J. Herne --- scripts/kvm/kvm_stat | 62 ++-- 1 file changed, 31 insertions(+), 31 deletions(-) diff --git

[Qemu-devel] [PATCH 03/34] scripts/kvm/kvm_stat: Make constants uppercase

2015-12-10 Thread Janosch Frank
Constants should be uppercase with separating underscores, as requested in PEP8. This helps identifying them when reading the code. Reviewed-by: Jason J. Herne --- scripts/kvm/kvm_stat | 64 ++-- 1 file changed, 32

Re: [Qemu-devel] freeze host when injecting NMIs in the guest, at least in 4.4-rc4+

2015-12-10 Thread Borislav Petkov
Yap, this is clearly a qemu/kvm issue. Lemme remove ext4 folks from CC. So here's what happens: I boot a kvm guest, connect to its monitor (qemu is started with "-monitor pty") and on the monitor I issue a couple of times the "nmi" command. It doesn't explode immediately but it happens pretty

[Qemu-devel] [PATCH 02/34] scripts/kvm/kvm_stat: Replaced os.listdir with os.walk

2015-12-10 Thread Janosch Frank
Os.walk gives back lists of directories and files, no need to filter directories from the list that listdir gives back. To make it better understandable a wrapper with docstring was introduced. --- scripts/kvm/kvm_stat | 15 +++ 1 file changed, 11 insertions(+), 4 deletions(-) diff

[Qemu-devel] [PATCH 22/34] scripts/kvm/kvm_stat: Cleanup of Stats class

2015-12-10 Thread Janosch Frank
Converted class definition to new style and renamed improper named variables. Introduced property for fields_filter. Moved member variable declaration to init, so one can see all class variables when reading the init method. Completely clear the values dict, as we don't need to keep single

[Qemu-devel] [PATCH 08/34] scripts/kvm/kvm_stat: Improve debugfs access checking

2015-12-10 Thread Janosch Frank
Access checking with F_OK was replaced with the better readable os.path.exists(). On Linux exists() returns False when the user doesn't have sufficient permissions for statting the directory. Therefore the error message now states that sufficient rights are needed when the check fails. Also

[Qemu-devel] [PATCH 29/34] scripts/kvm/kvm_stat: Move to argparse and add description

2015-12-10 Thread Janosch Frank
The OptionParser is deprecated since the introduction of the ArgumentParser in 2.7. Additionally added a description text for the script, so new users don't have to guess its purpose and inner workings. --- scripts/kvm/kvm_stat | 86 1 file

[Qemu-devel] [PATCH 18/34] scripts/kvm/kvm_stat: Introduce properties for providers

2015-12-10 Thread Janosch Frank
As previous commit authors used a mixture of setters/getters and direct access to class variables consolidating them the python way improved readability. Properties allow us to assign a value to a class variable through a setter without the need to call the setter ourselves. Reviewed-by: Jason

[Qemu-devel] [PATCH 11/34] scripts/kvm/kvm_stat: Rename variables that redefine globals

2015-12-10 Thread Janosch Frank
Filter, id and byte are builtin python modules which should not be redefined by local variables. Reviewed-by: Jason J. Herne --- scripts/kvm/kvm_stat | 23 --- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/scripts/kvm/kvm_stat

[Qemu-devel] [PATCH 24/34] scripts/kvm/kvm_stat: Cleanup of Event class

2015-12-10 Thread Janosch Frank
Added additional newlines for readability. Factored out attribute and event setup code into own methods. All data necessary for setting up the events was consolidated into one dictionary. That way we get rid of the large argument list of the functions that handle the data. Exchanged file() with

Re: [Qemu-devel] freeze host when injecting NMIs in the guest, at least in 4.4-rc4+

2015-12-10 Thread Borislav Petkov
On Thu, Dec 10, 2015 at 05:49:10PM +0100, Paolo Bonzini wrote: > Can you try it on Intel? Just did, there it splats even when booting the guest, without even injecting NMIs: [ 113.233992] === [ 113.238192] [ INFO: suspicious RCU usage. ] [ 113.242393] 4.4.0-rc4+ #1

Re: [Qemu-devel] freeze host when injecting NMIs in the guest, at least in 4.4-rc4+

2015-12-10 Thread Paolo Bonzini
On 10/12/2015 17:53, Borislav Petkov wrote: > Just did, there it splats even when booting the guest, without even > injecting NMIs: > > [ 113.233992] === > [ 113.238192] [ INFO: suspicious RCU usage. ] > [ 113.242393] 4.4.0-rc4+ #1 Not tainted > [ 113.246056]

[Qemu-devel] [PATCH 05/34] scripts/kvm/kvm_stat: Mark globals in functions

2015-12-10 Thread Janosch Frank
Updating globals over the globals().update() method is not the standard way of changing globals. Marking variables as global and modifying them the standard way is better readable. --- scripts/kvm/kvm_stat | 41 ++--- 1 file changed, 22 insertions(+), 19

Re: [Qemu-devel] [PATCH v3 0/4] target-tilegx: Implement floating point instructions

2015-12-10 Thread Chen Gang
Hello all: After communicated with my company, I am permitted to use my company email to send patches to open source community. My company supports what I have done for open source community, but at present, I still use my personal mail id as Signed-of-by (make and send patches mainly during my

Re: [Qemu-devel] [PATCH COLO-Frame v11 23/39] COLO: Implement failover work for Primary VM

2015-12-10 Thread Dr. David Alan Gilbert
* zhanghailiang (zhang.zhanghaili...@huawei.com) wrote: > For PVM, if there is failover request from users. > The colo thread will exit the loop while the failover BH does the > cleanup work and resumes VM. > > Signed-off-by: zhanghailiang > Signed-off-by: Li

[Qemu-devel] [Patch V2 2/2] x86, mce: Need to translate GPA to HPA to inject error in guest.

2015-12-10 Thread Ashok Raj
From: Gong Chen When we need to test error injection to a specific address using EINJ, there needs to be a way to translate GPA to HPA. This will allow host EINJ to inject error to test how guest behavior is when a bad address is consumed. This permits guest OS to perform

[Qemu-devel] [PATCH] target-*: Get rid of "PC advancement" trick

2015-12-10 Thread Sergey Fedorov
The "PC advancement" trick was used just after recognizing that a breakpoint exception was going to be generated. This trick has had two points: 1. Guarantee that tb->size isn't zero: there are many places where it's expected to be non-zero. In fact, that is even stated in the comment

Re: [Qemu-devel] [PATCH COLO-Frame v11 24/39] COLO: Implement failover work for Secondary VM

2015-12-10 Thread Dr. David Alan Gilbert
* zhanghailiang (zhang.zhanghaili...@huawei.com) wrote: > If users require SVM to takeover work, colo incoming thread should > exit from loop while failover BH helps backing to migration incoming > coroutine. > > Signed-off-by: zhanghailiang > Signed-off-by: Li

Re: [Qemu-devel] [PATCH v4 6/8] ARM: ACPI: Add _E03 for Power Button

2015-12-10 Thread Shannon Zhao
On 2015/12/11 4:09, Igor Mammedov wrote: > On Mon, 7 Dec 2015 15:39:50 +0800 > Shannon Zhao wrote: > >> > From: Shannon Zhao >> > >> > Here GPIO pin 3 is used for Power Button, add _E03 in ACPI DSDT table. >> > >> > Signed-off-by: Shannon

Re: [Qemu-devel] [PATCH] tcg/arm: improve direct jump

2015-12-10 Thread TeLeMan
On Thu, Dec 10, 2015 at 4:02 PM, Aurelien Jarno wrote: > Use ldr pc, [pc, #-4] kind of branch for direct jump. This removes the > need to flush the icache on TB linking, and allow to remove the limit > on the code generation buffer. > > Cc: Richard Henderson

Re: [Qemu-devel] [PATCH v2 2/3] net/vmxnet3: fix debug macro pattern for vmxnet3

2015-12-10 Thread Jason Wang
On 12/08/2015 06:04 AM, Eric Blake wrote: > On 12/06/2015 07:47 PM, Jason Wang wrote: >> >> On 12/05/2015 04:55 PM, Miao Yan wrote: >>> Vmxnet3 uses the following debug macro style: >>> >>> #ifdef SOME_DEBUG >>> # define debug(...) do{ printf(...); } while (0) >>> # else >>> # define

[Qemu-devel] [PATCH v5 10/10] ARM: Virt: Add gpio-keys node for Poweroff using DT

2015-12-10 Thread Shannon Zhao
From: Shannon Zhao Add a gpio-keys node. This is used for Poweroff for the systems which use DT not ACPI. Signed-off-by: Shannon Zhao Signed-off-by: Shannon Zhao Tested-by: Wei Huang ---

Re: [Qemu-devel] [PATCH v2 24/74] acpi: extend aml_interrupt() to support multiple irqs

2015-12-10 Thread Shannon Zhao
On 2015/12/10 19:34, Igor Mammedov wrote: > ASL Interrupt() macro translates to Extended Interrupt Descriptor > which supports variable number of IRQs. It will be used for > conversion of ASL code for pc/q35 machines that use it for > returning several IRQs in _PSR object. > > Signed-off-by:

Re: [Qemu-devel] [PATCH 04/74] acpi: add aml_lgreater_equal()

2015-12-10 Thread Shannon Zhao
On 2015/12/10 7:40, Igor Mammedov wrote: > Signed-off-by: Igor Mammedov Reviewed-by: Shannon Zhao > --- > hw/acpi/aml-build.c | 11 +++ > include/hw/acpi/aml-build.h | 1 + > 2 files changed, 12 insertions(+) > > diff --git

Re: [Qemu-devel] [PATCH 15/74] acpi: support serialized method

2015-12-10 Thread Shannon Zhao
On 2015/12/10 7:41, Igor Mammedov wrote: > From: Xiao Guangrong > > Add serialized method support so that explicit Mutex can be > avoided > > Signed-off-by: Xiao Guangrong > Signed-off-by: Igor Mammedov

Re: [Qemu-devel] [PATCH COLO-Frame v11 19/39] COLO: Add checkpoint-delay parameter for migrate-set-parameters

2015-12-10 Thread Hailiang Zhang
On 2015/12/10 2:50, Dr. David Alan Gilbert wrote: * zhanghailiang (zhang.zhanghaili...@huawei.com) wrote: Add checkpoint-delay parameter for migrate-set-parameters, so that we can control the checkpoint frequency when COLO is in periodic mode. Cc: Luiz Capitulino Cc:

<    1   2   3   >