Re: [Qemu-devel] [RFC v1 11/13] target-ppc: add maddld instruction

2016-07-21 Thread Richard Henderson
On 07/21/2016 12:24 PM, Richard Henderson wrote: On 07/18/2016 10:35 PM, Nikunj A Dadhania wrote: +static void gen_maddld(DisasContext *ctx) +{ +TCGv_i64 lo = tcg_temp_new_i64(); +TCGv_i64 hi = tcg_temp_new_i64(); +TCGv_i64 t1 = tcg_temp_new_i64(); +TCGv_i64 t2 = tcg_temp_new_i64

Re: [Qemu-devel] Regression: block: Add .bdrv_co_pwrite_zeroes()

2016-07-21 Thread Peter Lieven
Hi Eric, Am 21.07.2016 um 01:35 schrieb Eric Blake: On 07/04/2016 07:49 AM, Peter Lieven wrote: Hi, the above commit: commit d05aa8bb4a8b6aa9a915ec5074fb12ae632d2323 Author: Eric Blake Date: Wed Jun 1 15:10:03 2016 -0600 block: Add .bdrv_co_pwrite_zeroes() introduces a regression (a

Re: [Qemu-devel] [RFC v1 12/13] target-ppc: add maddhd and maddhdu instruction

2016-07-21 Thread Richard Henderson
On 07/18/2016 10:35 PM, Nikunj A Dadhania wrote: +tcg_gen_movi_i64(t2, -1); +tcg_gen_movcond_i64(TCG_COND_GE, t2, cpu_gpr[rC(ctx->opcode)], zero, zero, neg); This is a simple sign-extension of rC. Better as tcg_gen_sari_i64(t2, cpu_gpr[rC(ctx->opcode)], 63); +tcg_gen_

Re: [Qemu-devel] [PATCH 1/1] ppc: Fix MMU model values needed by PR KVM

2016-07-21 Thread Mark Cave-Ayland
On 21/07/16 06:55, Sam Bobroff wrote: > Commit 4322e8c "ppc: Fix 64K pages support in full emulation" added > the POWERPC_MMU_64K flag to the POWERPC_MMU_2_06 and POWERPC_MMU_2_07 > definitions but not to their "degraded" variants. When running with PR > KVM, kvm_fixup_page_sizes() removes the POW

[Qemu-devel] [PATCH] xics_kvm: drop extra checking of kernel_xics_fd

2016-07-21 Thread Greg Kurz
We abort a few lines above if kernel_xics_fd == -1. This is only code cleanup. Signed-off-by: Greg Kurz --- hw/intc/xics_kvm.c | 20 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/hw/intc/xics_kvm.c b/hw/intc/xics_kvm.c index edbd62fd1bae..c9caefcf2b0b 100

Re: [Qemu-devel] [RFC v1 03/13] target-ppc: adding addpcis instruction

2016-07-21 Thread Nikunj A Dadhania
Nikunj A Dadhania writes: > ISA 3.0 instruction for adding immediate value with next instruction > address and return the result in the target register. > > Signed-off-by: Nikunj A Dadhania > Reviewed-by: David Gibson > --- > target-ppc/translate.c | 27 +++ > 1 file ch

Re: [Qemu-devel] [RFC v1 07/13] target-ppc: add cnttzd[.] instruction

2016-07-21 Thread Nikunj A Dadhania
Richard Henderson writes: > On 07/18/2016 10:35 PM, Nikunj A Dadhania wrote: >> +if (unlikely(Rc(ctx->opcode) != 0)) >> +gen_set_Rc0(ctx, cpu_gpr[rA(ctx->opcode)]); > > Braces. Sure. Regards Nikunj

Re: [Qemu-devel] [PATCH v3 13/28] vhost-user: check vhost_user_{read, write}() return value

2016-07-21 Thread Marc-André Lureau
Hi - Original Message - > On Wed, Jul 06, 2016 at 08:47:06PM +0200, marcandre.lur...@redhat.com wrote: > > From: Marc-André Lureau > > > > More error checking to break code flow and report appropriate errors. > > > > Signed-off-by: Marc-André Lureau > > So this will cause asserts here

Re: [Qemu-devel] [PATCH v3 17/28] get_vhost_net() should be != null after vhost_user_init

2016-07-21 Thread Marc-André Lureau
Hi - Original Message - > On Wed, Jul 06, 2016 at 08:47:10PM +0200, marcandre.lur...@redhat.com wrote: > > From: Marc-André Lureau > > > > Signed-off-by: Marc-André Lureau > > --- > > hw/net/vhost_net.c | 1 + > > net/vhost-user.c | 2 ++ > > 2 files changed, 3 insertions(+) > > > >

Re: [Qemu-devel] [RFC v1 08/13] target-ppc: add cnttzw[.] instruction

2016-07-21 Thread Nikunj A Dadhania
Richard Henderson writes: > On 07/18/2016 10:35 PM, Nikunj A Dadhania wrote: >> +if (unlikely(Rc(ctx->opcode) != 0)) >> +gen_set_Rc0(ctx, cpu_gpr[rA(ctx->opcode)]); > > Braces. Sure. Nikunj

Re: [Qemu-devel] [PATCH v3 10/28] vhost: change some assert() for error_report() or silent fail

2016-07-21 Thread Marc-André Lureau
Hi - Original Message - > On Wed, Jul 20, 2016 at 09:41:26AM -0400, Marc-André Lureau wrote: > > > > > > - Original Message - > > > On Wed, Jul 06, 2016 at 08:47:03PM +0200, marcandre.lur...@redhat.com > > > wrote: > > > > From: Marc-André Lureau > > > > > > > > Calling a vhost

Re: [Qemu-devel] [RFC v1 09/13] target-ppc: add cmpeqb instruction

2016-07-21 Thread Nikunj A Dadhania
Richard Henderson writes: > On 07/18/2016 10:35 PM, Nikunj A Dadhania wrote: >> +tcg_gen_andi_tl(src1, cpu_gpr[rA(ctx->opcode)], 0xFF); >> +for (i = 0; i < 64; i += 8) { >> +tcg_gen_shri_tl(t0, arg1, i); >> +tcg_gen_andi_tl(t0, t0, 0xFF); >> +tcg_gen_brcond_tl(TCG_

Re: [Qemu-devel] [RFC 3/6] target-ppc: adding addpcis instruction

2016-07-21 Thread Nikunj A Dadhania
Richard Henderson writes: > On 07/12/2016 11:33 PM, Nikunj A Dadhania wrote: >> +static void gen_addpcis(DisasContext *ctx) >> +{ >> +target_long d = DX(ctx->opcode); >> + >> +tcg_gen_movi_tl(cpu_gpr[rD(ctx->opcode)], ctx->nip); >> +tcg_gen_addi_tl(cpu_gpr[rD(ctx->opcode)], cpu_gpr[rD

Re: [Qemu-devel] [RFC 4/6] target-ppc: add cmprb instruction

2016-07-21 Thread Nikunj A Dadhania
Richard Henderson writes: > On 07/12/2016 11:33 PM, Nikunj A Dadhania wrote: >> +/* cmprb - range comparison: isupper, isaplha, islower*/ >> +static void gen_cmprb(DisasContext *ctx) >> +{ >> +TCGLabel *lab1 = gen_new_label(); >> +TCGLabel *lab2 = gen_new_label(); >> +TCGv src1 = tcg_

Re: [Qemu-devel] [QEMU v2 0/9] Fast (de)inflating & fast live migration

2016-07-21 Thread Li, Liang Z
Ping ... Liang > -Original Message- > From: kvm-ow...@vger.kernel.org [mailto:kvm-ow...@vger.kernel.org] > On Behalf Of Liang Li > Sent: Friday, July 15, 2016 10:47 AM > To: qemu-devel@nongnu.org > Cc: m...@redhat.com; pbonz...@redhat.com; quint...@redhat.com; > amit.s...@redhat.com; k...

Re: [Qemu-devel] [RFC 5/6] target-ppc: add modulo word operations

2016-07-21 Thread Nikunj A Dadhania
Richard Henderson writes: > On 07/18/2016 10:38 AM, Nikunj A Dadhania wrote: >> David Gibson writes: >> >>> [ Unknown signature status ] >>> On Tue, Jul 12, 2016 at 11:33:21PM +0530, Nikunj A Dadhania wrote: Adding following instructions: moduw: Modulo Unsigned Word modsw: Mo

Re: [Qemu-devel] [PATCH v2 kernel 0/7] Extend virtio-balloon for fast (de)inflating & fast live migration

2016-07-21 Thread Li, Liang Z
Hi Michael, If you have time, could you help to review this patch set? Thanks! Liang > -Original Message- > From: Li, Liang Z > Sent: Wednesday, June 29, 2016 6:32 PM > To: m...@redhat.com > Cc: linux-ker...@vger.kernel.org; virtualizat...@lists.linux-foundation.org; > k...@vger.kernel.

[Qemu-devel] [RFC PATCH V8 1/7] colo-compare: introduce colo compare initialization

2016-07-21 Thread Zhang Chen
This a COLO net ascii figure: Primary qemu Secondary qemu +--+ ++ | +--

[Qemu-devel] [RFC PATCH V8 0/7] Introduce COLO-compare

2016-07-21 Thread Zhang Chen
COLO-compare is a part of COLO project. It is used to compare the network package to help COLO decide whether to do checkpoint. The full version in this github: https://github.com/zhangckid/qemu/tree/colo-v2.7-proxy-mode-compare-with-colo-base-jul21 v8: p5: - add new patch: qemu-char: Add

[Qemu-devel] [RFC PATCH V8 4/7] colo-compare: track connection and enqueue packet

2016-07-21 Thread Zhang Chen
In this patch we use kernel jhash table to track connection, and then enqueue net packet like this: + CompareState ++ | | +---+ +---+ +---+ |conn list +--->conn +->conn | +---+ +-

[Qemu-devel] [RFC PATCH V8 2/7] colo-base: add colo-base to define and handle packet

2016-07-21 Thread Zhang Chen
COLO-base used by colo-compare and filter-rewriter. this can share common data structure like:net packet, and share other functions. Signed-off-by: Zhang Chen Signed-off-by: Li Zhijian Signed-off-by: Wen Congyang --- net/Makefile.objs | 1 + net/colo-base.c| 74

[Qemu-devel] [RFC PATCH V8 5/7] qemu-char: Add qemu_chr_add_handlers_full() for GMaincontext

2016-07-21 Thread Zhang Chen
Add qemu_chr_add_handlers_full() API, we can use this API pass in a GMainContext,make handler run in the context rather than main_loop. This comments from Daniel P . Berrange. Cc: Daniel P . Berrange Cc: Paolo Bonzini Signed-off-by: Zhang Chen Signed-off-by: Li Zhijian Signed-off-by: Wen Cong

[Qemu-devel] [RFC PATCH V8 7/7] colo-compare: add TCP, UDP, ICMP packet comparison

2016-07-21 Thread Zhang Chen
We add TCP,UDP,ICMP packet comparison to replace IP packet comparison. This can increase the accuracy of the package comparison. less checkpoint more efficiency. Signed-off-by: Zhang Chen Signed-off-by: Li Zhijian Signed-off-by: Wen Congyang --- net/colo-compare.c | 174 +++

[Qemu-devel] [RFC PATCH V8 3/7] Jhash: add linux kernel jhashtable in qemu

2016-07-21 Thread Zhang Chen
Jhash used by colo-compare and filter-rewriter to save and lookup net connection info Signed-off-by: Zhang Chen Signed-off-by: Li Zhijian Signed-off-by: Wen Congyang --- include/qemu/jhash.h | 61 1 file changed, 61 insertions(+) create mod

[Qemu-devel] [RFC PATCH V8 6/7] colo-compare: introduce packet comparison thread

2016-07-21 Thread Zhang Chen
If primary packet is same with secondary packet, we will send primary packet and drop secondary packet, otherwise notify COLO frame to do checkpoint. If primary packet comes and secondary packet not, after REGULAR_PACKET_CHECK_MS milliseconds we set the primary packet as old_packet,then do a checkp

Re: [Qemu-devel] [PATCH for-2.7] fix qemu exit on memory hotplug when allocation fails at prealloc time

2016-07-21 Thread Markus Armbruster
Igor Mammedov writes: > When adding hostmem backend at runtime, QEMU might exit with error: > "os_mem_prealloc: Insufficient free host memory pages available to allocate > guest RAM" > > It happens due to os_mem_prealloc() not handling errors gracefully. > > Fix it by passing errp argument so

Re: [Qemu-devel] [PATCH 05/10] tcg: Prepare TB invalidation for lockless TB lookup

2016-07-21 Thread Sergey Fedorov
On 20/07/16 01:27, Paolo Bonzini wrote: > > - Original Message - >> From: "Sergey Fedorov" >> To: "Paolo Bonzini" , qemu-devel@nongnu.org >> Cc: "sergey fedorov" , "alex bennee" >> >> Sent: Tuesday, July 19, 2016 9:56:49 PM >> Subject: Re: [PATCH 05/10] tcg: Prepare TB invalidation for l

[Qemu-devel] [PATCH] qemu-img: fix error messages emitted by img_open()

2016-07-21 Thread Reda Sallahi
img_open_file() and img_open_opts() were printing error messages with a duplicate part because of a wrong use of error_reportf_err() (e.g. qemu-img: Could not open 'foo': Could not open 'foo': No such file or directory) This change uses error_report_err() instead to eliminate the duplicate part.

[Qemu-devel] [Bug 1605123] [NEW] PEXT returns wrong values, seemingly switches arguments

2016-07-21 Thread Lenard Szolnoki
Public bug reported: Hi, I fiddled with BMI2 instructions and discovered that pext instructions emulated with "qemu-x86_64 -cpu Haswell" return the wrong value. It seemingly switches up its arguments. I suspect that the error is around the gen_helper_pext(...) call in target-i386/translate.c. I c

Re: [Qemu-devel] [PATCH V3] hw/virtio-pci: fix virtio behaviour

2016-07-21 Thread Cornelia Huck
On Wed, 20 Jul 2016 18:28:21 +0300 Marcel Apfelbaum wrote: > Enable transitional virtio devices by default. > Enable virtio-1.0 for devices plugged into > PCIe ports (Root ports or Downstream ports). Add "by default", as this can still be overridden? > > Using the virtio-1 mode will remove the

Re: [Qemu-devel] oss-security - CVE-2014-3672 libvirt: DoS via excessive logging

2016-07-21 Thread Daniel P. Berrange
On Thu, Jul 21, 2016 at 02:24:43AM +, Xulei (Stone) wrote: > Hi, > > A CVE(CVE-2014-3672) vulnerability was reported in Xen. > I want to know how to reproduce this CVE and whether the qemu-kvm was > affected ? > > Hyperlink: https://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2014-3672 > H

[Qemu-devel] [PATCH v5 00/31] vhost-user reconnect fixes

2016-07-21 Thread marcandre . lureau
From: Marc-André Lureau Hi, Since 'vhost-user: simple reconnection support' has been merged, it is possible to disconnect and reconnect a vhost-user backend. However, many code paths in qemu may trigger assert() when the backend is disconnected. There are also code paths that are wrong, see "do

[Qemu-devel] [PATCH v5 07/31] vhost: make vhost_dev_cleanup() idempotent

2016-07-21 Thread marcandre . lureau
From: Marc-André Lureau It is called on multiple code path, so make it safe to call several times (note: I don't remember a reproducer here, but a function called 'cleanup' should probably be idempotent in my book) Signed-off-by: Marc-André Lureau --- hw/virtio/vhost.c | 7 ++- 1 file chan

[Qemu-devel] [PATCH v5 01/31] misc: indentation

2016-07-21 Thread marcandre . lureau
From: Marc-André Lureau Signed-off-by: Marc-André Lureau --- hw/net/vhost_net.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/net/vhost_net.c b/hw/net/vhost_net.c index f92d3f8..3677a82 100644 --- a/hw/net/vhost_net.c +++ b/hw/net/vhost_net.c @@ -313,7 +313,7 @@ int vho

[Qemu-devel] [PATCH v5 03/31] vhost: don't assume opaque is a fd, use backend cleanup

2016-07-21 Thread marcandre . lureau
From: Marc-André Lureau vhost-dev opaque isn't necessarily an fd, it can be a chardev when using vhost-user. Goto fail, so vhost_backend_cleanup() is called to handle backend cleanup appropriately. vhost_set_backend_type() should never fail, use an assert(). Signed-off-by: Marc-André Lureau --

[Qemu-devel] [PATCH v5 02/31] vhost-user: minor simplification

2016-07-21 Thread marcandre . lureau
From: Marc-André Lureau Shorten the code and make it more clear by using the specialized function g_str_has_prefix(). Signed-off-by: Marc-André Lureau --- net/vhost-user.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/net/vhost-user.c b/net/vhost-user.c index c4d63e0..2

[Qemu-devel] [PATCH v5 09/31] vhost: fix calling vhost_dev_cleanup() after vhost_dev_init()

2016-07-21 Thread marcandre . lureau
From: Marc-André Lureau vhost_net_init() calls vhost_dev_init() and in case of failure, calls vhost_dev_cleanup() directly. However, the structure is already partially cleaned on error. Calling vhost_dev_cleanup() again will call vhost_virtqueue_cleanup() on already clean queues, and causing pote

[Qemu-devel] [PATCH v5 08/31] vhost-net: always call vhost_dev_cleanup() on failure

2016-07-21 Thread marcandre . lureau
From: Marc-André Lureau vhost_dev_init(), calling vhost backend initialization, should be cleaned up after failure too. Call vhost_dev_cleanup() in all failure cases. First, it needs to zero-alloc the struct to avoid the initial garbage. Signed-off-by: Marc-André Lureau --- hw/net/vhost_net.c

[Qemu-devel] [PATCH v5 04/31] vhost: make vhost_log_put() idempotent

2016-07-21 Thread marcandre . lureau
From: Marc-André Lureau Although not strictly required, it is nice to have vhost_log_put() safely callable multiple times. Clear dev->log* when calling vhost_log_put() to make the function idempotent. This also simplifies a bit the caller work. Signed-off-by: Marc-André Lureau --- hw/virtio/v

[Qemu-devel] [PATCH v5 14/31] vhost-user: call set_msgfds unconditionally

2016-07-21 Thread marcandre . lureau
From: Marc-André Lureau It is fine to call set_msgfds() with 0 fd, and ensures any previous fd array is cleared. Signed-off-by: Marc-André Lureau --- hw/virtio/vhost-user.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/hw/virtio/vhost-user.c b/hw/virtio/vhost-user.c in

[Qemu-devel] [PATCH v5 05/31] vhost: assert the log was cleaned up

2016-07-21 Thread marcandre . lureau
From: Marc-André Lureau Make sure the log was released on cleanup, or it will leak (the alternative is to call vhost_log_put() unconditionally, but it may hide some dev state issues). Signed-off-by: Marc-André Lureau --- hw/virtio/vhost.c | 1 + 1 file changed, 1 insertion(+) diff --git a/hw/

[Qemu-devel] [PATCH v5 12/31] vhost: use error_report() instead of fprintf(stderr, ...)

2016-07-21 Thread marcandre . lureau
From: Marc-André Lureau Let's use qemu proper error reporting API, this ensures the error is reported at the right place (stderr or monitor), with a conventional format. Signed-off-by: Marc-André Lureau --- hw/virtio/vhost.c | 19 +-- 1 file changed, 9 insertions(+), 10 deletio

[Qemu-devel] [PATCH v5 06/31] vhost: fix cleanup on not fully initialized device

2016-07-21 Thread marcandre . lureau
From: Marc-André Lureau If vhost_dev_init() failed, caller may still call vhost_dev_cleanup() later. However, vhost_dev_cleanup() tries to remove the device from the list even if it wasn't yet added, which may lead to crashes. Similarly for the memory listener. Signed-off-by: Marc-André Lureau

[Qemu-devel] [PATCH v5 13/31] qemu-char: fix qemu_chr_fe_set_msgfds() crash when disconnected

2016-07-21 Thread marcandre . lureau
From: Marc-André Lureau Calling qemu_chr_fe_set_msgfds() on unconnected socket leads to crash since s->ioc is NULL in this case. Return an error earlier instead. Signed-off-by: Marc-André Lureau --- qemu-char.c | 10 ++ 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/qemu

[Qemu-devel] [PATCH v5 11/31] vhost: add missing VHOST_OPS_DEBUG

2016-07-21 Thread marcandre . lureau
From: Marc-André Lureau Add missing VHOST_OPS_DEBUG() logs, for completeness. Signed-off-by: Marc-André Lureau --- hw/virtio/vhost.c | 17 +++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/hw/virtio/vhost.c b/hw/virtio/vhost.c index 324a8bf..a671ac8 100644 --- a/

[Qemu-devel] [PATCH v5 16/31] vhost-user: check vhost_user_{read, write}() return value

2016-07-21 Thread marcandre . lureau
From: Marc-André Lureau The vhost-user code is quite inconsistent with error handling. Instead of ignoring some return values of read/write and silently going on with invalid state (invalid read for example), break the code flow when the error happened. Signed-off-by: Marc-André Lureau --- hw/

[Qemu-devel] [PATCH v5 10/31] vhost: do not assert() on vhost_ops failure

2016-07-21 Thread marcandre . lureau
From: Marc-André Lureau Calling a vhost operation may fail, for example with disconnected vhost-user backend, but qemu shouldn't abort in this case. Log an error instead, except on error and cleanup code paths where it can be mostly ignored. Let's use a VHOST_OPS_DEBUG macro to easily disable t

[Qemu-devel] [PATCH v5 18/31] vhost-user: add get_vhost_net() assertions

2016-07-21 Thread marcandre . lureau
From: Marc-André Lureau Add a few assertions to be more explicit about the runtime behaviour after the previous patch: get_vhost_net() is non-null after net_vhost_user_init(). Signed-off-by: Marc-André Lureau --- hw/net/vhost_net.c | 1 + net/vhost-user.c | 2 ++ 2 files changed, 3 insertion

[Qemu-devel] [PATCH v5 22/31] char: add chr_wait_connected callback

2016-07-21 Thread marcandre . lureau
From: Marc-André Lureau A function to wait on the backend to be connected, to be used in the following patches. Signed-off-by: Marc-André Lureau --- include/sysemu/char.h | 8 qemu-char.c | 9 + 2 files changed, 17 insertions(+) diff --git a/include/sysemu/char.h b/

[Qemu-devel] [PATCH v5 15/31] vhost-user: check qemu_chr_fe_set_msgfds() return value

2016-07-21 Thread marcandre . lureau
From: Marc-André Lureau Check qemu_chr_fe_set_msgfds() for errors, to make sure the message to be sent is correct. Signed-off-by: Marc-André Lureau --- hw/virtio/vhost-user.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/hw/virtio/vhost-user.c b/hw/virtio/vhost-user.c

[Qemu-devel] [PATCH v5 17/31] vhost-user: keep vhost_net after a disconnection

2016-07-21 Thread marcandre . lureau
From: Marc-André Lureau Many code paths assume get_vhost_net() returns non-null. Keep VhostUserState.vhost_net after a successful vhost_net_init(), instead of freeing it in vhost_net_cleanup(). VhostUserState.vhost_net is thus freed before after being recreated or on final vhost_user_cleanup()

[Qemu-devel] [PATCH v5 27/31] tests: add /vhost-user/connect-fail test

2016-07-21 Thread marcandre . lureau
From: Marc-André Lureau Check early connection failure and resume. Signed-off-by: Marc-André Lureau --- tests/vhost-user-test.c | 38 ++ 1 file changed, 38 insertions(+) diff --git a/tests/vhost-user-test.c b/tests/vhost-user-test.c index 27b10c1..abcc3f2 1

[Qemu-devel] [PATCH v5 25/31] tests: plug some leaks in virtio-net-test

2016-07-21 Thread marcandre . lureau
From: Marc-André Lureau Found thanks to valgrind. Signed-off-by: Marc-André Lureau --- tests/virtio-net-test.c | 12 +--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/tests/virtio-net-test.c b/tests/virtio-net-test.c index a34a939..361506f 100644 --- a/tests/virtio-net

[Qemu-devel] [PATCH v5 20/31] vhost-net: vhost_migration_done is vhost-user specific

2016-07-21 Thread marcandre . lureau
From: Marc-André Lureau Either the callback is mandatory to implement, in which case an assert() is more appropriate, or it's not and we can't tell much whether the function should fail or not (given it's name, I guess it should silently success by default). Instead, make the implementation manda

[Qemu-devel] [PATCH v5 19/31] Revert "vhost-net: do not crash if backend is not present"

2016-07-21 Thread marcandre . lureau
From: Marc-André Lureau Now that get_vhost_net() returns non-null after a successful vhost_net_init(), we no longer need to check this case. This reverts commit ecd34898596c60f79886061618dd7e01001113ad. Signed-off-by: Marc-André Lureau --- hw/net/vhost_net.c | 7 +-- 1 file changed, 1 ins

[Qemu-devel] [PATCH v5 21/31] vhost: add assert() to check runtime behaviour

2016-07-21 Thread marcandre . lureau
From: Marc-André Lureau All these functions must be called only after the backend is connected. They are called from virtio-net.c, after either virtio or link status change. The check for nc->peer->link_down should ensure vhost_net_{start,stop}() are always called between vhost_user_{start,stop}

Re: [Qemu-devel] [PATCH for-2.7] fix qemu exit on memory hotplug when allocation fails at prealloc time

2016-07-21 Thread Paolo Bonzini
On 21/07/2016 10:36, Markus Armbruster wrote: > ... have the obvious error_propagate() + return here. Matter of taste, > between you and the maintainer. Except there is none. Inexcusable for > a file created in 2014. Suggest you appoint yourself. For now I've queued the patch, but I suggest

[Qemu-devel] [PATCH v5 29/31] vhost-user: add error report in vhost_user_write()

2016-07-21 Thread marcandre . lureau
From: Marc-André Lureau Similar to vhost_user_read() error report, it is useful to have early error report. Signed-off-by: Marc-André Lureau --- hw/virtio/vhost-user.c | 13 ++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/hw/virtio/vhost-user.c b/hw/virtio/vhost-us

[Qemu-devel] [PATCH v5 23/31] char: add and use tcp_chr_wait_connected

2016-07-21 Thread marcandre . lureau
From: Marc-André Lureau Add a chr_wait_connected for the tcp backend, and use it in the open_socket() function. Signed-off-by: Marc-André Lureau --- qemu-char.c | 63 ++--- 1 file changed, 44 insertions(+), 19 deletions(-) diff --git a/q

[Qemu-devel] [PATCH v5 24/31] vhost-user: wait until backend init is completed

2016-07-21 Thread marcandre . lureau
From: Marc-André Lureau The chardev waits for an initial connection before starting qemu, and vhost-user should wait for the backend negotiation to be completed before starting qemu too. vhost-user is started in the net_vhost_user_event callback, which is synchronously called after the socket is

[Qemu-devel] [PATCH v5 30/31] vhost: add vhost_net_set_backend()

2016-07-21 Thread marcandre . lureau
From: Marc-André Lureau Not all vhost-user backends support ops->vhost_net_set_backend(). It is a nicer to provide an assert/error than to crash trying to call. Furthermore, it improves a bit the code by hiding vhost_ops details. Signed-off-by: Marc-André Lureau --- hw/net/vhost_net.c|

Re: [Qemu-devel] [PATCH] virtio-pci: warn when both legacy and modern modes are disabled

2016-07-21 Thread Greg Kurz
On Thu, 12 May 2016 11:45:58 +0200 Greg Kurz wrote: > Without presuming if we got there because of a user mistake or some > more subtile bug in the tooling, it doesn't hurt to log somewhere that > the device won't be functional. > > Signed-off-by: Greg Kurz > --- Michael, This patch still appl

[Qemu-devel] [PATCH v5 28/31] tests: add a simple /vhost-user/multiqueue test

2016-07-21 Thread marcandre . lureau
From: Marc-André Lureau This test just checks that 2 virtio-net queues can be setup over vhost-user and waits for them to be started. Signed-off-by: Marc-André Lureau --- tests/Makefile.include | 2 +- tests/vhost-user-test.c | 108 +++- 2 files c

Re: [Qemu-devel] [RFC PATCH V8 5/7] qemu-char: Add qemu_chr_add_handlers_full() for GMaincontext

2016-07-21 Thread Daniel P. Berrange
On Thu, Jul 21, 2016 at 04:26:11PM +0800, Zhang Chen wrote: > Add qemu_chr_add_handlers_full() API, we can use > this API pass in a GMainContext,make handler run > in the context rather than main_loop. > This comments from Daniel P . Berrange. > > Cc: Daniel P . Berrange > Cc: Paolo Bonzini > >

[Qemu-devel] [PATCH v5 26/31] tests: fix vhost-user-test leak

2016-07-21 Thread marcandre . lureau
From: Marc-André Lureau Spotted by valgrind. Signed-off-by: Marc-André Lureau --- tests/vhost-user-test.c | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/vhost-user-test.c b/tests/vhost-user-test.c index 46d0588..27b10c1 100644 --- a/tests/vhost-user-test.c +++ b/tests/vhost-user-tes

Re: [Qemu-devel] [PATCH 05/10] tcg: Prepare TB invalidation for lockless TB lookup

2016-07-21 Thread Paolo Bonzini
On 21/07/2016 10:36, Sergey Fedorov wrote: > On 20/07/16 01:27, Paolo Bonzini wrote: >> >> - Original Message - >>> From: "Sergey Fedorov" >>> To: "Paolo Bonzini" , qemu-devel@nongnu.org >>> Cc: "sergey fedorov" , "alex bennee" >>> >>> Sent: Tuesday, July 19, 2016 9:56:49 PM >>> Subjec

Re: [Qemu-devel] [PATCH] qemu-img: fix error messages emitted by img_open()

2016-07-21 Thread Stefan Hajnoczi
On Thu, Jul 21, 2016 at 10:41:53AM +0200, Reda Sallahi wrote: > img_open_file() and img_open_opts() were printing error messages with a > duplicate part because of a wrong use of error_reportf_err() (e.g. > qemu-img: Could not open 'foo': Could not open 'foo': No such file or > directory) > > Thi

Re: [Qemu-devel] Regression: block: Add .bdrv_co_pwrite_zeroes()

2016-07-21 Thread Paolo Bonzini
On 21/07/2016 09:01, Peter Lieven wrote: > > maximum unmap lba count:30720 > maximum unmap block descriptor count:2 > optimal unmap granularity:30720 > ugavalid:1 > unmap granularity alignment:0 > maximum write same length:30720 Uhm, that's weird. The optimal unmap granularity should really be

[Qemu-devel] [PATCH v5 31/31] RFC: vhost: do not update last avail idx on get_vring_base() failure

2016-07-21 Thread marcandre . lureau
From: Marc-André Lureau The state.num value will probably be 0 in this case, but I guess that doesn't make sense to update. Signed-off-by: Marc-André Lureau --- hw/virtio/vhost.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/hw/virtio/vhost.c b/hw/virtio/vhost.c index c

[Qemu-devel] [PATCH] checkpatch: add check for bzero

2016-07-21 Thread Paolo Bonzini
Signed-off-by: Paolo Bonzini --- scripts/checkpatch.pl | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index afa7f79..b7cb4ab 100755 --- a/scripts/checkpatch.pl +++ b/scripts/checkpatch.pl @@ -2544,7 +2544,7 @@ sub process {

Re: [Qemu-devel] [PULL v3 00/55] pc, pci, virtio: new features, cleanups, fixes

2016-07-21 Thread Peter Maydell
On 20 July 2016 at 18:43, Michael S. Tsirkin wrote: > I think that's it feature-wise for 2.7. > > There are still a couple of bugfix patchsets I plan to merge before -rc1: > - vhost-user fixes for backend disconnect > - pxb fixes for 64 bit mmio > and a couple of other bugfixes here and there. > >

[Qemu-devel] [PATCH] hw/ppc/spapr: Make sure to close the htab_fd when migration is canceled

2016-07-21 Thread Thomas Huth
When canceling a migration process, we currently do not close the HTAB migration file descriptor since htab_save_complete() is never called in that case. So we leave the migration process with a dangling htab_fd value around, and this causes any further migration attempts to fail. To fix this issue

Re: [Qemu-devel] Regression: block: Add .bdrv_co_pwrite_zeroes()

2016-07-21 Thread Paolo Bonzini
On 21/07/2016 01:35, Eric Blake wrote: > Also, while the device is advertising that the optimal discard alignment > is 15M, that does not tell me the minimum granularity that it can > actually discard. Can you determine that value? That is, if I try to > discard only 1M, does that actually resu

Re: [Qemu-devel] [RFC PATCH V8 5/7] qemu-char: Add qemu_chr_add_handlers_full() for GMaincontext

2016-07-21 Thread Zhang Chen
On 07/21/2016 05:00 PM, Daniel P. Berrange wrote: On Thu, Jul 21, 2016 at 04:26:11PM +0800, Zhang Chen wrote: Add qemu_chr_add_handlers_full() API, we can use this API pass in a GMainContext,make handler run in the context rather than main_loop. This comments from Daniel P . Berrange. Cc: Dan

Re: [Qemu-devel] [PATCH V3] hw/virtio-pci: fix virtio behaviour

2016-07-21 Thread Marcel Apfelbaum
On 07/21/2016 11:54 AM, Cornelia Huck wrote: On Wed, 20 Jul 2016 18:28:21 +0300 Marcel Apfelbaum wrote: Enable transitional virtio devices by default. Enable virtio-1.0 for devices plugged into PCIe ports (Root ports or Downstream ports). Hi Cornelia, Thank you for the review. Add "by de

Re: [Qemu-devel] [PULL v1 0/2] Merge qcrypto-next 2016/07/20

2016-07-21 Thread Daniel P. Berrange
On Wed, Jul 20, 2016 at 08:31:09PM +0100, Peter Maydell wrote: > On 20 July 2016 at 12:32, Daniel P. Berrange wrote: > > The following changes since commit a3b343772114c8c98986508f3352a631164f913c: > > > > Merge remote-tracking branch 'remotes/bonzini/tags/for-upstream' into > > staging (2016-0

Re: [Qemu-devel] [PATCH v2 1/3] Revert e5dfc5e8e("Move README to markdown")

2016-07-21 Thread Peter Maydell
On 20 July 2016 at 21:31, Pranith Kumar wrote: > checkpatch.pl and other scripts fail without README. Also in dicussions > it was deemed safer to create a symlink, the patch for which follows. > > This reverts commit e5dfc5e8e715c572aea44ac4d96c43941d4741c7. > > Signed-off-by: Pranith Kumar > Rev

[Qemu-devel] [PATCH v2 0/2] usb-mtp: Added support for sending files larger than 4gb

2016-07-21 Thread Isaac Lozano
Added support for sending files larger than 4gb from the host to the guest. The first patch adds support on Linux guests. The second patch is to add support on Windows guests. Windows requires object properties to read the file size from. We have to implement a minimum set of commands and object p

[Qemu-devel] [PATCH v2 1/2] usb-mtp: fix sending files larger than 4gb

2016-07-21 Thread Isaac Lozano
MTP requires that if a file is larger than 4gb or if sending data larger than 4gb, that the length field be set to 0x. Also widened a couple variables to prevent overflow errors. Signed-off-by: Isaac Lozano <109loza...@gmail.com> --- hw/usb/dev-mtp.c | 21 - 1 file ch

Re: [Qemu-devel] [PULL v2 00/25] Block patches

2016-07-21 Thread Stefan Hajnoczi
On Wed, Jul 20, 2016 at 10:03:17PM +0100, Peter Maydell wrote: > On 20 July 2016 at 17:20, Stefan Hajnoczi wrote: > > The following changes since commit 338404d061144956b76f9893ca3434d057dff2d4: > > > > Merge remote-tracking branch > > 'remotes/pmaydell/tags/pull-target-arm-20160719' into stagi

[Qemu-devel] [PATCH v2 2/2] usb-mtp: added object properties

2016-07-21 Thread Isaac Lozano
Windows uses object properties to determine the size of a file, so to add object properties, we must also add a minimum set of new commands and object properties. Most object properties are data that we already have, except for the unique persistant object identifier. Windows doesn't use this prope

[Qemu-devel] [PULL v1 1/3] crypto: use /dev/[u]random as a final fallback random source

2016-07-21 Thread Daniel P. Berrange
If neither gcrypt or gnutls are available to provide a cryptographic random number generator, fallback to consuming bytes directly from /dev/[u]random. Signed-off-by: Daniel P. Berrange --- crypto/Makefile.objs| 2 +- crypto/{random-stub.c => random-platform.c} | 37

[Qemu-devel] [PULL v1 2/3] crypto: use glib as fallback for hash algorithm

2016-07-21 Thread Daniel P. Berrange
GLib >= 2.16 provides GChecksum API which is good enough for md5, sha1, sha256 and sha512. Use this as a final fallback if neither nettle or gcrypt are available. This lets us remove the stub hash impl, and so callers can be sure those 4 algs are always available at compile time. They may still be

Re: [Qemu-devel] [Qemu-ppc] [PATCH] hw/ppc/spapr: Make sure to close the htab_fd when migration is canceled

2016-07-21 Thread Greg Kurz
On Thu, 21 Jul 2016 11:21:34 +0200 Thomas Huth wrote: > When canceling a migration process, we currently do not close the > HTAB migration file descriptor since htab_save_complete() is never > called in that case. So we leave the migration process with a > dangling htab_fd value around, and this

[Qemu-devel] [PATCH] test: port postcopy test to ppc64

2016-07-21 Thread Laurent Vivier
As userfaultfd syscall is available on powerpc, migration postcopy can be used. This patch adds the support needed to test this on powerpc, instead of using a bootsector to run code to modify memory, we use a FORTH script in "boot-command" property. As spapr machine doesn't support "-prom-env" ar

[Qemu-devel] [PULL v1 3/3] crypto: don't open-code qcrypto_hash_supports

2016-07-21 Thread Daniel P. Berrange
Call the existing qcrypto_hash_supports method from qcrypto_hash_bytesv instead of open-coding it again. Signed-off-by: Daniel P. Berrange --- crypto/hash-gcrypt.c | 3 +-- crypto/hash-glib.c | 3 +-- crypto/hash-nettle.c | 3 +-- 3 files changed, 3 insertions(+), 6 deletions(-) diff --git a/

Re: [Qemu-devel] [PATCH] checkpatch: add check for bzero

2016-07-21 Thread Peter Xu
On Thu, Jul 21, 2016 at 11:03:20AM +0200, Paolo Bonzini wrote: > Signed-off-by: Paolo Bonzini Thanks, Paolo. Tested-By: Peter Xu > --- > scripts/checkpatch.pl | 5 - > 1 file changed, 4 insertions(+), 1 deletion(-) > > diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl > index af

[Qemu-devel] [PULL v1 0/3] Merge qcrypto-next 2016/07/21

2016-07-21 Thread Daniel P. Berrange
The following changes since commit e66b05e9ca471715388182613217503160ed7a4d: Merge remote-tracking branch 'remotes/ehabkost/tags/x86-pull-request' into staging (2016-07-20 21:32:56 +0100) are available in the git repository at: git://github.com/berrange/qemu tags/pull-qcrypto-2016-07-21-1

Re: [Qemu-devel] [PATCH] vl: exit if a bad property value is passed to -global

2016-07-21 Thread Greg Kurz
On Wed, 20 Jul 2016 17:18:26 -0300 Eduardo Habkost wrote: > Sorry for the long delay: > > On Thu, Jul 14, 2016 at 10:29:57AM +0200, Igor Mammedov wrote: > > On Thu, 14 Jul 2016 11:42:40 +1000 > > David Gibson wrote: > > > > > On Wed, Jul 13, 2016 at 08:05:03PM +0200, Greg Kurz wrote: > > >

[Qemu-devel] [PATCH] checkpatch: fix break by renaming README

2016-07-21 Thread Peter Xu
Without this, we cannot run checkpatch.pl under QEMU root directory. Signed-off-by: Peter Xu --- scripts/checkpatch.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index afa7f79..8247305 100755 --- a/scripts/checkpatch.pl +++ b

[Qemu-devel] [Bug 955379] Re: cmake hangs with qemu-arm-static

2016-07-21 Thread Peter Maydell
OK, so the behaviour you saw is expected since we didn't fix 32-bit hosts until a bit later; but they should both be fixed now. -- You received this bug notification because you are a member of qemu- devel-ml, which is subscribed to QEMU. https://bugs.launchpad.net/bugs/955379 Title: cmake han

Re: [Qemu-devel] [RFC 5/6] target-ppc: add modulo word operations

2016-07-21 Thread Richard Henderson
On 07/21/2016 01:41 PM, Nikunj A Dadhania wrote: It would probably be better to use helper functions for both div and mod, because of the branches required. C.f. target-arm/helper-a64.c, helper_sdiv64 et al. What is the thumb rule to implement it has helper? As I am implementing other instruct

[Qemu-devel] [PATCH 0/2] qemu-sockets: remove useless functions

2016-07-21 Thread Cao jin
The commit message maybe not so accurate, welcome to the comments. Cc: Daniel P. Berrange Cc: Gerd Hoffmann Cc: Paolo Bonzini Cao jin (2): util/qemu-sockets: shoot inet_nonblocking_connect() util/qemu-sockets: shoot unix_nonblocking_connect() include/qemu/sockets.h | 6 -- util/qemu

[Qemu-devel] [PATCH 2/2] util/qemu-sockets: shoot unix_nonblocking_connect()

2016-07-21 Thread Cao jin
It is never used, and now all connect is nonblocking via inet_connect_addr(). Cc: Daniel P. Berrange Cc: Gerd Hoffmann Cc: Paolo Bonzini Signed-off-by: Cao jin --- include/qemu/sockets.h | 3 --- util/qemu-sockets.c| 16 2 files changed, 19 deletions(-) diff --git a/inc

[Qemu-devel] [PATCH 1/2] util/qemu-sockets: shoot inet_nonblocking_connect()

2016-07-21 Thread Cao jin
It is never used, and now all connect is nonblocking via inet_connect_addr(). Cc: Daniel P. Berrange Cc: Gerd Hoffmann Cc: Paolo Bonzini Signed-off-by: Cao jin --- include/qemu/sockets.h | 3 --- util/qemu-sockets.c| 30 -- 2 files changed, 33 deletions(-) di

Re: [Qemu-devel] [PULL v3 00/55] pc, pci, virtio: new features, cleanups, fixes

2016-07-21 Thread Peter Xu
On Thu, Jul 21, 2016 at 10:20:38AM +0100, Peter Maydell wrote: > On 20 July 2016 at 18:43, Michael S. Tsirkin wrote: > > I think that's it feature-wise for 2.7. > > > > There are still a couple of bugfix patchsets I plan to merge before -rc1: > > - vhost-user fixes for backend disconnect > > - pxb

Re: [Qemu-devel] [PATCH 11/37] tests: fix small leak in test-io-channel-command

2016-07-21 Thread Marc-André Lureau
Hi On Wed, Jul 20, 2016 at 1:16 AM, Marc-André Lureau wrote: > Hi > > - Original Message - >> On 07/19/2016 02:54 AM, marcandre.lur...@redhat.com wrote: >> > From: Marc-André Lureau >> > >> > srcfifo && dstfifo must still be freed in this case. >> > >> > Signed-off-by: Marc-André Lureau

Re: [Qemu-devel] [PULL v3 00/55] pc, pci, virtio: new features, cleanups, fixes

2016-07-21 Thread Peter Maydell
On 21 July 2016 at 11:36, Peter Xu wrote: > On Thu, Jul 21, 2016 at 10:20:38AM +0100, Peter Maydell wrote: >> Fails to build: >> >> /home/petmay01/linaro/qemu-for-merges/hw/i386/intel_iommu.c: In >> function ‘vtd_remap_irq_get’: >> /home/petmay01/linaro/qemu-for-merges/hw/i386/intel_iommu.c:2092:5

Re: [Qemu-devel] [PULL v2 00/25] Block patches

2016-07-21 Thread Peter Maydell
On 21 July 2016 at 10:58, Stefan Hajnoczi wrote: > On Wed, Jul 20, 2016 at 10:03:17PM +0100, Peter Maydell wrote: >> On 20 July 2016 at 17:20, Stefan Hajnoczi wrote: >> > The following changes since commit >> > 338404d061144956b76f9893ca3434d057dff2d4: >> > >> > Merge remote-tracking branch >

Re: [Qemu-devel] [PATCH V3] hw/virtio-pci: fix virtio behaviour

2016-07-21 Thread Cornelia Huck
On Thu, 21 Jul 2016 12:26:03 +0300 Marcel Apfelbaum wrote: > On 07/21/2016 11:54 AM, Cornelia Huck wrote: > > On Wed, 20 Jul 2016 18:28:21 +0300 > > Marcel Apfelbaum wrote: > > > >> Enable transitional virtio devices by default. > >> Enable virtio-1.0 for devices plugged into > >> PCIe ports (Ro

  1   2   3   4   5   >