[Qemu-devel] [PATCH v2] util: remove the obsolete non-blocking connect

2017-06-16 Thread Mao Zhongyi
From: Cao jin The non-blocking connect mechanism is obsolete, and it doesn't work well in inet connection, because it will call getaddrinfo first and getaddrinfo will blocks on DNS lookups. Since commit e65c67e4 & d984464e, the non-blocking connect of migration goes through QIOChannel in a differ

Re: [Qemu-devel] [PATCH v2] util: remove the obsolete non-blocking connect

2017-06-16 Thread Fam Zheng
On Fri, 06/16 15:31, Mao Zhongyi wrote: > From: Cao jin > > The non-blocking connect mechanism is obsolete, and it doesn't > work well in inet connection, because it will call getaddrinfo > first and getaddrinfo will blocks on DNS lookups. Since commit > e65c67e4 & d984464e, the non-blocking conn

Re: [Qemu-devel] [PATCH 0/6] spapr: DRC cleanups (part IV)

2017-06-16 Thread Alexey Kardashevskiy
On 16/06/17 03:10, Laurent Vivier wrote: > On 08/06/2017 07:09, David Gibson wrote: >> This fourth isntallment of cleanups to the DRC code introduces the >> first changes to the fundamental state handling. We change the >> initial states in the reset code and attach code for PCI devices, and >> ar

Re: [Qemu-devel] [PATCH v2 3/6] migration: move global_state.optional out

2017-06-16 Thread Peter Xu
On Tue, Jun 13, 2017 at 08:16:35AM -0300, Eduardo Habkost wrote: > On Tue, Jun 13, 2017 at 11:41:02AM +0800, Peter Xu wrote: > > On Mon, Jun 12, 2017 at 04:18:06PM +0800, Peter Xu wrote: > > > On Fri, Jun 09, 2017 at 10:40:10AM -0300, Eduardo Habkost wrote: > > > > On Fri, Jun 09, 2017 at 11:48:59A

Re: [Qemu-devel] [PATCH 2/2] gen-icount: pass cpu_env as a parameter to gen_* inlines

2017-06-16 Thread Paolo Bonzini
On 16/06/2017 01:04, Emilio G. Cota wrote: > va = dest_gpr(ctx, ra); > if (ctx->tb->cflags & CF_USE_ICOUNT) { > -gen_io_start(); > +gen_io_start(cpu_env); > gen_helper_load_pcc(va, cpu_env); > -gen_io_end()

Re: [Qemu-devel] [PATCH V6 02/10] net/filter-mirror.c: Make filter mirror support vnet support.

2017-06-16 Thread Zhang Chen
On 06/16/2017 10:17 AM, Jason Wang wrote: On 2017年06月15日 16:10, Zhang Chen wrote: On 06/15/2017 12:31 PM, Jason Wang wrote: On 2017年06月14日 16:04, Zhang Chen wrote: On 06/13/2017 05:14 PM, Jason Wang wrote: On 2017年06月12日 17:27, Zhang Chen wrote: +if (nf->direction == NE

Re: [Qemu-devel] [PATCH v2 1/3] migration: postcopy_place_page factoring out

2017-06-16 Thread Peter Xu
On Thu, Jun 15, 2017 at 07:36:13PM +0300, Alexey Perevalov wrote: > Need to mark copied pages as closer as possible to the place where it > tracks down. That will be necessary in futher patch. > > Reviewed-by: Juan Quintela > Signed-off-by: Alexey Perevalov > --- > migration/postcopy-ram.c | 13

Re: [Qemu-devel] [PATCH v2 2/3] migration: introduce qemu_ufd_copy_ioctl helper

2017-06-16 Thread Peter Xu
On Thu, Jun 15, 2017 at 07:36:14PM +0300, Alexey Perevalov wrote: > Just for placing auxilary operations inside helper, > auxilary operations like: track received pages, > notify about copying operation in futher patches. > > Signed-off-by: Alexey Perevalov > --- > migration/postcopy-ram.c | 35

Re: [Qemu-devel] [PATCH v2] target/s390x: Enforce instruction features

2017-06-16 Thread no-reply
Hi, This series seems to have some coding style problems. See output below for more information: Type: series Message-id: 20170616051526.6814-1-...@twiddle.net Subject: [Qemu-devel] [PATCH v2] target/s390x: Enforce instruction features === TEST SCRIPT BEGIN === #!/bin/bash BASE=base n=1 total=$

Re: [Qemu-devel] [virtio-dev] Re: [virtio-dev] Re: [virtio-dev] Re: [PATCH v1] virtio-net: enable configurable tx queue size

2017-06-16 Thread Jason Wang
On 2017年06月16日 11:22, Michael S. Tsirkin wrote: I think the issues can be solved by VIRTIO_F_MAX_CHAIN_SIZE. For now, how about splitting it into two series of patches: 1) enable 1024 tx queue size for vhost-user, to let the users of vhost-user to easily use 1024 queue size. Fine with me. 1)

[Qemu-devel] [PATCH v3] util: remove the obsolete non-blocking connect

2017-06-16 Thread Mao Zhongyi
From: Cao jin The non-blocking connect mechanism is obsolete, and it doesn't work well in inet connection, because it will call getaddrinfo first and getaddrinfo will blocks on DNS lookups. Since commit e65c67e4 & d984464e, the non-blocking connect of migration goes through QIOChannel in a differ

Re: [Qemu-devel] 答复: Re: 答复: Re: [PATCHv2 02/04] colo-compare: Process pactkets in the IOThread ofthe primary

2017-06-16 Thread Stefan Hajnoczi
On Thu, Jun 15, 2017 at 12:23:27PM +0800, Jason Wang wrote: > Paolo, Marc and Stefan: > > We want let chardev front-end run in colo comparing IOThread. This looks not > supported by current chardev frontend API. Any idea/suggestion on how to > achieve this? I'm not very familiar with chardev but

