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

2015-12-10 Thread Lan, Tianyu
On 12/11/2015 12:11 AM, Michael S. Tsirkin wrote: On Thu, Dec 10, 2015 at 10:38:32PM +0800, Lan, Tianyu wrote: On 12/10/2015 7:41 PM, Dr. David Alan Gilbert wrote: Ideally, it is able to leave guest driver unmodified but it requires the hypervisor or qemu to aware the device which means we

[Qemu-devel] vhost_user and VIRTIO_NET_F_GUEST_ANNOUNCE

2015-12-10 Thread Pavel Fedin
Hello! I am currently testing this patchset (http://dpdk.org/ml/archives/dev/2015-December/029193.html), and I've got a question. After the migration the guest has to announce its MAC address for the network to work. Guest OS can do it itself, or qemu can send VHOST_USER_SEND_RARP to the vho

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

2015-12-10 Thread Fam Zheng
On Thu, 12/10 18:23, Markus Armbruster wrote: > diff --git a/block/vmdk.c b/block/vmdk.c > index 6f819e4..b4a224e 100644 > --- a/block/vmdk.c > +++ b/block/vmdk.c > @@ -1494,8 +1494,8 @@ static int vmdk_write(BlockDriverState *bs, int64_t > sector_num, > > if (sector_num > bs->total_sectors

Re: [Qemu-devel] [PATCH v7 29/31] qapi: Simplify semantics of visit_next_list()

2015-12-10 Thread Eric Blake
On 12/10/2015 10:32 AM, Eric Blake wrote: > On 12/07/2015 08:55 PM, Eric Blake wrote: > >> We can greatly simplify things by hoisting the special case >> into the start() routine, and flipping the order in the loop >> to visit before advance: >> >> start(head) >> element = *head >> while (element)

Re: [Qemu-devel] [RFC PATCH v0 0/9] Generic cpu-core device

2015-12-10 Thread Bharata B Rao
On Thu, Dec 10, 2015 at 01:35:05PM +0100, Igor Mammedov wrote: > On Thu, 10 Dec 2015 11:45:35 +0530 > Bharata B Rao wrote: > > > Hi, > > > > This is an attempt to define a generic CPU device that serves as a > > containing device to underlying arch-specific CPU devices. The > > motivation for th

Re: [Qemu-devel] [PATCH COLO-Frame v11 08/39] migration: Rename the'file' member of MigrationState

2015-12-10 Thread Hailiang Zhang
On 2015/12/10 14:41, Wen Congyang wrote: On 11/24/2015 05:25 PM, zhanghailiang wrote: Rename the 'file' member of MigrationState to 'to_dst_file'. Signed-off-by: zhanghailiang Cc: Dr. David Alan Gilbert --- v11: - Only rename 'file' member of MigrationState You forgot to update migration/rd

[Qemu-devel] [PATCH v5 06/10] ACPI: Add GPIO Connection Descriptor

2015-12-10 Thread Shannon Zhao
From: Shannon Zhao Signed-off-by: Shannon Zhao Signed-off-by: Shannon Zhao Tested-by: Wei Huang Reviewed-by: Igor Mammedov --- hw/acpi/aml-build.c | 68 + include/hw/acpi/aml-build.h | 20 + 2 files changed, 88 insertions(+) di

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

2015-12-10 Thread Bharata B Rao
On Thu, Dec 10, 2015 at 10:25:28AM +, Daniel P. Berrange wrote: > 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 >

[Qemu-devel] [PATCH v5 07/10] ACPI: Add aml_gpio_int() wrapper for GPIO Interrupt Connection

2015-12-10 Thread Shannon Zhao
From: Shannon Zhao Signed-off-by: Shannon Zhao Signed-off-by: Shannon Zhao Tested-by: Wei Huang Reviewed-by: Igor Mammedov --- hw/acpi/aml-build.c | 20 include/hw/acpi/aml-build.h | 7 +++ 2 files changed, 27 insertions(+) diff --git a/hw/acpi/aml-build.c

[Qemu-devel] [PATCH for-2.5?] qemu-iotests: Reduce racy output in 028

2015-12-10 Thread Eric Blake
On my machine, './check -qcow2 028' was failing about 80% of the time, due to a race in how many times the repeated attempts to run 'info block-jobs' could occur before the job was done, showing up as a failure of fewer '(qemu) ' prompts than in the expected output. Silence the output during the r

[Qemu-devel] [PATCH v5 03/10] ARM: Virt: Add a GPIO controller

2015-12-10 Thread Shannon Zhao
From: Shannon Zhao ACPI 5.0 supports GPIO-signaled ACPI Events. This can be used for powerdown, hotplug evnets. Add a GPIO controller in machine virt, to support powerdown, maybe can be used for cpu hotplug. And here we use pl061. Signed-off-by: Shannon Zhao Signed-off-by: Shannon Zhao Reviewe

[Qemu-devel] [PATCH v5 02/10] acpi: extend aml_interrupt() to support multiple irqs

2015-12-10 Thread Shannon Zhao
From: 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 Reviewed-by: Shannon Z

[Qemu-devel] [PATCH v5 01/10] acpi: support serialized method

2015-12-10 Thread Shannon Zhao
From: Xiao Guangrong Add serialized method support so that explicit Mutex can be avoided Signed-off-by: Xiao Guangrong Signed-off-by: Igor Mammedov Reviewed-by: Shannon Zhao --- hw/acpi/aml-build.c | 17 +++-- hw/arm/virt-acpi-build.c| 10 +- hw/i386/acpi-buil

[Qemu-devel] [PATCH v5 05/10] ARM: ACPI: Add power button device in ACPI DSDT table

2015-12-10 Thread Shannon Zhao
From: Shannon Zhao Add power button device in ACPI DSDT table. Signed-off-by: Shannon Zhao Signed-off-by: Shannon Zhao Reviewed-by: Wei Huang Tested-by: Wei Huang Reviewed-by: Igor Mammedov --- hw/arm/virt-acpi-build.c | 11 +++ 1 file changed, 11 insertions(+) diff --git a/hw/arm

[Qemu-devel] [PATCH v5 04/10] ARM: ACPI: Add GPIO controller in ACPI DSDT table

2015-12-10 Thread Shannon Zhao
From: Shannon Zhao Add GPIO controller in ACPI DSDT table. It can be used for gpio event. Signed-off-by: Shannon Zhao Signed-off-by: Shannon Zhao Tested-by: Wei Huang --- hw/arm/virt-acpi-build.c | 19 +++ 1 file changed, 19 insertions(+) diff --git a/hw/arm/virt-acpi-build.

[Qemu-devel] [PATCH v5 00/10] Add system_powerdown support on ARM for ACPI and DT

2015-12-10 Thread Shannon Zhao
From: Shannon Zhao ACPI SPEC 5.0 defines GPIO-signaled ACPI Events for Hardware-reduced platforms(like ARM). It uses GPIO pin to trigger an event to the guest. For QEMU, here we add PL061 GPIO controller and use PIN 3 for system_powerdown, reserving PIN 0, 1, 2 for PCI hotplug, CPU hotplug and me

[Qemu-devel] [PATCH v5 09/10] ARM: Virt: Add QEMU powerdown notifier and hook it to GPIO Pin 3

2015-12-10 Thread Shannon Zhao
From: Shannon Zhao Currently mach-virt model doesn't support powerdown request. Guest VM doesn't react to system_powerdown from monitor console (or QMP) because there is no communication mechanism for such requests. This patch registers GPIO Pin 3 with powerdown notification. So guest VM can rece

[Qemu-devel] [PATCH v5 08/10] ARM: ACPI: Add _E03 for Power Button

2015-12-10 Thread Shannon Zhao
From: Shannon Zhao Here GPIO pin 3 is used for Power Button, add _E03 in ACPI DSDT table. Signed-off-by: Shannon Zhao Signed-off-by: Shannon Zhao Tested-by: Wei Huang --- hw/arm/virt-acpi-build.c | 14 ++ 1 file changed, 14 insertions(+) diff --git a/hw/arm/virt-acpi-build.c b/h

[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 --- hw/arm/virt.c | 16 1 file changed, 16 insertions(+) diff --git a/hw/arm/virt.c b/hw/ar

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: Eric Blake Cc: Markus Arm

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

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

2015-12-10 Thread Bharata B Rao
On Thu, Dec 10, 2015 at 06:23:49PM +0100, Markus Armbruster wrote: > 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:

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 Reviewed-by: Shannon Zhao > --- > hw/acpi/aml-build.c | 17 +++--

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 a/hw/acpi/aml-build.c b/hw/acpi/aml-build.c > index

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

2015-12-10 Thread Shannon Zhao
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 uses that > form, so for clean conversion of it, AML API should > be able to handle an optional 'Dst' a

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 > Cc: TeLeMan > Cc: Andrzej Zaborowsk

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

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 Zhao >> > Signed-off-by: Shannon Zhao >> > Tested-b

Re: [Qemu-devel] [PATCH v4 2/8] ARM: ACPI: Add GPIO controller in ACPI DSDT table

2015-12-10 Thread Shannon Zhao
Hi, On 2015/12/11 4:13, Igor Mammedov wrote: > On Thu, 10 Dec 2015 13:16:22 -0600 > Wei Huang wrote: > >> > >> > >> > On 12/10/2015 07:22 AM, Igor Mammedov wrote: >>> > > On Mon, 7 Dec 2015 15:39:46 +0800 >>> > > Shannon Zhao wrote: >>> > > > >> From: Shannon Zhao > >> > >> A

Re: [Qemu-devel] [PATCH 11/11] RFC: qemu-img: Use new JSON output formatter

2015-12-10 Thread Fam Zheng
On Thu, 12/10 16:53, Eric Blake wrote: > Now that we can pretty-print straight to JSON from a visitor, > we can eliminate the temporary conversion into QObject inside > qemu-img. > > RFC because at least qemu-iotests 043 has changed output, not > included in this version of the patch. Conflicts w

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

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 testing purposes and should n

Re: [Qemu-devel] [PATCH 07/11] qapi: add json output visitor

2015-12-10 Thread Eric Blake
On 12/10/2015 04:53 PM, Eric Blake wrote: > We have several places that want to go from qapi to JSON; right now, > they have to create an intermediate QObject to do the work. That > also has the drawback that the JSON formatting of a QDict will > rearrange keys (according to a deterministic, but u

[Qemu-devel] [PATCH 10/18] slirp: Adding IPv6, ICMPv6 Echo and NDP autoconfiguration

2015-12-10 Thread Samuel Thibault
From: Guillaume Subiron This patch adds the functions needed to handle IPv6 packets. ICMPv6 and NDP headers are implemented. Slirp is now able to send NDP Router or Neighbor Advertisement when it receives Router or Neighbor Solicitation. Using a 64bit-sized IPv6 prefix, the guest is now able to

[Qemu-devel] [PATCH 13/18] slirp: Factorizing tcpiphdr structure with an union

2015-12-10 Thread Samuel Thibault
From: Guillaume Subiron This patch factorizes the tcpiphdr structure to put the IPv4 fields in an union, for addition of version 6 in further patch. Using some macros, retrocompatibility of the existing code is assured. This patch also fixes the SLIRP_MSIZE and margin computation in various func

[Qemu-devel] [PATCH 18/18] qapi-schema, qemu-options & slirp: Adding Qemu options for IPv6 addresses

2015-12-10 Thread Samuel Thibault
From: Yann Bordenave This patch adds parameters to manage some new options in the qemu -net command. Slirp IPv6 address, network prefix, and DNS IPv6 address can be given in argument to the qemu command. Defaults parameters are respectively fec0::2, fec0::, /64 and fec0::3. Signed-off-by: Yann B

[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 various functions to sen

[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 --- slirp/ip_icmp.c | 2 +- slirp/udp.c | 7 --- slirp/udp.h | 2 +- 3 files

[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 Signed-off-by: Samuel Thibault --- s

[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. Signed-off-by: Guill

[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: Samuel Thibault --- slirp/ip6_input.c |

[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 added to prepare for t

[Qemu-devel] [PATCH 15/18] slirp: Reindent after refactoring

2015-12-10 Thread Samuel Thibault
From: Guillaume Subiron No code change. Signed-off-by: Guillaume Subiron Signed-off-by: Samuel Thibault --- slirp/tcp_input.c | 95 +++--- slirp/tcp_output.c | 29 - slirp/tcp_subr.c | 50 ++-- 3 files

[Qemu-devel] [PATCH 05/18] slirp: Factorizing address translation

2015-12-10 Thread Samuel Thibault
From: Guillaume Subiron This patch factorizes some duplicate code into a new function, sotranslate_out(). This function perform the address translation when a packet is transmitted to the host network. If the paquet is destinated to the host, the loopback address is used, and if the paquet is des

[Qemu-devel] [PATCH 03/18] slirp: Reindent after refactoring

2015-12-10 Thread Samuel Thibault
From: Guillaume Subiron No code change. Signed-off-by: Guillaume Subiron Signed-off-by: Samuel Thibault --- slirp/slirp.c | 117 +- 1 file changed, 59 insertions(+), 58 deletions(-) diff --git a/slirp/slirp.c b/slirp/slirp.c index 380dd

[Qemu-devel] [PATCH 04/18] slirp: Make Socket structure IPv6 compatible

2015-12-10 Thread Samuel Thibault
From: Guillaume Subiron This patch replaces foreign and local address/port couples in Socket structure by 2 sockaddr_storage which can be casted in sockaddr_in. Direct access to address and port is still possible thanks to some \#define, so retrocompatibility of the existing code is assured. The

[Qemu-devel] [PATCH 09/18] qemu/timer.h : Adding function to second scale

2015-12-10 Thread Samuel Thibault
From: Guillaume Subiron This patch adds SCALE_S, timer_new_s(), and qemu_clock_get_s in qemu/timer.h to manage second-scale timers. Signed-off-by: Guillaume Subiron Signed-off-by: Samuel Thibault --- include/qemu/timer.h | 32 1 file changed, 32 insertions(+)

[Qemu-devel] [PATCH 08/18] slirp: Adding family argument to tcp_fconnect()

2015-12-10 Thread Samuel Thibault
From: Guillaume Subiron This patch simply adds a sa_family_t argument to remove the hardcoded "AF_INET" in the call of qemu_socket(). Signed-off-by: Guillaume Subiron Signed-off-by: Samuel Thibault --- slirp/slirp.h | 2 +- slirp/tcp_input.c | 2 +- slirp/tcp_subr.c | 5 +++-- 3 files ch

[Qemu-devel] [PATCH 06/18] slirp: Factorizing and cleaning solookup()

2015-12-10 Thread Samuel Thibault
From: Guillaume Subiron This patch makes solookup() compatible with varying address families. Also, this function was only compatible with TCP. Having the socket list in argument, it is now compatible with UDP too. Finally, some optimization code is factorized inside the function (the function lo

[Qemu-devel] [PATCH 01/18] slirp: goto bad in udp_input if sosendto fails

2015-12-10 Thread Samuel Thibault
From: Guillaume Subiron Before this patch, if sosendto fails, udp_input is executed as if the packet was sent, recording the packet for icmp errors, which does not makes sense since the packet was not actually sent, errors would be related to a previous packet. This patch adds a goto bad to cut

[Qemu-devel] [PATCHv5 00/18] slirp: Adding IPv6 support to Qemu -net user mode

2015-12-10 Thread Samuel Thibault
Hello, This is another respin of IPv6 in Qemu -net user mode. These patches add ICMPv6, NDP, and make UDP and TCP compatible with IPv6. We have made some refactoring to make current code compatible with IPv6. Patches 1 to 8 are refactoring of existing code and do not change the behavior, 9 adds

[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 &error_fatal instead. Signed-off-by: David Gibson --- hw/ppc/spapr.c | 53 + 1 file changed, 25 insertions(+), 28 del

[Qemu-devel] [PATCH 17/18] slirp: Adding IPv6 address for DNS relay

2015-12-10 Thread Samuel Thibault
From: Guillaume Subiron This patch adds an IPv6 address to the DNS relay. in6_equal_dns() is developed using this Slirp attribute. sotranslate_in/out/accept() are also updated to manage the IPv6 case so the guest can be able to join the host using one of the Slirp addresses. Signed-off-by: Guill

[Qemu-devel] [PATCH 01/11] ppc: Cleanup error handling in ppc_set_compat()

2015-12-10 Thread David Gibson
Current ppc_set_compat() returns -1 for errors, and also (unconditionally) reports an error message. The caller in h_client_architecture_support() may then report it again using an outdated fprintf(). Clean this up by using the modern error reporting mechanisms. Signed-off-by: David Gibson ---

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

2015-12-10 Thread David Gibson
Use the error handling infrastructure to pass an error out from try_create_xics() instead of assuming &error_abort - the caller is in a better position to decide on error handling policy. Signed-off-by: David Gibson --- hw/ppc/spapr.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)

[Qemu-devel] [PATCH 05/11] pseries: Cleanup error handling in spapr_vga_init()

2015-12-10 Thread David Gibson
Use error_setg() to return an error rather than an explicit exit(). Previously it was an exit(0) instead of a non-zero exit code, which was simply a bug. Also improve the error message. Signed-off-by: David Gibson --- hw/ppc/spapr.c | 10 +- 1 file changed, 5 insertions(+), 5 deletions(

[Qemu-devel] [PATCH 06/11] pseries: Improve error handling in find_unknown_sysbus_device()

2015-12-10 Thread David Gibson
Use error_setg() to return an error instead of using an explicit exit(). Signed-off-by: David Gibson --- hw/ppc/spapr.c | 9 + 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c index 0ff09b9..fd16db4 100644 --- a/hw/ppc/spapr.c +++ b/hw/ppc/spa

[Qemu-devel] [PATCH 11/11] pseries: Clean up error reporting in htab migration functions

2015-12-10 Thread David Gibson
The functions for migrating the hash page table on pseries machine type (htab_save_setup() and htab_load()) can report some errors with an explicit fprintf() before returning an appropriate eror code. Change these to use error_report() instead. Signed-off-by: David Gibson --- hw/ppc/spapr.c | 1

[Qemu-devel] [PATCH 03/11] pseries: Clean up hash page table allocation error handling

2015-12-10 Thread David Gibson
The spapr_alloc_htab() and spapr_reset_htab() functions currently handle all errors with error_setg(&error_abort, ...). That's correct for spapr_reset_htab() - if anything goes wrong there, there's really nothing we can do about it. For spapr_alloc_htab() &error_fatal would make more sense, since

[Qemu-devel] [PATCH 07/11] pseries: Cleanup error handling in spapr_kvm_type()

2015-12-10 Thread David Gibson
Use error_setg() and &error_fatal instead of an explicit exit(). Signed-off-by: David Gibson --- hw/ppc/spapr.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c index fd16db4..546d2f5 100644 --- a/hw/ppc/spapr.c +++ b/hw/ppc/spapr.c @@ -2035

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

2015-12-10 Thread David Gibson
Use error_setg() and return an error, rather than using an explicit exit(). Also improve messages, and be more explicit about which constraint failed. Signed-off-by: David Gibson --- hw/ppc/spapr.c | 37 ++--- 1 file changed, 22 insertions(+), 15 deletions(-) di

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

[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 &error_abort instead of explicit fprintf() and exit(). Signed-off-by: David Gibson --- hw/ppc/spapr_rtas.c | 9 - 1 file cha

[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 10/11] qapi: Support pretty printing in JSON output visitor

2015-12-10 Thread Eric Blake
Similar to pretty printing in the QObject visitor. Trickiest parts are the fact that during type_any(), we have to coordinate with QObject to also print pretty; and the fact that the testsuite now has to honor parameterization on whether pretty printing is enabled. Signed-off-by: Eric Blake ---

[Qemu-devel] [PATCH 11/11] RFC: qemu-img: Use new JSON output formatter

2015-12-10 Thread Eric Blake
Now that we can pretty-print straight to JSON from a visitor, we can eliminate the temporary conversion into QObject inside qemu-img. RFC because at least qemu-iotests 043 has changed output, not included in this version of the patch. Conflicts with Fam's qemu-img edits, so one of the two of us w

[Qemu-devel] [PATCH 06/11] qapi: Add qstring_append_format()

2015-12-10 Thread Eric Blake
Back in commit 764c1ca (Nov 2009), we added qstring_append_int(). However, it did not see any use until commit 190c882 (Jan 2015). Furthermore, it has a rather limited use case - to print anything else, callers still have to format into a temporary buffer, unless we want to introduce an explosion o

[Qemu-devel] [PATCH 09/11] qapi: Add qobject_to_json_pretty_prefix()

2015-12-10 Thread Eric Blake
The next patch will add pretty indentation to the JSON visitor. But in order to support pretty output in the type_any() callback, we need to prefix every line of the QObject visitor by the current indentation in the JSON visitor. Hence, a new function qobject_to_json_pretty_indent(), and the old f

[Qemu-devel] [PATCH 01/11] qapi: Rename qjson.h to qobject-json.h

2015-12-10 Thread Eric Blake
We have two different JSON visitors in the tree; and having both named 'qjson.h' can cause include confusion. Rename the qapi version. Kill trailing whitespace in the renamed tests/check-qobject-json.c to keep checkpatch.pl happy. Signed-off-by: Eric Blake --- MAINTAINERS

[Qemu-devel] [PATCH 04/11] qapi: Factor out JSON number formatting

2015-12-10 Thread Eric Blake
Pull out a new qstring_append_json_number() helper, so that all JSON output producers can use a consistent style for printing floating point without duplicating code (since we are doing more data massaging than a simple printf format). Address one FIXME by adding an Error parameter and warning the

[Qemu-devel] [PATCH 08/11] qjson: Simplify by using json-output-visitor

2015-12-10 Thread Eric Blake
Instead of rolling our own limited JSON outputter, we can just wrap the more full-featured JSON output Visitor. This slightly changes the output (different spacing), but the result is still equivalent JSON contents. Signed-off-by: Eric Blake --- qjson.c | 61 ++--

[Qemu-devel] [PATCH 07/11] qapi: add json output visitor

2015-12-10 Thread Eric Blake
We have several places that want to go from qapi to JSON; right now, they have to create an intermediate QObject to do the work. That also has the drawback that the JSON formatting of a QDict will rearrange keys (according to a deterministic, but unpredictable, hash), when humans have an easier ti

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

[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 441c6e9..fc5510e 100644

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

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

Re: [Qemu-devel] [Qemu-block] [PATCH v2] qemu-img / curl: When fetching Content-Size use GET instead of HEAD.

2015-12-10 Thread John Snow
On 12/09/2015 05:37 PM, Boris Schrijver wrote: > Dear all, > > Thanks for your time so-far. > > I send a mail to the libcurl development list and got a helpful reaction [1]! > I > changed my patch accordingly. We now don't have to check for a > CURLE_WRITE_ERROR > anymore and curl_easy_perfor

Re: [Qemu-devel] [PATCH v3 2/4] target-tilegx: Add single floating point implementation

2015-12-10 Thread Chen Gang
On 12/11/15 04:18, Richard Henderson wrote: > On 12/10/2015 09:15 AM, Richard Henderson wrote: >> d = (uint64_t)sign << 63; >> d = deposit64(d, 53, 11, exp); >> d = deposit64(d, 21, 32, man); >> return float64_to_float32(d, fp_status); > > Hmm. Actually, this incorrectly adds the implici

Re: [Qemu-devel] [PATCH v3 2/4] target-tilegx: Add single floating point implementation

2015-12-10 Thread Chen Gang
On 12/11/15 01:15, Richard Henderson wrote: > On 12/10/2015 06:15 AM, Chen Gang wrote: >> +#define TILEGX_F_CALC_CVT 0 /* convert int to fsingle */ >> +#define TILEGX_F_CALC_NCVT 1 /* Not convertion */ >> + >> +static uint32_t get_f32_exp(float32 f) >> +{ >> +return extract32(float3

Re: [Qemu-devel] [PATCH v3 14/15] qemu-img: Use QAPI visitor to generate JSON

2015-12-10 Thread Eric Blake
On 11/25/2015 10:05 PM, Fam Zheng wrote: > A visible improvement is that "filename" is now included in the output > if it's valid. > > Reviewed-by: Eric Blake > Signed-off-by: Fam Zheng > --- > qemu-img.c | 34 ++-- > tests/qemu-iotests/122.out | 96 > ++

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

2015-12-10 Thread Hervé Poussineau
Le 10/12/2015 11:29, Markus Armbruster a écrit : 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. Si

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

2015-12-10 Thread Hervé Poussineau
Le 10/12/2015 11:29, Markus Armbruster a écrit : 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 p

Re: [Qemu-devel] [PATCH v3 4/4] target-tilegx: Integrate floating pointer implementation

2015-12-10 Thread Chen Gang
On 12/11/15 05:37, Richard Henderson wrote: > On 12/10/2015 06:16 AM, Chen Gang wrote: [...] >> >> diff --git a/target-tilegx/cpu.h b/target-tilegx/cpu.h >> index 03df107..445a606 100644 >> --- a/target-tilegx/cpu.h >> +++ b/target-tilegx/cpu.h >> @@ -88,6 +88,8 @@ typedef struct CPUTLGState { >>

Re: [Qemu-devel] [PATCH v3 4/4] target-tilegx: Integrate floating pointer implementation

2015-12-10 Thread Richard Henderson
On 12/10/2015 06:16 AM, Chen Gang wrote: > > It passes normal building, and gcc testsuite. > > Signed-off-by: Chen Gang > --- > target-tilegx/Makefile.objs | 3 +- > target-tilegx/cpu.h | 2 ++ > target-tilegx/helper.h | 12 > target-tilegx/translate.c | 68 >

Re: [Qemu-devel] [Qemu-block] [PATCH] qemu-img / curl: When fetching Content-Size use GET instead of HEAD.

2015-12-10 Thread Boris Schrijver
Dear John, I already send a new patch with V2. Please see that one! > On December 10, 2015 at 10:26 PM John Snow wrote: > > > > > On 12/08/2015 03:49 PM, Boris Schrijver wrote: > > See inline! Thanks for your response! > > > > -- > > > > Met vriendelijke groet / Kind regards, > > > > Bor

Re: [Qemu-devel] [Qemu-block] [PATCH] qemu-img / curl: When fetching Content-Size use GET instead of HEAD.

2015-12-10 Thread John Snow
On 12/08/2015 03:49 PM, Boris Schrijver wrote: > See inline! Thanks for your response! > > -- > > Met vriendelijke groet / Kind regards, > > Boris Schrijver > > PCextreme B.V. > > http://www.pcextreme.nl/contact > Tel direct: +31 (0) 118 700 215 > >> On December 8, 2015 at 8:40 PM John Sno

Re: [Qemu-devel] [PATCH v3 3/4] target-tilegx: Add double floating point implementation

2015-12-10 Thread Richard Henderson
On 12/10/2015 06:15 AM, Chen Gang wrote: > +#define TILEGX_F_MAN_HBIT (1ULL << 59) ... > +static uint64_t fr_to_man(float64 d) > +{ > +uint64_t val = get_f64_man(d) << 7; > + > +if (get_f64_exp(d)) { > +val |= TILEGX_F_MAN_HBIT; > +} > + > +return val; > +} One presumes t

Re: [Qemu-devel] [PATCH v1 1/2] sd: sdhci: Delete over-zealous power check

2015-12-10 Thread Andrew Baumann
Raspberry Pi needs this change as well. I don't mind if it's as implemented below, or conditional under a flag property. Tested-By: Andrew Baumann Thanks, Andrew > From: Peter Crosthwaite [mailto:crosthwaitepe...@gmail.com] > Sent: Thursday, 10 December 2015 12:55 > > CCing Andrew who ran int

Re: [Qemu-devel] [PATCH v1 1/2] sd: sdhci: Delete over-zealous power check

2015-12-10 Thread Peter Crosthwaite
CCing Andrew who ran into a similar issue for rPI. On Sat, Nov 28, 2015 at 12:50 PM, Peter Crosthwaite wrote: > This check was conditionalising SD card operation on the card being > powered by the SDHCI host controller. It is however possible > (particularly in embedded systems) for the power con

Re: [Qemu-devel] [RFC PATCH v0 0/9] Generic cpu-core device

2015-12-10 Thread Matthew Rosato
On 12/10/2015 01:15 AM, Bharata B Rao wrote: > Hi, > > This is an attempt to define a generic CPU device that serves as a > containing device to underlying arch-specific CPU devices. The motivation > for this is to have an arch-neutral way to specify CPUs mainly during > hotplug. > > Instead of i

Re: [Qemu-devel] [PATCH v4 3/8] ARM: ACPI: Add power button device in ACPI DSDT table

2015-12-10 Thread Igor Mammedov
On Mon, 7 Dec 2015 15:39:47 +0800 Shannon Zhao wrote: > From: Shannon Zhao > > Add power button device in ACPI DSDT table. > > Signed-off-by: Shannon Zhao > Signed-off-by: Shannon Zhao > Reviewed-by: Wei Huang > Tested-by: Wei Huang Reviewed-by: Igor Mammedov > --- > hw/arm/virt-acpi-bu

Re: [Qemu-devel] [PATCH v3 2/4] target-tilegx: Add single floating point implementation

2015-12-10 Thread Richard Henderson
On 12/10/2015 09:15 AM, Richard Henderson wrote: > d = (uint64_t)sign << 63; > d = deposit64(d, 53, 11, exp); > d = deposit64(d, 21, 32, man); > return float64_to_float32(d, fp_status); Hmm. Actually, this incorrectly adds the implicit bit. We'd actually need to steal portions of softflo

Re: [Qemu-devel] [PATCH v4 5/8] ACPI: Add aml_gpio_int() wrapper for GPIO Interrupt Connection

2015-12-10 Thread Igor Mammedov
On Mon, 7 Dec 2015 15:39:49 +0800 Shannon Zhao wrote: > From: Shannon Zhao > > Signed-off-by: Shannon Zhao > Signed-off-by: Shannon Zhao > Tested-by: Wei Huang Reviewed-by: Igor Mammedov > --- > hw/acpi/aml-build.c | 20 > include/hw/acpi/aml-build.h | 7

Re: [Qemu-devel] [PATCH v4 4/8] ACPI: Add GPIO Connection Descriptor

2015-12-10 Thread Igor Mammedov
On Mon, 7 Dec 2015 15:39:48 +0800 Shannon Zhao wrote: > From: Shannon Zhao > > Signed-off-by: Shannon Zhao > Signed-off-by: Shannon Zhao > Tested-by: Wei Huang Reviewed-by: Igor Mammedov > --- > hw/acpi/aml-build.c | 68 > + > include/hw/

Re: [Qemu-devel] [PATCH v4 2/8] ARM: ACPI: Add GPIO controller in ACPI DSDT table

2015-12-10 Thread Igor Mammedov
On Thu, 10 Dec 2015 13:16:22 -0600 Wei Huang wrote: > > > On 12/10/2015 07:22 AM, Igor Mammedov wrote: > > On Mon, 7 Dec 2015 15:39:46 +0800 > > Shannon Zhao wrote: > > > >> From: Shannon Zhao > >> > >> Add GPIO controller in ACPI DSDT table. It can be used for gpio > >> event. > >> > >> Sig

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

2015-12-10 Thread Igor Mammedov
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 Zhao > Signed-off-by: Shannon Zhao > Tested-by: Wei Huang > --- > hw/arm/virt-acpi-build.c | 14 ++ >

Re: [Qemu-devel] [PATCH COLO-Frame v11 27/39] COLO failover: Shutdown related socket fd when do failover

2015-12-10 Thread Dr. David Alan Gilbert
* zhanghailiang (zhang.zhanghaili...@huawei.com) wrote: > If the net connection between COLO's two sides is broken while colo/colo > incoming > thread is blocked in 'read'/'write' socket fd. It will not detect this error > until > connect timeout. It will be a long time. > > Here we shutdown all

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

2015-12-10 Thread Aurelien Jarno
On 2015-12-10 07:31, Richard Henderson wrote: > On 12/10/2015 12:02 AM, Aurelien Jarno wrote: > >Note: I don't really get the reason for the current 16MB limit. With the > >standard branch instructions the offset is coded on 24 bits, but shifted > >right by 2, which should give us a +/-32MB jumps,

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

2015-12-10 Thread Alexander Duyck
On Thu, Dec 10, 2015 at 8:11 AM, Michael S. Tsirkin wrote: > On Thu, Dec 10, 2015 at 10:38:32PM +0800, Lan, Tianyu wrote: >> >> >> On 12/10/2015 7:41 PM, Dr. David Alan Gilbert wrote: >> >>Ideally, it is able to leave guest driver unmodified but it requires the >> >>>hypervisor or qemu to aware th

Re: [Qemu-devel] [PATCH v4 2/8] ARM: ACPI: Add GPIO controller in ACPI DSDT table

2015-12-10 Thread Wei Huang
On 12/10/2015 07:22 AM, Igor Mammedov wrote: > On Mon, 7 Dec 2015 15:39:46 +0800 > Shannon Zhao wrote: > >> From: Shannon Zhao >> >> Add GPIO controller in ACPI DSDT table. It can be used for gpio event. >> >> Signed-off-by: Shannon Zhao >> Signed-off-by: Shannon Zhao >> Tested-by: Wei Huang

  1   2   3   >