Re: [Qemu-devel] [FIX PATCH] spapr: prevent QEMU crash when CPU realization fails

2017-06-16 Thread David Gibson
On Fri, Jun 16, 2017 at 07:07:53AM +0530, Bharata B Rao wrote: > On Thu, Jun 15, 2017 at 09:32:38AM +0200, Greg Kurz wrote: > > On Thu, 15 Jun 2017 08:22:44 +0530 > > Bharata B Rao wrote: > > > > > ICPState objects were being allocated before CPU thread realization. > > > However commit 9ed656631

Re: [Qemu-devel] [Qemu-block] [PATCH] virtio-blk: trace vdev so devices can be distinguished

2017-06-16 Thread Stefan Hajnoczi
On Wed, Jun 14, 2017 at 10:29:30AM +0100, Stefan Hajnoczi wrote: > It is hard to analyze trace logs with multiple virtio-blk devices > because none of the trace events include the VirtIODevice *vdev. > > This patch adds vdev so it's clear which device a request is associated > with. > > I conside

Re: [Qemu-devel] [PATCH v2 3/3] migration: add bitmap for received page

2017-06-16 Thread Peter Xu
On Thu, Jun 15, 2017 at 07:36:15PM +0300, Alexey Perevalov wrote: [...] > +void init_receivedmap(void) > +{ > +RAMBlock *rb; > + > +RAMBLOCK_FOREACH(rb) { > +unsigned long pages; > +pages = rb->max_length >> TARGET_PAGE_BITS; Nit: I would assert(!rb->receivedmap) before n

Re: [Qemu-devel] [PATCH 1/5] virtio-pci: use ioeventfd even when KVM is disabled

2017-06-16 Thread Stefan Hajnoczi
On Fri, Jun 16, 2017 at 06:26:01AM +0300, Michael S. Tsirkin wrote: > On Thu, Jun 15, 2017 at 05:38:09PM +0100, Stefan Hajnoczi wrote: > > Old kvm.ko versions only supported a tiny number of ioeventfds so > > virtio-pci avoids ioeventfds when kvm_has_many_ioeventfds() returns 0. > > > > Do not che

Re: [Qemu-devel] [Qemu-block] [PATCH] nbd: fix NBD over TLS

2017-06-16 Thread Stefan Hajnoczi
On Thu, Jun 15, 2017 at 09:52:09PM +0200, Paolo Bonzini wrote: > When attaching the NBD QIOChannel to an AioContext, the TLS channel should > be used, not the underlying socket channel. This is because, trivially, > the TLS channel will be the one that we read/write to and thus the one > that will

Re: [Qemu-devel] QEMU issues on SPARC hosts due to more-than-page-alignment requirement for MAP_SHARED|MAP_FIXED...

2017-06-16 Thread John Paul Adrian Glaubitz
Hi Peter! On Thu, Jun 15, 2017 at 07:17:14PM +0100, Peter Maydell wrote: > What's the best way to fix this? As far as I can tell > the restriction applies to any mapping, not just /dev/shm files. > QEMU's assumptions that pagesize is the alignment requirement > seem fairly widespread :-( I sugges

Re: [Qemu-devel] QEMU issues on SPARC hosts due to more-than-page-alignment requirement for MAP_SHARED|MAP_FIXED...

2017-06-16 Thread Peter Maydell
On 15 June 2017 at 20:13, Laszlo Ersek wrote: > If that's not the case, i.e. Linux on SPARC enforces SHMLBA for all > kinds of mmap() -- which I would call a POSIX conformance bug --, I'm pretty sure it does: the intention is to avoid violating h/w cache aliasing constraints so the code enforces

Re: [Qemu-devel] 答复: Re: 答复: Re: [PATCHv2 02/04] colo-compare: Process pactkets in the IOThread ofthe primary

2017-06-16 Thread Stefan Hajnoczi
On Thu, Jun 15, 2017 at 12:23:27PM +0800, Jason Wang wrote: > Paolo, Marc and Stefan: > > We want let chardev front-end run in colo comparing IOThread. This looks not > supported by current chardev frontend API. Any idea/suggestion on how to > achieve this? A follow-up: I just noticed that io/ s

Re: [Qemu-devel] ahci-test failures with 'Failed to get "write" lock'

2017-06-16 Thread Peter Maydell
On 15 June 2017 at 17:16, John Snow wrote: > On 06/15/2017 11:28 AM, Dr. David Alan Gilbert wrote: >> Hi, >> Peter noticed that there were some hangs in the ahci-test; >> I can reproduce them on my laptop as long as the laptop has >> some other load on it (a few md5sum /dev/zero's help). >> >> /

Re: [Qemu-devel] [PATCH] nbd: fix NBD over TLS

2017-06-16 Thread Daniel P. Berrange
On Thu, Jun 15, 2017 at 09:52:09PM +0200, Paolo Bonzini wrote: > When attaching the NBD QIOChannel to an AioContext, the TLS channel should > be used, not the underlying socket channel. This is because, trivially, > the TLS channel will be the one that we read/write to and thus the one > that will

Re: [Qemu-devel] [PATCHv2 3/4] fw_cfg: move qdev_init_nofail() from fw_cfg_init1() to callers

2017-06-16 Thread Mark Cave-Ayland
On 12/06/17 23:50, Laszlo Ersek wrote: > On 06/12/17 23:21, Mark Cave-Ayland wrote: >> When looking to instantiate a TYPE_FW_CFG_MEM or TYPE_FW_CFG_IO device to be >> able to wire it up differently, it is much more convenient for the caller to >> instantiate the device and have the fw_cfg default

Re: [Qemu-devel] [PATCHv2 0/4] fw_cfg: qdev-related tidy-ups

2017-06-16 Thread Mark Cave-Ayland
On 14/06/17 13:38, Paolo Bonzini wrote: > On 12/06/2017 23:21, Mark Cave-Ayland wrote: >> As part of some ongoing sun4u work, I need to be able to wire the fw_cfg >> IO interface to a separate IO space by instantiating the qdev device instead >> of calling fw_cfg_init_io(). This patchset brings FW

Re: [Qemu-devel] [virtio-dev] Re: [virtio-dev] Re: [virtio-dev] Re: [PATCH v1] virtio-net: enable configurable tx queue size

2017-06-16 Thread Wei Wang
On 06/16/2017 04:57 PM, Jason Wang wrote: On 2017年06月16日 11:22, Michael S. Tsirkin wrote: I think the issues can be solved by VIRTIO_F_MAX_CHAIN_SIZE. For now, how about splitting it into two series of patches: 1) enable 1024 tx queue size for vhost-user, to let the users of vhost-user to e

Re: [Qemu-devel] Guest unresponsive after Virtqueue size exceeded error

2017-06-16 Thread Fernando Casas Schössow
Hi Ladi, Thanks a lot for looking into this and replying. I will do my best to rebuild and deploy Alpine's qemu packages with this patch included but not sure its feasible yet. In any case, would it be possible to have this patch included in the next qemu release? The current error message is he

[Qemu-devel] [PATCH v4 1/5] sockets: ensure we can bind to both ipv4 & ipv6 separately

2017-06-16 Thread Daniel P. Berrange
When binding to an IPv6 socket we currently force the IPV6_V6ONLY flag to off. This means that the IPv6 socket will accept both IPv4 & IPv6 sockets when QEMU is launched with something like -vnc :::1 While this is good for that case, it is bad for other cases. For example if an empty hostname i

[Qemu-devel] [PATCH v4 2/5] sockets: don't block IPv4 clients when listening on "::"

2017-06-16 Thread Daniel P. Berrange
When inet_parse() parses the hostname, it is forcing the has_ipv6 && ipv6 flags if the address contains a ":". This means that if the user had set the ipv4=on flag, to try to restrict the listener to just ipv4, an error would not have been raised. eg -incoming tcp:[::]:9000,ipv4 should have r

[Qemu-devel] [PATCH v4 0/5] Fix handling of IPv4/IPv6 dual stack

2017-06-16 Thread Daniel P. Berrange
This is a followup to: v1: https://lists.nongnu.org/archive/html/qemu-devel/2017-04/msg05659.html v2: https://lists.nongnu.org/archive/html/qemu-devel/2017-05/msg04706.html v3: https://lists.gnu.org/archive/html/qemu-devel/2017-06/msg00027.html This was posted as a pull request here: htt

[Qemu-devel] [PATCH v4 3/5] sockets: ensure we don't accept IPv4 clients when IPv4 is disabled

2017-06-16 Thread Daniel P. Berrange
Currently if you disable listening on IPv4 addresses, via the CLI flag ipv4=off, we still mistakenly accept IPv4 clients via the IPv6 listener socket due to IPV6_V6ONLY flag being unset. We must ensure IPV6_V6ONLY is always set if ipv4=off This fixes the following scenarios -incoming tcp::9000

[Qemu-devel] [PATCH v4 4/5] io: preserve ipv4/ipv6 flags when resolving InetSocketAddress

2017-06-16 Thread Daniel P. Berrange
The original InetSocketAddress struct may have has_ipv4 and has_ipv6 fields set, which will control both the ai_family used during DNS resolution, and later use of the V6ONLY flag. Currently the standalone DNS resolver code drops the has_ipv4 & has_ipv6 flags after resolving, which means the later

[Qemu-devel] [PATCH v4 5/5] tests: add functional test validating ipv4/ipv6 address flag handling

2017-06-16 Thread Daniel P. Berrange
The semantics around handling ipv4=on|off & ipv6=on|off are quite subtle to understand in combination with the various hostname addresses and backend types. Introduce a massive test matrix that launches QEMU and validates the ability to connect a client on each protocol as appropriate. The test re

Re: [Qemu-devel] Guest unresponsive after Virtqueue size exceeded error

2017-06-16 Thread Ladi Prosek
On Fri, Jun 16, 2017 at 12:11 PM, Fernando Casas Schössow wrote: > Hi Ladi, > > Thanks a lot for looking into this and replying. > I will do my best to rebuild and deploy Alpine's qemu packages with this > patch included but not sure its feasible yet. > In any case, would it be possible to have th

Re: [Qemu-devel] [PATCH v8 6/9] qcow2: add bdrv_measure() support

2017-06-16 Thread Alberto Garcia
On Wed 14 Jun 2017 05:35:54 PM CEST, Stefan Hajnoczi wrote: > Use qcow2_calc_prealloc_size() to get the required file size. > > Signed-off-by: Stefan Hajnoczi This works fine now :-) Reviewed-by: Alberto Garcia Berto

Re: [Qemu-devel] [PATCH v8 7/9] qemu-img: add measure subcommand

2017-06-16 Thread Alberto Garcia
On Wed 14 Jun 2017 05:35:55 PM CEST, Stefan Hajnoczi wrote: > The measure subcommand calculates the size required by a new image file. > This can be used by users or management tools that need to allocate > space on an LVM volume, SAN LUN, etc before creating or converting an > image file. > > Sugg

Re: [Qemu-devel] [PATCH v8 9/9] iotests: add test 178 for qemu-img measure

2017-06-16 Thread Alberto Garcia
On Wed 14 Jun 2017 05:35:57 PM CEST, Stefan Hajnoczi wrote: > Signed-off-by: Stefan Hajnoczi Reviewed-by: Alberto Garcia Berto

Re: [Qemu-devel] [PATCH v4 0/6] spapr/xics: fix migration of older machine types

2017-06-16 Thread Nikunj A Dadhania
Nikunj A Dadhania writes: > Greg Kurz writes: > >> On Sun, 11 Jun 2017 17:38:42 +0800 >> David Gibson wrote: >> >>> On Fri, Jun 09, 2017 at 05:09:13PM +0200, Greg Kurz wrote: >>> > On Fri, 9 Jun 2017 20:28:32 +1000 >>> > David Gibson wrote: >>> > >>> > > On Fri, Jun 09, 2017 at 11:36:31AM +

[Qemu-devel] [PATCH v2 1/2] virtio-net: enable configurable tx queue size

2017-06-16 Thread Wei Wang
This patch enables the virtio-net tx queue size to be configurable between 256 (the default queue size) and 1024 by the user when the vhost-user backend is used. Currently, the maximum tx queue size for other backends is 512 due to the following limitations: - QEMU backend: the QEMU backend implem

[Qemu-devel] [PATCH v2 2/2] virtio-net: code cleanup

2017-06-16 Thread Wei Wang
Use is_power_of_2(), and remove trailing "." from error_setg(). Signed-off-by: Wei Wang --- hw/net/virtio-net.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/hw/net/virtio-net.c b/hw/net/virtio-net.c index e1a08fd..e4cb5a7 100644 --- a/hw/net/virtio-net.c +++ b/hw/net

Re: [Qemu-devel] [PATCH] Makefile: Move balloon.o, numa.o and bootdevice.o to common-obj-y

2017-06-16 Thread Thomas Huth
On 14.06.2017 13:25, Paolo Bonzini wrote: > > > On 14/06/2017 13:18, Thomas Huth wrote: >> On 08.06.2017 16:18, Thomas Huth wrote: >>> There does not seem to be any target specific code in these files, so >>> we can put them into "common-obj" instead of "obj" to compile them only >>> once for all

[Qemu-devel] [PATCH 0/2] tests/q35-test: add TSEG size checks

2017-06-16 Thread Laszlo Ersek
Paolo suggested that I add test cases for verifying TSEG sizes in qtest (tests/q35-test.c); in particular that I check memory writeability around the low boundary of TSEG. As noted on patch #2, the "/q35/tseg-size/ext/16mb" test depends on the following patch: [PATCH] q35/mch: implement extende

[Qemu-devel] [PATCH 1/2] tests/q35-test: push down qtest_start / qtest_end to test case(s)

2017-06-16 Thread Laszlo Ersek
A test program can start up QEMU several times, with different command lines. For such cases, qtest_start() and qtest_end() are called from within the individual test functions. Examples: "virtio-console-test.c", "numa-test.c", and many others. Cc: "Michael S. Tsirkin" Cc: Gerd Hoffmann Cc: Paol

[Qemu-devel] [PATCH 2/2] tests/q35-test: add TSEG size checks

2017-06-16 Thread Laszlo Ersek
These checks verify that the guest RAM turns from read-write to "blackhole" when crossing the low boundary of the TSEG. Both the standard 1MB/2MB/8MB TSEG sizes and an extended (16MB) TSEG size are tested. Cc: "Michael S. Tsirkin" Cc: Gerd Hoffmann Cc: Paolo Bonzini Suggested-by: Paolo Bonzini

[Qemu-devel] [PATCH] intel_iommu: relax iq tail check on VTD_GCMD_QIE enable

2017-06-16 Thread Ladi Prosek
The VT-d spec (section 6.5.2) prescribes software to zero the Invalidation Queue Tail Register before enabling the VTD_GCMD_QIE Global Command Register bit. Windows Server 2012 R2 and possibly other older Windows versions violate the protocol and set a non-zero queue tail first, which in effect mak

[Qemu-devel] [Bug 1511887] Re: USB device 1.1 not correctly passedthru from Linux host to Windows guest

2017-06-16 Thread Jiri Cejka
In commnet #2 I promised to do test with latest qemu 2.9. I'm back here to report what I've done and what's my findings. 1) I've downloaded newest Qemu 2.9.0 released at Apr 20 2017 from qemu.org website. 2) I've compiled it on fully updated Debian Jessie using following extra parameters: ../con

Re: [Qemu-devel] [PATCH v2 3/3] migration: add bitmap for received page

2017-06-16 Thread Alexey Perevalov
On 06/16/2017 12:06 PM, Peter Xu wrote: On Thu, Jun 15, 2017 at 07:36:15PM +0300, Alexey Perevalov wrote: [...] +void init_receivedmap(void) +{ +RAMBlock *rb; + +RAMBLOCK_FOREACH(rb) { +unsigned long pages; +pages = rb->max_length >> TARGET_PAGE_BITS; Nit: I would asse

[Qemu-devel] [PATCHv3 3/5] fw_cfg: move assert() and linking of fw_cfg device to the machine into instance_init()

2017-06-16 Thread Mark Cave-Ayland
In preparation for calling fw_cfg_init1() during realize rather than during init, move the assert() checking for existing fw_cfg devices and the linking of the device to the machine with object_property_add_child() to a new fw_cfg instance_init() function. This guarantees that we will still assert

[Qemu-devel] [PATCHv3 5/5] fw_cfg: move QOM type defines and fw_cfg types into fw_cfg.h

2017-06-16 Thread Mark Cave-Ayland
This allows the device to be instantiated externally for boards that wish to wire up the fw_cfg device themselves. As part of the process we add typedefs to the structs that were previously missing them. Signed-off-by: Mark Cave-Ayland --- hw/nvram/fw_cfg.c | 56 ---

[Qemu-devel] [PATCHv3 1/5] fw_cfg: don't map the fw_cfg IO ports in fw_cfg_io_realize()

2017-06-16 Thread Mark Cave-Ayland
As indicated by Laszlo it is a QOM bug for the realize() method to actually map the device. Set up the IO regions within fw_cfg_io_realize() and defer the mapping with sysbus_add_io() to the caller, as already done in fw_cfg_init_mem_wide(). This makes the iobase and dma_iobase properties now obso

[Qemu-devel] [PATCHv3 0/5] fw_cfg: qdev-related tidy-ups

2017-06-16 Thread Mark Cave-Ayland
As part of some ongoing sun4u work, I need to be able to wire the fw_cfg IO interface to a separate IO space by instantiating the qdev device instead of calling fw_cfg_init_io(). This patchset brings FW_CFG_IO in line with FW_CFG_MEM and tidies up the realize methods accordingly. Signed-off-by: Ma

[Qemu-devel] [PATCHv3 4/5] fw_cfg: move qdev_init_nofail() from fw_cfg_init1() to callers

2017-06-16 Thread Mark Cave-Ayland
When looking to instantiate a TYPE_FW_CFG_MEM or TYPE_FW_CFG_IO device to be able to wire it up differently, it is much more convenient for the caller to instantiate the device and have the fw_cfg default files already preloaded during realize. Move fw_cfg_init1() to the end of both the fw_cfg_mem

[Qemu-devel] [PATCHv3 2/5] fw_cfg: move setting of FW_CFG_VERSION_DMA bit to fw_cfg_init1()

2017-06-16 Thread Mark Cave-Ayland
The setting of the FW_CFG_VERSION_DMA bit is the same across both the TYPE_FW_CFG_MEM and TYPE_FW_CFG_IO devices, so unify the logic in fw_cfg_init1(). Signed-off-by: Mark Cave-Ayland Reviewed-by: Laszlo Ersek --- hw/nvram/fw_cfg.c | 16 +++- 1 file changed, 7 insertions(+), 9 del

Re: [Qemu-devel] [PATCHv3 0/5] fw_cfg: qdev-related tidy-ups

2017-06-16 Thread no-reply
Hi, This series failed automatic build test. Please find the testing commands and their output below. If you have docker installed, you can probably reproduce it locally. Type: series Subject: [Qemu-devel] [PATCHv3 0/5] fw_cfg: qdev-related tidy-ups Message-id: 1497614651-1017-1-git-send-email-ma

Re: [Qemu-devel] [PATCH] fix: avoid infinite loop when blockjob encountering failure

2017-06-16 Thread Max Reitz
On 2017-06-15 04:38, sochin.jiang wrote: > Thanks for your kindly reply. > > I do have made a mistake that ignoring the AIOContext lock. > > About the patch, firstly, if job->ret comes to be non-zero(also means > job->completed to be true) , blockjob 'callback'(common_block_job_cb) will be > ca

Re: [Qemu-devel] [PATCHv3 0/5] fw_cfg: qdev-related tidy-ups

2017-06-16 Thread Mark Cave-Ayland
On 16/06/17 13:18, no-re...@patchew.org wrote: > In file included from /tmp/qemu-test/src/include/hw/loader.h:5, > from /tmp/qemu-test/src/device_tree.c:27: > /tmp/qemu-test/src/include/hw/nvram/fw_cfg.h:75: error: redefinition of > typedef ‘FWCfgState’ > /tmp/qemu-test/src/inclu

Re: [Qemu-devel] [PATCH] hw/i386: fix nvdimm check error path

2017-06-16 Thread Stefan Hajnoczi
On Fri, Jun 09, 2017 at 04:16:15PM +0100, Stefan Hajnoczi wrote: > Commit e987c37aee1752177906847630d32477da57e705 ("hw/i386: check if > nvdimm is enabled before plugging") introduced a check to reject nvdimm > hotplug if -machine pc,nvdimm=on was not given. > > This check executes after pc_dimm_m

[Qemu-devel] [PATCHv4 3/5] fw_cfg: move assert() and linking of fw_cfg device to the machine into instance_init()

2017-06-16 Thread Mark Cave-Ayland
In preparation for calling fw_cfg_init1() during realize rather than during init, move the assert() checking for existing fw_cfg devices and the linking of the device to the machine with object_property_add_child() to a new fw_cfg instance_init() function. This guarantees that we will still assert

[Qemu-devel] [PATCHv4 4/5] fw_cfg: move qdev_init_nofail() from fw_cfg_init1() to callers

2017-06-16 Thread Mark Cave-Ayland
When looking to instantiate a TYPE_FW_CFG_MEM or TYPE_FW_CFG_IO device to be able to wire it up differently, it is much more convenient for the caller to instantiate the device and have the fw_cfg default files already preloaded during realize. Move fw_cfg_init1() to the end of both the fw_cfg_mem

[Qemu-devel] [PATCHv4 0/5] fw_cfg: qdev-related tidy-ups

2017-06-16 Thread Mark Cave-Ayland
As part of some ongoing sun4u work, I need to be able to wire the fw_cfg IO interface to a separate IO space by instantiating the qdev device instead of calling fw_cfg_init_io(). This patchset brings FW_CFG_IO in line with FW_CFG_MEM and tidies up the realize methods accordingly. Signed-off-by: Ma

[Qemu-devel] [PATCHv4 2/5] fw_cfg: move setting of FW_CFG_VERSION_DMA bit to fw_cfg_init1()

2017-06-16 Thread Mark Cave-Ayland
The setting of the FW_CFG_VERSION_DMA bit is the same across both the TYPE_FW_CFG_MEM and TYPE_FW_CFG_IO devices, so unify the logic in fw_cfg_init1(). Signed-off-by: Mark Cave-Ayland Reviewed-by: Laszlo Ersek --- hw/nvram/fw_cfg.c | 16 +++- 1 file changed, 7 insertions(+), 9 del

[Qemu-devel] [PATCHv4 1/5] fw_cfg: don't map the fw_cfg IO ports in fw_cfg_io_realize()

2017-06-16 Thread Mark Cave-Ayland
As indicated by Laszlo it is a QOM bug for the realize() method to actually map the device. Set up the IO regions within fw_cfg_io_realize() and defer the mapping with sysbus_add_io() to the caller, as already done in fw_cfg_init_mem_wide(). This makes the iobase and dma_iobase properties now obso

Re: [Qemu-devel] [PATCH] fix: avoid an infinite loop or a dangling pointer problem in img_commit

2017-06-16 Thread Max Reitz
On 2017-06-15 08:47, sochin.jiang wrote: > From: "sochin.jiang" > > img_commit could fall into an infinite loop calling run_block_job() if > its blockjob fails on any I/O error, fix this already known problem. > > Signed-off-by: sochin.jiang > --- > blockjob.c | 4 ++-- > includ

[Qemu-devel] [PATCHv4 5/5] fw_cfg: move QOM type defines and fw_cfg types into fw_cfg.h

2017-06-16 Thread Mark Cave-Ayland
This allows the device to be instantiated externally for boards that wish to wire up the fw_cfg device themselves. Signed-off-by: Mark Cave-Ayland --- hw/nvram/fw_cfg.c | 56 --- include/hw/nvram/fw_cfg.h | 58 ++

[Qemu-devel] [PATCH v3 1/7] qcow2: Remove unused Error variable in do_perform_cow()

2017-06-16 Thread Alberto Garcia
We are using the return value of qcow2_encrypt_sectors() to detect problems but we are throwing away the returned Error since we have no way to report it to the user. Therefore we can simply get rid of the local Error variable and pass NULL instead. Alternatively we could try to figure out a way t

[Qemu-devel] [PATCH v3 3/7] qcow2: Make perform_cow() call do_perform_cow() twice

2017-06-16 Thread Alberto Garcia
Instead of calling perform_cow() twice with a different COW region each time, call it just once and make perform_cow() handle both regions. This patch simply moves code around. The next one will do the actual reordering of the COW operations. Signed-off-by: Alberto Garcia Reviewed-by: Eric Blake

[Qemu-devel] [PATCH v3 6/7] qcow2: Pass a QEMUIOVector to do_perform_cow_{read, write}()

2017-06-16 Thread Alberto Garcia
Instead of passing a single buffer pointer to do_perform_cow_write(), pass a QEMUIOVector. This will allow us to merge the write requests for the COW regions and the actual data into a single one. Although do_perform_cow_read() does not strictly need to change its API, we're doing it here as well

[Qemu-devel] [PATCH v3 4/7] qcow2: Split do_perform_cow() into _read(), _encrypt() and _write()

2017-06-16 Thread Alberto Garcia
This patch splits do_perform_cow() into three separate functions to read, encrypt and write the COW regions. perform_cow() can now read both regions first, then encrypt them and finally write them to disk. The memory allocation is also done in this function now, using one single buffer large enoug

[Qemu-devel] [PATCH v3 0/7] Reduce the number of I/O ops when doing COW

2017-06-16 Thread Alberto Garcia
Hi all, here's a patch series that rewrites the copy-on-write code in the qcow2 driver to reduce the number of I/O operations. This is version v3, please refer to the original e-mail for a complete description: https://lists.gnu.org/archive/html/qemu-block/2017-05/msg00882.html Regards, Berto

[Qemu-devel] [PATCH v3 5/7] qcow2: Allow reading both COW regions with only one request

2017-06-16 Thread Alberto Garcia
Reading both COW regions requires two separate requests, but it's perfectly possible to merge them and perform only one. This generally improves performance, particularly on rotating disk drives. The downside is that the data in the middle region is read but discarded. This patch takes a conservat

[Qemu-devel] [PATCH v3 2/7] qcow2: Use unsigned int for both members of Qcow2COWRegion

2017-06-16 Thread Alberto Garcia
Qcow2COWRegion has two attributes: - The offset of the COW region from the start of the first cluster touched by the I/O request. Since it's always going to be positive and the maximum request size is at most INT_MAX, we can use a regular unsigned int to store this offset. - The size of the

[Qemu-devel] [PATCH v3 7/7] qcow2: Merge the writing of the COW regions with the guest data

2017-06-16 Thread Alberto Garcia
If the guest tries to write data that results on the allocation of a new cluster, instead of writing the guest data first and then the data from the COW regions, write everything together using one single I/O operation. This can improve the write performance by 25% or more, depending on several fa

Re: [Qemu-devel] [PATCH] spapr: manage hotplugged devices while the VM is not started

2017-06-16 Thread Igor Mammedov
On Wed, 14 Jun 2017 19:27:12 -0500 Michael Roth wrote: > Quoting Igor Mammedov (2017-06-14 04:00:01) > > On Tue, 13 Jun 2017 16:42:45 -0500 > > Michael Roth wrote: > > > > > Quoting Igor Mammedov (2017-06-09 03:27:33) [...] > > Currently I'd suggest to look into always migrate DRCs if cpu

[Qemu-devel] [PATCH] iotests: Add test for failing qemu-img commit

2017-06-16 Thread Max Reitz
Signed-off-by: Max Reitz --- In order to pass, this depends on "fix: avoid an infinite loop or a dangling pointer problem in img_commit" (http://lists.nongnu.org/archive/html/qemu-block/2017-06/msg00443.html) and on the "block: Don't compare strings in bdrv_reopen_prepare()" series (http://lists.n

Re: [Qemu-devel] [PATCH] hw/i386: fix nvdimm check error path

2017-06-16 Thread Michael S. Tsirkin
On Fri, Jun 16, 2017 at 02:19:56PM +0100, Stefan Hajnoczi wrote: > On Fri, Jun 09, 2017 at 04:16:15PM +0100, Stefan Hajnoczi wrote: > > Commit e987c37aee1752177906847630d32477da57e705 ("hw/i386: check if > > nvdimm is enabled before plugging") introduced a check to reject nvdimm > > hotplug if -mac

Re: [Qemu-devel] [PATCH v6 1/6] Pass generic CPUState to gen_intermediate_code()

2017-06-16 Thread Alex Bennée
Lluís Vilanova writes: > Needed to implement a target-agnostic gen_intermediate_code() in the > future. > > Signed-off-by: Lluís Vilanova > Reviewed-by: David Gibson > Reviewed-by: Richard Henderson ARM bits look good Reviewed-by: Alex Bennée > --- > include/exec/exec-all.h |2

Re: [Qemu-devel] [PATCH 1/5] virtio-pci: use ioeventfd even when KVM is disabled

2017-06-16 Thread Michael S. Tsirkin
On Thu, Jun 15, 2017 at 05:38:09PM +0100, Stefan Hajnoczi wrote: > Old kvm.ko versions only supported a tiny number of ioeventfds so > virtio-pci avoids ioeventfds when kvm_has_many_ioeventfds() returns 0. > > Do not check kvm_has_many_ioeventfds() when KVM is disabled since it > always returns 0.

Re: [Qemu-devel] [PATCH v2 1/2] virtio-net: enable configurable tx queue size

2017-06-16 Thread Michael S. Tsirkin
On Fri, Jun 16, 2017 at 06:48:38PM +0800, Wei Wang wrote: > This patch enables the virtio-net tx queue size to be configurable > between 256 (the default queue size) and 1024 by the user when the > vhost-user backend is used. > > Currently, the maximum tx queue size for other backends is 512 due >

[Qemu-devel] [RFC] virtio-mem: paravirtualized memory

2017-06-16 Thread David Hildenbrand
Hi, this is an idea that is based on Andrea Arcangeli's original idea to host enforce guest access to memory given up using virtio-balloon using userfaultfd in the hypervisor. While looking into the details, I realized that host-enforcing virtio-balloon would result in way too many problems (mainl

Re: [Qemu-devel] [PATCH v2 1/2] virtio-net: enable configurable tx queue size

2017-06-16 Thread Michael S. Tsirkin
On Fri, Jun 16, 2017 at 06:48:38PM +0800, Wei Wang wrote: > This patch enables the virtio-net tx queue size to be configurable > between 256 (the default queue size) and 1024 by the user when the > vhost-user backend is used. > > Currently, the maximum tx queue size for other backends is 512 due >

[Qemu-devel] [PATCH] target-arm: Bug fix in filling the cp_regs hashtable

2017-06-16 Thread Abdallah Bouassida
Check if the CPU supports AARCH64 before adding the 64bit view of the coprocessor's register to the cp_regs hashtable. Signed-off-by: Abdallah Bouassida --- Bug description: if a register has the .state = ARM_CP_STATE_BOTH, its 64bit view will be added to the hashtable even if the CPU is not 6

Re: [Qemu-devel] [PATCH] target-arm: Bug fix in filling the cp_regs hashtable

2017-06-16 Thread Peter Maydell
On 16 June 2017 at 15:42, Abdallah Bouassida wrote: > Check if the CPU supports AARCH64 before adding the 64bit view of > the coprocessor's register to the cp_regs hashtable. > > Signed-off-by: Abdallah Bouassida > --- > Bug description: if a register has the .state = ARM_CP_STATE_BOTH, its 64bi

Re: [Qemu-devel] [PATCH v3 2/2] sockets: Handle race condition between binds to the same port

2017-06-16 Thread Daniel P. Berrange
On Wed, Jun 14, 2017 at 06:53:52PM +0200, Knut Omang wrote: > If an offset of ports is specified to the inet_listen_saddr function(), > and two or more processes tries to bind from these ports at the same time, > occasionally more than one process may be able to bind to the same > port. The conditi

[Qemu-devel] [PATCH v2] live-block-ops.txt: Rename, rewrite, and improve it

2017-06-16 Thread Kashyap Chamarthy
This edition documents (including their QMP invocations) all four operations: - `block-stream` - `block-commit` - `drive-mirror` (& `blockdev-mirror`) - `drive-backup` (& `blockdev-backup`) Things considered while writing this document: - Use reStructuredText as markup language (with t

[Qemu-devel] [PATCH v2 0/7] Poison some more target-specific defines

2017-06-16 Thread Thomas Huth
This series marks some more #defines as poisoned, which are target-specific (declared in config-target.h) and thus must not be used in common code. v2: - First two patches are the same as in v1 - Reworked the CONFIG_KVM patches according to Paolo's review feedback - Added two new patches to fin

[Qemu-devel] [PATCH] live-block-ops.txt: Rename, rewrite, and improve it

2017-06-16 Thread Kashyap Chamarthy
This edition documents (including their QMP invocations) all four operations: - `block-stream` - `block-commit` - `drive-mirror` (& `blockdev-mirror`) - `drive-backup` (& `blockdev-backup`) Things considered while writing this document: - Use reStructuredText as markup language (with t

[Qemu-devel] [PATCH 2/7] include/exec/poison: Mark some CONFIG defines as poisoned, too

2017-06-16 Thread Thomas Huth
These are defined in config-target.h and thus should never be used in common code. Signed-off-by: Thomas Huth --- include/exec/poison.h | 20 1 file changed, 20 insertions(+) diff --git a/include/exec/poison.h b/include/exec/poison.h index 9356d5f..5ffed4d 100644 --- a/incl

Re: [Qemu-devel] [PATCH] spapr: manage hotplugged devices while the VM is not started

2017-06-16 Thread David Gibson
On Fri, Jun 16, 2017 at 03:53:12PM +0200, Igor Mammedov wrote: > On Wed, 14 Jun 2017 19:27:12 -0500 > Michael Roth wrote: > > > Quoting Igor Mammedov (2017-06-14 04:00:01) > > > On Tue, 13 Jun 2017 16:42:45 -0500 > > > Michael Roth wrote: > > > > > > > Quoting Igor Mammedov (2017-06-09 03:27:

[Qemu-devel] [PATCH 5/7] cpu: Introduce a wrapper for tlb_flush() that can be used in common code

2017-06-16 Thread Thomas Huth
Commit 1f5c00cfdb8114c ("qom/cpu: move tlb_flush to cpu_common_reset") moved the call to tlb_flush() from the target-specific reset handlers into the common code qom/cpu.c file, and protected the call with "#ifdef CONFIG_SOFTMMU" to avoid that it is called for linux-user only targets. But since qom

[Qemu-devel] [PATCH 7/7] Makefile: Move bootdevice.o to common-obj-y

2017-06-16 Thread Thomas Huth
There does not seem to be any target specific code in this file, so we can put it into "common-obj" instead of "obj" to compile it only once for all targets. Signed-off-by: Thomas Huth --- Makefile.objs | 2 +- Makefile.target | 2 +- bootdevice.c| 2 +- 3 files changed, 3 insertions(+), 3

Re: [Qemu-devel] [PATCH v4 0/6] spapr/xics: fix migration of older machine types

2017-06-16 Thread David Gibson
On Fri, Jun 16, 2017 at 04:23:38PM +0530, Nikunj A Dadhania wrote: > Nikunj A Dadhania writes: > > > Greg Kurz writes: > > > >> On Sun, 11 Jun 2017 17:38:42 +0800 > >> David Gibson wrote: > >> > >>> On Fri, Jun 09, 2017 at 05:09:13PM +0200, Greg Kurz wrote: > >>> > On Fri, 9 Jun 2017 20:28:32 +

Re: [Qemu-devel] [PATCH v2 3/6] migration: move global_state.optional out

2017-06-16 Thread Eduardo Habkost
On Fri, Jun 16, 2017 at 03:58:20PM +0800, Peter Xu wrote: > On Tue, Jun 13, 2017 at 08:16:35AM -0300, Eduardo Habkost wrote: > > On Tue, Jun 13, 2017 at 11:41:02AM +0800, Peter Xu wrote: > > > On Mon, Jun 12, 2017 at 04:18:06PM +0800, Peter Xu wrote: > > > > On Fri, Jun 09, 2017 at 10:40:10AM -0300

Re: [Qemu-devel] [PATCH] intel_iommu: relax iq tail check on VTD_GCMD_QIE enable

2017-06-16 Thread Michael S. Tsirkin
On Fri, Jun 16, 2017 at 01:44:43PM +0200, Ladi Prosek wrote: > The VT-d spec (section 6.5.2) prescribes software to zero the > Invalidation Queue Tail Register before enabling the VTD_GCMD_QIE > Global Command Register bit. Windows Server 2012 R2 and possibly > other older Windows versions violate

Re: [Qemu-devel] [PATCH v3 1/2] tests: Add test-listen - a stress test for QEMU socket listen

2017-06-16 Thread Daniel P. Berrange
On Wed, Jun 14, 2017 at 06:53:51PM +0200, Knut Omang wrote: > There's a potential race condition between multiple bind()'s > attempting to bind to the same port, which occasionally > allows more than one bind to succeed against the same port. > > When a subsequent listen() call is made with the sa

[Qemu-devel] [PATCH 1/7] include/exec/poison: Add missing TARGET defines

2017-06-16 Thread Thomas Huth
Since we've got some new CPU targets in QEMU during the last months and years, we've got some new TARGET_xxx defines now which should be marked as poisoned for common code. Signed-off-by: Thomas Huth --- include/exec/poison.h | 11 +++ 1 file changed, 11 insertions(+) diff --git a/inclu

[Qemu-devel] [PATCH 4/7] include/exec/poison: Mark CONFIG_KVM as poisoned, too

2017-06-16 Thread Thomas Huth
CONFIG_KVM is only defined for target-specific code, so nobody should use it by accident in common code. To avoid such subtle bugs, CONFIG_KVM is now marked as poisoned in common code. The header include/sysemu/kvm.h is somewhat special since it is included all over the place from common code, too,

[Qemu-devel] [PATCH 3/7] Move CONFIG_KVM related definitions to kvm_i386.h

2017-06-16 Thread Thomas Huth
pc.h and sysemu/kvm.h are also included from common code (where CONFIG_KVM is not available), so the #defines that depend on CONFIG_KVM should not be declared here to avoid that anybody is using them in a wrong way. Since we're also going to poison CONFIG_KVM for common code, let's move them to kvm

Re: [Qemu-devel] [RFC] virtio-mem: paravirtualized memory

2017-06-16 Thread Michael S. Tsirkin
On Fri, Jun 16, 2017 at 04:20:02PM +0200, David Hildenbrand wrote: > Hi, > > this is an idea that is based on Andrea Arcangeli's original idea to > host enforce guest access to memory given up using virtio-balloon using > userfaultfd in the hypervisor. While looking into the details, I > realized

[Qemu-devel] [PATCH 6/7] include/exec/poison: Mark CONFIG_SOFTMMU as poisoned

2017-06-16 Thread Thomas Huth
CONFIG_SOFTMMU should never be used in common code, so mark it as poisoned, too. Signed-off-by: Thomas Huth --- include/exec/poison.h | 1 + include/qom/cpu.h | 8 2 files changed, 9 insertions(+) diff --git a/include/exec/poison.h b/include/exec/poison.h index 540fc70..c932d6f 100

Re: [Qemu-devel] [PATCH v2 0/7] Poison some more target-specific defines

2017-06-16 Thread Paolo Bonzini
On 16/06/2017 16:59, Thomas Huth wrote: > This series marks some more #defines as poisoned, which are > target-specific (declared in config-target.h) and thus must > not be used in common code. > > v2: > - First two patches are the same as in v1 > - Reworked the CONFIG_KVM patches according to P

Re: [Qemu-devel] [virtio-dev] Re: [virtio-dev] Re: [virtio-dev] Re: [PATCH v1] virtio-net: enable configurable tx queue size

2017-06-16 Thread Michael S. Tsirkin
On Fri, Jun 16, 2017 at 06:10:27PM +0800, Wei Wang wrote: > On 06/16/2017 04:57 PM, Jason Wang wrote: > > > > > > On 2017年06月16日 11:22, Michael S. Tsirkin wrote: > > > > I think the issues can be solved by VIRTIO_F_MAX_CHAIN_SIZE. > > > > > > > > For now, how about splitting it into two series o

  1   2   3   >