Re: [Qemu-devel] [PATCH] msi: remove return code for msi_init()

2017-05-31 Thread Peter Xu
On Tue, May 30, 2017 at 04:29:57PM +0200, Paolo Bonzini wrote: > > > On 30/05/2017 16:28, Markus Armbruster wrote: > > Paolo Bonzini writes: > > > >>> Note that a board that doesn't support MSI can take MSI-capable devices > >>> just fine. Only the broken boards can't. > >>> > >>> Obviously, b

Re: [Qemu-devel] [RFC v4 1/5] hw/arm/smmu-common: smmu base class

2017-05-31 Thread Auger Eric
Hi Peter, On 30/05/2017 17:56, Peter Maydell wrote: > On 13 May 2017 at 18:43, Eric Auger wrote: >> Introduces the base device and class for the ARM smmu. >> Implements VMSAv8-64 table lookup and translation. VMSAv8-32 >> is not yet implemented. >> >> For VFIO integration we will need to notify m

[Qemu-devel] [PATCH] pci: Fix unreasonable return value check

2017-05-31 Thread Mao Zhongyi
The return value of pci_add_capability2() is only 2 cases, positive on success, nagetive on failure and set error message to Error. In other worlds, If Error is filled, the return value must be nagetive. There is no case where errp is set but the return value is a positive. But pci_add_capability()

Re: [Qemu-devel] [RFC v4 2/5] hw/arm/smmuv3: smmuv3 emulation model

2017-05-31 Thread Auger Eric
Hi Peter, On 30/05/2017 18:01, Peter Maydell wrote: > On 13 May 2017 at 18:43, Eric Auger wrote: >> From: Prem Mallappa >> >> Introduces the SMMUv3 derived model. This is based on >> System MMUv3 specification (v17). >> >> Signed-off-by: Prem Mallappa >> Signed-off-by: Eric Auger >> >> --- >> v

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

2017-05-31 Thread Laurent Vivier
On 31/05/2017 06:35, David Gibson wrote: > On Tue, May 30, 2017 at 06:04:45PM +0200, Laurent Vivier wrote: >> For QEMU, a hotlugged device is a device added using the HMP/QMP >> interface. >> For SPAPR, a hotplugged device is a device added while the >> machine is running. In this case QEMU doesn't

Re: [Qemu-devel] [RFC v4 4/5] hw/arm/virt: Add 2.10 machine type

2017-05-31 Thread Auger Eric
Hi Peter, On 30/05/2017 18:04, Peter Maydell wrote: > On 13 May 2017 at 18:43, Eric Auger wrote: >> The new machine type allows smmuv3 instantiation. A new option >> is introduced to turn the feature on/off (off by default). > > Should we go for default-on, or would that break guests? > For othe

Re: [Qemu-devel] [RFC v4 0/5] ARM SMMUv3 Emulation Support

2017-05-31 Thread Auger Eric
Hi Peter, On 30/05/2017 18:09, Peter Maydell wrote: > On 13 May 2017 at 18:43, Eric Auger wrote: >> This series introduces the emulation code for ARM SMMUv3. >> This is the continuation of Prem's work [1]. >> >> This v4 is yet another visibility step as many restrictions apply >> to the model at

Re: [Qemu-devel] [PATCH RFC 4/6] migration: shut src return path unconditionally

2017-05-31 Thread Peter Xu
On Tue, May 30, 2017 at 05:50:27PM +0200, Juan Quintela wrote: > Peter Xu wrote: > > We were do the shutting off only for postcopy. Now we do this as long as > > the source return path is there. > > > > Moving the cleanup of from_src_file there too. > > > > Signed-off-by: Peter Xu > > --- > > mi

Re: [Qemu-devel] [PATCH RFC 5/6] migration: let MigrationState be an QObject

2017-05-31 Thread Peter Xu
On Tue, May 30, 2017 at 05:57:44PM +0200, Juan Quintela wrote: > Peter Xu wrote: > > Let the old man "MigrationState" join the object family. Direct benefit > > is that we can start to use all the property features derived from > > current QObject, like: HW_COMPAT_* bits, command line setup for >

Re: [Qemu-devel] [PATCH RFC 4/6] migration: shut src return path unconditionally

2017-05-31 Thread Juan Quintela
Peter Xu wrote: > On Tue, May 30, 2017 at 05:50:27PM +0200, Juan Quintela wrote: >> Peter Xu wrote: >> > We were do the shutting off only for postcopy. Now we do this as long as >> > the source return path is there. >> > >> > Moving the cleanup of from_src_file there too. >> > >> > Signed-off-by:

Re: [Qemu-devel] [PATCH 07/17] json: learn to parse uint64 numbers

2017-05-31 Thread Marc-André Lureau
Hi On Tue, May 30, 2017 at 6:22 PM Eric Blake wrote: > On 05/30/2017 06:35 AM, Marc-André Lureau wrote: > > Hi > > > > On Mon, May 15, 2017 at 6:00 PM Markus Armbruster > wrote: > > > >> Marc-André Lureau writes: > >> > >>> Switch strtoll() usage to qemu_strtoi64() helper while at it. > >>> >

Re: [Qemu-devel] [PATCH RFC 6/6] migration: enable return path for precopy

2017-05-31 Thread Peter Xu
On Tue, May 30, 2017 at 05:59:10PM +0200, Juan Quintela wrote: > Peter Xu wrote: > > Let this be a flag, default to on. Turn it off for <=2.9 versions. > > > > After this patch, return path will be on even for pre-copy migration as > > long as the transport support, e.g., for socket typed transpor

Re: [Qemu-devel] [PATCH] msi: remove return code for msi_init()

2017-05-31 Thread Paolo Bonzini
> > >>I'd prefer to remove msi_nonbroken completely if we don't > > >> know where the problem is. > > > > > > So you're proposing to (1) remove msi_nonbroken, (2) see which boards > > > burst into flames, and (3) fix them, or perhaps add a less wrong stop > > > gap msi_broken just for

Re: [Qemu-devel] [PATCH RFC 6/6] migration: enable return path for precopy

2017-05-31 Thread Juan Quintela
Peter Xu wrote: > On Tue, May 30, 2017 at 05:59:10PM +0200, Juan Quintela wrote: >> Peter Xu wrote: >> > Let this be a flag, default to on. Turn it off for <=2.9 versions. >> > >> > After this patch, return path will be on even for pre-copy migration as >> > long as the transport support, e.g., f

Re: [Qemu-devel] [PATCH v2 6/6] new script/analyse-tlb-flushes-simpletrace.py

2017-05-31 Thread Alex Bennée
Pranith Kumar writes: > Hi Alex, > > Please find some comments and questions below: > > On Wed, May 17, 2017 at 10:52 AM, Alex Bennée wrote: >> This is a simple helper script to extract TLB flush stats from the a >> simpletrace file and plot the results. >> >> Signed-off-by: Alex Bennée >> >>

[Qemu-devel] [PATCH v2] alpha-user: wire epoll_create, epoll_ctl, epoll_wait

2017-05-31 Thread Sergei Trofimovich
Noticed when ran GHC on alpha: $ qemu-alpha -L /usr/alpha-unknown-linux-gnu/ /tmp/a qemu: Unsupported syscall: 407 linux-user/syscall.c does have 'epoll_create' wiring, but under nondeprecated name. Instead of defining both TARGET_NR_sys_epoll_create and TARGET_NR_epoll_create I'v

Re: [Qemu-devel] [PATCH RFC 6/6] migration: enable return path for precopy

2017-05-31 Thread Peter Xu
On Wed, May 31, 2017 at 09:43:21AM +0200, Juan Quintela wrote: > Peter Xu wrote: > > On Tue, May 30, 2017 at 05:59:10PM +0200, Juan Quintela wrote: > >> Peter Xu wrote: > >> > Let this be a flag, default to on. Turn it off for <=2.9 versions. > >> > > >> > After this patch, return path will be on

Re: [Qemu-devel] [PATCH RFC 6/6] migration: enable return path for precopy

2017-05-31 Thread Juan Quintela
Peter Xu wrote: ... >> > Here what I wanted to achieve is that: >> > >> > a. for postcopy, we should try to enable return path, and it must >> >succeed >> > >> > b. for the case when enable_return_path is set, we try to enable return >> >path, but even if it failed, we can still continue

Re: [Qemu-devel] KVM call for 2017-06-06

2017-05-31 Thread Juan Quintela
Juan Quintela wrote: > Hi Hi folks Gentle reminder that call is on next Tuesday and there are still no agenda. Later, Juan. > Please, send any topic that you are interested in covering. > > At the end of Monday I will send an email with the agenda or the > cancellation of the call, so hurry up

Re: [Qemu-devel] [PATCH] msi: remove return code for msi_init()

2017-05-31 Thread Peter Xu
On Wed, May 31, 2017 at 03:40:14AM -0400, Paolo Bonzini wrote: > > > > >>I'd prefer to remove msi_nonbroken completely if we don't > > > >> know where the problem is. > > > > > > > > So you're proposing to (1) remove msi_nonbroken, (2) see which boards > > > > burst into flames, and (

Re: [Qemu-devel] [PATCH] msi: remove return code for msi_init()

2017-05-31 Thread Paolo Bonzini
> Ok before I move on let's see whether this is what we want... > > - firstly, find all machine types: > > pxdev:qemu [edu-fix]# grep -R ".parent = TYPE_MACHINE" * | wc > 49 1962269 > > so now we have 49 kinds of machines. > > - rename msi_nonbroken into msi_broken, then: > >

Re: [Qemu-devel] [PATCH v2] alpha-user: wire epoll_create, epoll_ctl, epoll_wait

2017-05-31 Thread no-reply
Hi, This series seems to have some coding style problems. See output below for more information: Type: series Message-id: 20170531075814.4851-1-sly...@gentoo.org Subject: [Qemu-devel] [PATCH v2] alpha-user: wire epoll_create, epoll_ctl, epoll_wait === TEST SCRIPT BEGIN === #!/bin/bash BASE=bas

Re: [Qemu-devel] [PATCH v2 0/6] vhost-user: Specify and implement device IOTLB support

2017-05-31 Thread Jason Wang
On 2017年05月31日 02:20, Michael S. Tsirkin wrote: On Fri, May 26, 2017 at 04:28:52PM +0200, Maxime Coquelin wrote: This series aims at specifying ans implementing the protocol update required to support device IOTLB with user backends. In this second non-RFC version, main changes are: - spec

Re: [Qemu-devel] [PATCH v2 3/6] vhost: extend ring information update for IOTLB to all rings

2017-05-31 Thread Jason Wang
On 2017年05月31日 02:12, Michael S. Tsirkin wrote: On Fri, May 26, 2017 at 04:28:55PM +0200, Maxime Coquelin wrote: Vhost-kernel backend need needs to receive IOTLB entry for used ring information early, which is done by triggering a miss event on its address. This patch extends this behaviou

Re: [Qemu-devel] [PATCH v2 0/3] hw/arm/exynos: QOM-ify the SoC

2017-05-31 Thread Krzysztof Kozlowski
On Tue, May 30, 2017 at 3:00 PM, Peter Maydell wrote: > On 30 May 2017 at 13:07, Peter Maydell wrote: >> On 7 May 2017 at 19:19, Krzysztof Kozlowski wrote: >>> Hi, >>> >>> Changes since v1: >>> = >>> 1. s/RAM/DRAM/ in commit msg of first patch (as suggested by Philippe). >>> 2. A

Re: [Qemu-devel] [PATCH v3 7/7] numa: cpu: calculate/set default node-ids after all -numa CLI options are parsed

2017-05-31 Thread Igor Mammedov
On Tue, 30 May 2017 17:03:32 -0300 Eduardo Habkost wrote: > On Tue, May 30, 2017 at 06:24:02PM +0200, Igor Mammedov wrote: [...] > > diff --git a/include/hw/boards.h b/include/hw/boards.h > > index 76ce021..063f329 100644 > > --- a/include/hw/boards.h > > +++ b/include/hw/boards.h > > @@ -94,6 +9

Re: [Qemu-devel] [PATCH] msi: remove return code for msi_init()

2017-05-31 Thread Peter Xu
On Wed, May 31, 2017 at 04:28:47AM -0400, Paolo Bonzini wrote: > > > Ok before I move on let's see whether this is what we want... > > > > - firstly, find all machine types: > > > > pxdev:qemu [edu-fix]# grep -R ".parent = TYPE_MACHINE" * | wc > > 49 1962269 > > > > so now we h

Re: [Qemu-devel] Commit b2a575a1c652 broke i486 support.

2017-05-31 Thread Thomas Huth
On 30.05.2017 21:05, Rob Landley wrote: > On 05/29/2017 05:14 AM, Richard W.M. Jones wrote: >> I see in the disassembly use of cmovne (new in Pentium Pro) and >> bswap (new in 486). >> [http://cse.unl.edu/~goddard/Courses/CSCE351/IntelArchitecture/InstructionSetSummary.pdf] >> >> The cmovne instruc

Re: [Qemu-devel] [PATCH v3 00/11] hw: arm: exynos: Bring up secondary CPU, QOM-ify Soc, other improvements

2017-05-31 Thread Krzysztof Kozlowski
On Tue, May 30, 2017 at 2:04 PM, Peter Maydell wrote: > On 21 May 2017 at 16:29, Krzysztof Kozlowski wrote: >> This is a collection of three already sent patchsets [1] [2] [3]. >> >> >> Changes since previous versions (v2): >> 1. Patch 11/11: set BIT(8) in PS_HOLD to fix power off on Linux v4.12-

Re: [Qemu-devel] [PATCHv4 0/5] Clean up compatibility mode handling

2017-05-31 Thread Greg Kurz
On Wed, 31 May 2017 12:57:48 +1000 David Gibson wrote: > [...] > > All old non-pseries machine types already complain when started with > > a POWER7 or newer CPU. Providing the extra error message looks weird: > > > > qemu-system-ppc64 -machine ppce500 \ > > -cpu POWER7,compat=p

Re: [Qemu-devel] [Qemu-block] [PATCH v2 4/4] qemu-iotests: Block migration test

2017-05-31 Thread Kevin Wolf
Am 30.05.2017 um 20:48 hat Jeff Cody geschrieben: > On Tue, May 30, 2017 at 06:57:05PM +0200, Kevin Wolf wrote: > > Seems you are right, but I fail to see why the other formats shouldn't > > work? Are these just bugs or do I make any assumption in the test script > > that is invalid for other image

Re: [Qemu-devel] [Qemu-ppc] [PULL 11/18] pseries: Split CAS PVR negotiation out into a separate function

2017-05-31 Thread Greg Kurz
On Wed, 31 May 2017 16:33:21 +1000 David Gibson wrote: > On Mon, May 29, 2017 at 11:14:08PM +0200, Greg Kurz wrote: > > On Thu, 25 May 2017 13:51:25 +1000 > > David Gibson wrote: > > > > > Guests of the qemu machine type go through a feature negotiation process > > > known as "client architec

Re: [Qemu-devel] Commit b2a575a1c652 broke i486 support.

2017-05-31 Thread Richard W.M. Jones
On Tue, May 30, 2017 at 02:05:15PM -0500, Rob Landley wrote: > On 05/29/2017 05:14 AM, Richard W.M. Jones wrote: > > I see in the disassembly use of cmovne (new in Pentium Pro) and > > bswap (new in 486). > > [http://cse.unl.edu/~goddard/Courses/CSCE351/IntelArchitecture/InstructionSetSummary.pdf]

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

2017-05-31 Thread Igor Mammedov
On Wed, 31 May 2017 14:35:57 +1000 David Gibson wrote: > On Tue, May 30, 2017 at 06:04:45PM +0200, Laurent Vivier wrote: > > For QEMU, a hotlugged device is a device added using the HMP/QMP > > interface. > > For SPAPR, a hotplugged device is a device added while the > > machine is running. In th

[Qemu-devel] [PULL 2/5] migration: keep bytes_xfer_prev init'd to zero

2017-05-31 Thread Juan Quintela
From: Felipe Franciosi The first time migration_bitmap_sync() is called, bytes_xfer_prev is set to ram_state.bytes_transferred which is, at this point, zero. The next time migration_bitmap_sync() is called, an iteration has happened and bytes_xfer_prev is set to 'x' bytes. Most likely, more than

[Qemu-devel] [PULL 0/5] Migration pull request

2017-05-31 Thread Juan Quintela
2017-05-30 14:15:15 +0100) are available in the git repository at: git://github.com/juanquintela/qemu.git tags/migration/20170531 for you to fetch changes up to b4a3c64b16856a018869bfd4a9ed3b2a74554541: migration: use dirty_rate_high_cnt more aggressively (2017-05-31 09:39

[Qemu-devel] [PULL 5/5] migration: use dirty_rate_high_cnt more aggressively

2017-05-31 Thread Juan Quintela
From: Felipe Franciosi The commit message from 070afca25 suggests that dirty_rate_high_cnt should be used more aggressively to start throttling after two iterations instead of four. The code, however, only changes the auto convergence behaviour to throttle after three iterations. This makes the b

[Qemu-devel] [PULL 3/5] migration: set dirty_pages_rate before autoconverge logic

2017-05-31 Thread Juan Quintela
From: Felipe Franciosi Currently, a "period" in the RAM migration logic is at least a second long and accounts for what happened since the last period (or the beginning of the migration). The dirty_pages_rate counter is calculated at the end this logic. If the auto convergence capability is enab

[Qemu-devel] [PATCH v3 2/3] migration: loadvm handlers are not used

2017-05-31 Thread Juan Quintela
So we remove all traces of them. Signed-off-by: Juan Quintela Reviewed-by: Laurent Vivier Reviewed-by: Peter Xu --- include/migration/migration.h | 5 - include/migration/vmstate.h | 2 -- include/qemu/typedefs.h | 1 - migration/migration.c | 2 -- migration/savevm.c

[Qemu-devel] [PULL 4/5] migration: set bytes_xfer_* outside of autoconverge logic

2017-05-31 Thread Juan Quintela
From: Felipe Franciosi The bytes_xfer_now/prev counters are only used by the auto convergence logic. However, they are used alongside the dirty_pages_rate counter, which is calculated (and required) outside of this logic. The problem with this approach is that if the auto convergence capability i

[Qemu-devel] [PULL 1/5] migration: Create savevm.h for functions exported from savevm.c

2017-05-31 Thread Juan Quintela
This removes last trace of migration functions from sysemu/sysemu.h. Signed-off-by: Juan Quintela Reviewed-by: Laurent Vivier --- include/sysemu/sysemu.h | 47 --- migration/colo.c | 1 + migration/migration.c| 1 + migration/postcopy-r

[Qemu-devel] [PATCH v3 0/3] Remove of loadvm handlers

2017-05-31 Thread Juan Quintela
Hi Changes from v2 - also store load_section_id (dave found the problem) I think that we can remove it now, at least. Thanks, Juan. [v2] - store load_version_id field to SaveStateHandler - Adjust everything to use it Thanks to Laurent to point that to me. [v1] We just have a loadvm handlers t

[Qemu-devel] [PATCH v3 1/3] migration: Use savevm_handlers instead of loadvm copy

2017-05-31 Thread Juan Quintela
There is no reason for having the loadvm_handlers at all. There is only one use, and we can use the savevm handlers. We will remove the loadvm handlers on a following patch. Signed-off-by: Juan Quintela Reviewed-by: Laurent Vivier Reviewed-by: Peter Xu -- - Added load_version_id: version_id

[Qemu-devel] [PATCH v3 3/3] migration: Remove section_id parameter from vmstate_load

2017-05-31 Thread Juan Quintela
Everything else assumes that we always load a device from its own savevm handler. Signed-off-by: Juan Quintela Reviewed-by: Laurent Vivier Reviewed-by: Peter Xu --- migration/savevm.c | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/migration/savevm.c b/migration/

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

2017-05-31 Thread Laurent Vivier
For QEMU, a hotlugged device is a device added using the HMP/QMP interface. For SPAPR, a hotplugged device is a device added while the machine is running. In this case QEMU doesn't update internal state but relies on the OS for this part In the case of migration, when we (libvirt) hotplug a device

Re: [Qemu-devel] [PATCH] kvm: don't register smram_listener when smm is off

2017-05-31 Thread Gonglei (Arei)
Soft ping... :) Regards, -Gonglei > -Original Message- > From: Gonglei (Arei) > Sent: Saturday, May 27, 2017 2:10 PM > To: qemu-devel@nongnu.org > Cc: pbonz...@redhat.com; Yechuan; Gonglei (Arei) > Subject: [PATCH] kvm: don't register smram_listener when smm is off > > If the user set

Re: [Qemu-devel] [Qemu-block] [PATCH v2 06/16] backup: Request BLK_PERM_AIO_CONTEXT_CHANGE on target

2017-05-31 Thread Stefan Hajnoczi
On Wed, May 24, 2017 at 10:18:44AM +0800, Fam Zheng wrote: > On Thu, 05/11 15:41, Stefan Hajnoczi wrote: > > On Wed, Apr 19, 2017 at 05:43:46PM +0800, Fam Zheng wrote: > > > What's done in the source's context change notifier is moving the > > > target's context to follow the new one, so we request

Re: [Qemu-devel] [Qemu-block] [PATCH v3 02/16] block-backend: Add blk_request_perm

2017-05-31 Thread Stefan Hajnoczi
On Wed, May 24, 2017 at 10:52:21AM +0800, Fam Zheng wrote: > This function tries to request, if not granted yet, for the given > permissions. > > Signed-off-by: Fam Zheng > --- > block/block-backend.c | 12 > include/sysemu/block-backend.h | 1 + > 2 files changed, 13 inse

[Qemu-devel] [PATCH v2 0/2] Edu leak fix series

2017-05-31 Thread Peter Xu
A whitelist for it does not really makes sense. Let's remove it and then we can introduce a blacklist when really needed, with msi_broken. That's patch 1. Then, I let the msi_init() always success in patch 2, along with it I removed caller checks around it. The goal of this series is to fix the e

[Qemu-devel] [PATCH v2 1/2] msi: remove msi_nonbroken

2017-05-31 Thread Peter Xu
It was used before to know whether specific board has correct emulation support on MSI, and originally we set this to true when the board is not buggy with MSI. That's not really what we should do. For broken emulated boards, we should either blacklist it (using something like msi_broken, when re

[Qemu-devel] [RFC PATCH 00/11] Block layer thread-safety, part 2

2017-05-31 Thread Paolo Bonzini
This part takes care of drivers and devices, making sure that they can accept concurrent I/O from multiple AioContext. Only RFC for now because it depends on Kevin's QED conversion to coroutines, which is still in flux. The following drivers are thread-safe without using any QemuMutex/CoMutex: cr

[Qemu-devel] [PATCH 02/11] coroutine-lock: add qemu_co_rwlock_downgrade and qemu_co_rwlock_upgrade

2017-05-31 Thread Paolo Bonzini
These functions are more efficient in the presence of contention. qemu_co_rwlock_downgrade also guarantees not to block, which may be useful in some algorithms too. Signed-off-by: Paolo Bonzini --- include/qemu/coroutine.h | 19 +++ util/qemu-coroutine-lock.c | 35 +

[Qemu-devel] [PATCH v2 2/2] msi: remove return code for msi_init()

2017-05-31 Thread Peter Xu
Ok now we only has one possible failure in msi_init(), which is pci_add_capability2(). However if that fails, it should really be a programming error. Assertion suites. Then, *errp is useless. Removing it altogether. Since msi_init() won't fail now after that, touch up all the callers to avoid che

[Qemu-devel] [PATCH 06/11] nbd: make it thread-safe

2017-05-31 Thread Paolo Bonzini
Signed-off-by: Paolo Bonzini --- block/nbd-client.c | 30 +- 1 file changed, 9 insertions(+), 21 deletions(-) diff --git a/block/nbd-client.c b/block/nbd-client.c index 1e2952fdae..43e0292ac1 100644 --- a/block/nbd-client.c +++ b/block/nbd-client.c @@ -114,6 +114,10 @

[Qemu-devel] [PATCH 01/11] qcow2: call CoQueue APIs under CoMutex

2017-05-31 Thread Paolo Bonzini
Signed-off-by: Paolo Bonzini --- block/qcow2.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/block/qcow2.c b/block/qcow2.c index 1c2697732b..c9193603b9 100644 --- a/block/qcow2.c +++ b/block/qcow2.c @@ -1696,8 +1696,6 @@ static coroutine_fn int qcow2_co_pwritev(BlockDriv

[Qemu-devel] [PATCH 07/11] qed: move tail of qed_aio_write_main to qed_aio_write_{cow, alloc}

2017-05-31 Thread Paolo Bonzini
This part is never called for in-place writes, move it away to avoid the "backwards" coding style typical of callback-based code. Signed-off-by: Paolo Bonzini --- block/qed.c | 68 - 1 file changed, 31 insertions(+), 37 deletions(-) di

Re: [Qemu-devel] [Qemu-block] [PATCH v3 10/16] mirror: Do initial aio context move of target via BB interface

2017-05-31 Thread Stefan Hajnoczi
On Wed, May 24, 2017 at 10:52:29AM +0800, Fam Zheng wrote: > While blockdev-backup tried to verify before moving target's aio context, the > same is missing for blockdev-mirror. Now that we have the right interface, fix > this as well. > > As a bonus, the aio context move is now conditional, which

[Qemu-devel] [PATCH 05/11] vvfat: make it thread-safe

2017-05-31 Thread Paolo Bonzini
Signed-off-by: Paolo Bonzini --- block/vvfat.c | 8 +++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/block/vvfat.c b/block/vvfat.c index 9c82371360..457b73a35c 100644 --- a/block/vvfat.c +++ b/block/vvfat.c @@ -2983,8 +2983,14 @@ static int coroutine_fn write_target_commit(B

[Qemu-devel] [PATCH 11/11] ssh: support I/O from any AioContext

2017-05-31 Thread Paolo Bonzini
The coroutine may run in a different AioContext, causing the fd handler to busy wait. Fix this by resetting the handler in restart_coroutine, before the coroutine is restarted. Signed-off-by: Paolo Bonzini --- block/ssh.c | 24 +--- 1 file changed, 17 insertions(+), 7 deleti

[Qemu-devel] [PATCH 03/11] vdi: make it thread-safe

2017-05-31 Thread Paolo Bonzini
The VirtualBox driver is using a mutex to order all allocating writes, but it is not protecting accesses to the bitmap because they implicitly happen under the AioContext mutex. Change this to use a CoRwlock explicitly. Signed-off-by: Paolo Bonzini --- block/vdi.c | 48 -

[Qemu-devel] [PATCH 09/11] qed: protect table cache with CoMutex

2017-05-31 Thread Paolo Bonzini
This makes the driver thread-safe. The CoMutex is dropped temporarily while accessing the data clusters or the backing file. Signed-off-by: Paolo Bonzini --- block/qed-cluster.c | 4 +- block/qed-l2-cache.c | 6 +++ block/qed-table.c| 24 +++--- block/qed.c | 131

[Qemu-devel] [PATCH 04/11] vpc: make it thread-safe

2017-05-31 Thread Paolo Bonzini
Signed-off-by: Paolo Bonzini --- block/vpc.c | 20 ++-- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/block/vpc.c b/block/vpc.c index ecfee77149..d61754d4d5 100644 --- a/block/vpc.c +++ b/block/vpc.c @@ -496,12 +496,6 @@ static inline int64_t get_image_offset(Blo

Re: [Qemu-devel] [Qemu-block] [PATCH v3 00/16] block: Protect AIO context change with perm API

2017-05-31 Thread Stefan Hajnoczi
On Wed, May 24, 2017 at 10:52:19AM +0800, Fam Zheng wrote: > v3: Move blk_set_aio_context to the front of mirror_start_job to avoid > accessing target without acquiring its aio context. [Stefan] > Use error_free_or_abort in test code. [Stefan] Please include my Reviewed-bys from the previo

[Qemu-devel] [PATCH v3 2/4] migration: Inactivate images after .save_live_complete_precopy()

2017-05-31 Thread Kevin Wolf
Block migration may still access the image during its .save_live_complete_precopy() implementation, so we should only inactivate the image afterwards. Another reason for the change is that inactivating an image fails when there is still a non-device BlockBackend using it, which includes the BBs us

Re: [Qemu-devel] [PATCH RFC 3/6] migration: fix leak of src file on dst

2017-05-31 Thread Juan Quintela
Peter Xu wrote: > The return path channel is possibly leaked. Fix it. > > Signed-off-by: Peter Xu > --- > migration/migration.c | 5 + > 1 file changed, 5 insertions(+) > Queued this one. Reviewed-by: Juan Quintela > diff --git a/migration/migration.c b/migration/migration.c > index e4

[Qemu-devel] [PATCH 08/11] block: invoke .bdrv_drain callback in coroutine context and from AioContext

2017-05-31 Thread Paolo Bonzini
This will let the callback take a CoMutex in the next patch. Signed-off-by: Paolo Bonzini --- block/io.c| 42 +- block/qed.c | 6 +++--- include/block/block_int.h | 2 +- 3 files changed, 37 insertions(+), 13 deletions(-) d

[Qemu-devel] [PATCH v3 0/4] Block migration (migrate -b) fixes

2017-05-31 Thread Kevin Wolf
v3: - Restricted test to formats without migration blockers [Jeff] - Added timeout for migration completion in test [Jeff] - Removed remaining tabs copied from another test case [Eric] - Updated reference output (SHUTDOWN events) after rebase v2: - Detect when migrate -b is compiled out [Eric] - S

[Qemu-devel] [PATCH v3 4/4] qemu-iotests: Block migration test

2017-05-31 Thread Kevin Wolf
Signed-off-by: Kevin Wolf --- tests/qemu-iotests/183 | 140 + tests/qemu-iotests/183.out | 46 +++ tests/qemu-iotests/group | 1 + 3 files changed, 187 insertions(+) create mode 100755 tests/qemu-iotests/183 create mode 100644 tes

[Qemu-devel] [PATCH 10/11] sheepdog: add queue_lock

2017-05-31 Thread Paolo Bonzini
Signed-off-by: Paolo Bonzini --- block/sheepdog.c | 21 +++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/block/sheepdog.c b/block/sheepdog.c index 5ebf5d9fbb..551db7cd17 100644 --- a/block/sheepdog.c +++ b/block/sheepdog.c @@ -391,6 +391,7 @@ struct BDRVSheepdo

[Qemu-devel] [PATCH v3 1/4] block: Fix anonymous BBs in blk_root_inactivate()

2017-05-31 Thread Kevin Wolf
blk->name isn't an array, but a pointer that can be NULL. Checking for an anonymous BB must involve a NULL check first, otherwise we get crashes. Signed-off-by: Kevin Wolf Reviewed-by: Fam Zheng Reviewed-by: Juan Quintela Reviewed-by: Eric Blake --- block/block-backend.c | 2 +- 1 file change

Re: [Qemu-devel] [PATCH 11/12] tests/test-hmp: Add announce parameter tests

2017-05-31 Thread Dr. David Alan Gilbert
* Vladislav Yasevich (vyase...@redhat.com) wrote: > Add 2 new commands for announce parameters to the test. > > Signed-off-by: Vladislav Yasevich > --- > tests/test-hmp.c | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/tests/test-hmp.c b/tests/test-hmp.c > index 99e35ec..f3887d1 1006

Re: [Qemu-devel] [Qemu-block] [PATCH v2 06/16] backup: Request BLK_PERM_AIO_CONTEXT_CHANGE on target

2017-05-31 Thread Fam Zheng
On Wed, 05/31 10:39, Stefan Hajnoczi wrote: > On Wed, May 24, 2017 at 10:18:44AM +0800, Fam Zheng wrote: > > On Thu, 05/11 15:41, Stefan Hajnoczi wrote: > > > On Wed, Apr 19, 2017 at 05:43:46PM +0800, Fam Zheng wrote: > > > > What's done in the source's context change notifier is moving the > > > >

[Qemu-devel] [PATCH v3 3/4] migration/block: Clean up BBs in block_save_complete()

2017-05-31 Thread Kevin Wolf
We need to release any block migrations BlockBackends on the source before successfully completing the migration because otherwise inactivating the images will fail (inactivation only tolerates device BBs). Signed-off-by: Kevin Wolf Reviewed-by: Fam Zheng Reviewed-by: Eric Blake --- migration/

Re: [Qemu-devel] [PATCH 10/12] hmp: Add hmp_announce_self

2017-05-31 Thread Dr. David Alan Gilbert
* Vladislav Yasevich (vyase...@redhat.com) wrote: > Add an HMP command to trigger self annocements. > > Signend-off-by: Vladislav Yasevich ^^ > --- > hmp-commands.hx | 14 ++ > hmp.c | 5 + > hmp.h | 1 + > 3 files changed, 20 insertions(+) > > diff

Re: [Qemu-devel] [PATCH v2 0/2] Edu leak fix series

2017-05-31 Thread Peter Xu
On Wed, May 31, 2017 at 05:42:34PM +0800, Peter Xu wrote: > A whitelist for it does not really makes sense. Let's remove it and > then we can introduce a blacklist when really needed, with msi_broken. > That's patch 1. Ok this paragraph does not make sense if not mentioning what's "it"... Please

Re: [Qemu-devel] [PATCH] live-block-ops.txt: Rewrite and improve it

2017-05-31 Thread Kashyap Chamarthy
On Tue, May 30, 2017 at 03:42:08PM -0500, Eric Blake wrote: > On 05/30/2017 03:24 PM, Kashyap Chamarthy wrote: [...] > > Eric, do you have an opinion: Now that I _do_ have the notes > > available[*], do you think it is worth spelling out the invocation for > > QMP `blockdev-{backup, mirror}`? O

Re: [Qemu-devel] [PATCH 07/17] json: learn to parse uint64 numbers

2017-05-31 Thread Markus Armbruster
Marc-André Lureau writes: > Hi > > On Mon, May 15, 2017 at 6:00 PM Markus Armbruster wrote: > >> Marc-André Lureau writes: >> >> > Switch strtoll() usage to qemu_strtoi64() helper while at it. >> > >> > Replace temporarily the error in qnum_get_int() with values >INT64_MAX >> > until the visito

Re: [Qemu-devel] [Qemu-block] [PATCH v3 04/16] qemu-img: Expose PreallocMode for resizing

2017-05-31 Thread Stefan Hajnoczi
On Fri, May 26, 2017 at 06:55:06PM +0200, Max Reitz wrote: > Add a --preallocation command line option to qemu-img resize which can > be used to set the PreallocMode parameter of blk_truncate(). > > Signed-off-by: Max Reitz > --- > qemu-img.c| 33 ++--- > qemu-img

Re: [Qemu-devel] [PATCH v3 09/16] block/qcow2: Generalize preallocate()

2017-05-31 Thread Stefan Hajnoczi
On Fri, May 26, 2017 at 06:55:11PM +0200, Max Reitz wrote: > This patch adds two new parameters to the preallocate() function so we > will be able to use it not just for preallocating a new image but also > for preallocated image growth. > > The offset parameter allows the caller to specify a virt

Re: [Qemu-devel] [Qemu-block] [PATCH v3 10/16] block/qcow2: Lock s->lock in preallocate()

2017-05-31 Thread Stefan Hajnoczi
On Fri, May 26, 2017 at 06:55:12PM +0200, Max Reitz wrote: > preallocate() is and will be called only from places that do not lock > s->lock: Currently that is qcow2_create2(), as of a future patch it will > be called from qcow2_truncate(), too. > > It therefore makes sense to move locking that mu

Re: [Qemu-devel] [PATCH 00/12] self-announce updates

2017-05-31 Thread Dr. David Alan Gilbert
* Vladislav Yasevich (vyase...@redhat.com) wrote: > This work a consolidation of the work by David Gilbert, Germano > Veit Michel and myself. > > It started out with David wanting to parametirize self-announcments > so that the user may control how often annoucment packets (RARPs) > were generated

[Qemu-devel] [PATCH v2 00/10] Another cleanup of includes

2017-05-31 Thread Juan Quintela
Hi Changes from v1: - patch 1 got reviewed on the pull request - drop one change from patch2 as lvivier comments - fix include of snapshot.h Please review. Thanks, Juan. {v1} - make all migration methods export its functions in its own header - move block.h into migration/ - create migration/s

[Qemu-devel] [PATCH v2 01/10] migration: Remove unneeded includes of migration/vmstate.h

2017-05-31 Thread Juan Quintela
Signed-off-by: Juan Quintela Reviewed-by: Philippe Mathieu-Daudé --- hw/core/qdev.c | 1 - include/hw/acpi/memory_hotplug.h | 1 - include/hw/acpi/pcihp.h | 1 - include/hw/pci/shpc.h| 1 - target/alpha/cpu.c | 1 - target/hppa/cpu.c

[Qemu-devel] [PATCH] migration: isolate return path on src

2017-05-31 Thread Peter Xu
There are some places that binded "return path" with postcopy. Let's be prepared for its usage even without postcopy. This patch mainly did this on source side. Signed-off-by: Peter Xu --- standalone patch isolated from the return path series. ok to be picked up in case one day we'll re-face the

[Qemu-devel] [PATCH v2 06/10] migration: Export tls.c functions in its own file

2017-05-31 Thread Juan Quintela
Just for the functions exported from tls.c. Notice that we can't remove the migration/migration.h include from tls.c because it access directly MigrationState for the tls params. Signed-off-by: Juan Quintela --- include/migration/migration.h | 10 -- migration/channel.c | 1 +

[Qemu-devel] [PATCH v2 02/10] migration: Split qemu-file.h

2017-05-31 Thread Juan Quintela
Split the file into public and internal interfaces. I have to rename the external one because we can't have two include files with the same name in the same directory. Build system gets confused. The only exported functions are the ones that handle basic types. Signed-off-by: Juan Quintela ---

[Qemu-devel] [PATCH v2 04/10] migration: Export fd.c functions in its own file

2017-05-31 Thread Juan Quintela
Signed-off-by: Juan Quintela --- include/migration/migration.h | 4 migration/fd.c| 1 + migration/fd.h| 23 +++ migration/migration.c | 1 + 4 files changed, 25 insertions(+), 4 deletions(-) create mode 100644 migration/fd.h d

[Qemu-devel] [PATCH v2 07/10] migration: Export rdma.c functions in its own file

2017-05-31 Thread Juan Quintela
Signed-off-by: Juan Quintela --- include/migration/migration.h | 4 migration/migration.c | 1 + migration/rdma.c | 1 + migration/rdma.h | 25 + 4 files changed, 27 insertions(+), 4 deletions(-) create mode 100644 migration/rdma.

Re: [Qemu-devel] [PATCH v3 12/16] block/qcow2: Add qcow2_refcount_area()

2017-05-31 Thread Stefan Hajnoczi
On Fri, May 26, 2017 at 06:55:14PM +0200, Max Reitz wrote: > This function creates a collection of self-describing refcount > structures (including a new refcount table) at the end of a qcow2 image > file. Optionally, these structures can also describe a number of > additional clusters beyond thems

[Qemu-devel] [PATCH v2 05/10] migration: Export socket.c functions in its own file

2017-05-31 Thread Juan Quintela
Signed-off-by: Juan Quintela --- include/migration/migration.h | 8 migration/migration.c | 1 + migration/socket.c| 1 + migration/socket.h| 28 4 files changed, 30 insertions(+), 8 deletions(-) create mode 100644 migratio

[Qemu-devel] [PATCH v2 03/10] migration: Export exec.c functions in its own file

2017-05-31 Thread Juan Quintela
Signed-off-by: Juan Quintela --- include/migration/migration.h | 4 migration/exec.c | 1 + migration/exec.h | 26 ++ migration/migration.c | 1 + 4 files changed, 28 insertions(+), 4 deletions(-) create mode 100644 migration/exec

[Qemu-devel] [PATCH v2 08/10] migration: Create include for migration snapshots

2017-05-31 Thread Juan Quintela
Start removing migration code from sysemu/sysemu.h. Signed-off-by: Juan Quintela --- hmp.c| 5 +++-- include/block/block_int.h| 4 ++-- include/migration/snapshot.h | 21 + include/sysemu/sysemu.h | 3 --- migration/savevm.c | 5

[Qemu-devel] [PATCH v2 10/10] migration: Move include/migration/block.h into migration/

2017-05-31 Thread Juan Quintela
All functions were internal, except blk_mig_init() that is exported in misc.h now. Signed-off-by: Juan Quintela --- include/migration/misc.h | 8 migration/block.c| 3 ++- {include/migration => migration}/block.h | 2 -- migration/colo.c

Re: [Qemu-devel] [Qemu-block] [PATCH v3 13/16] block/qcow2: Rename "fail_block" to just "fail"

2017-05-31 Thread Stefan Hajnoczi
On Fri, May 26, 2017 at 06:55:15PM +0200, Max Reitz wrote: > Now alloc_refcount_block() only contains a single fail label, so it > makes more sense to just name it "fail" instead of "fail_block". > > Signed-off-by: Max Reitz > --- > block/qcow2-refcount.c | 14 +++--- > 1 file changed, 7

[Qemu-devel] [PATCH v2 09/10] migration: Export ram.c functions in its own file

2017-05-31 Thread Juan Quintela
All functions are internal except for ram_mig_init(). Create migration/misc.h for this kind of functions. Signed-off-by: Juan Quintela Reviewed-by: Dr. David Alan Gilbert --- include/migration/migration.h | 38 --- include/migration/misc.h | 21 + migration

Re: [Qemu-devel] [Qemu-block] [PATCH v3 00/16] block: Protect AIO context change with perm API

2017-05-31 Thread Fam Zheng
On Wed, 05/31 10:45, Stefan Hajnoczi wrote: > On Wed, May 24, 2017 at 10:52:19AM +0800, Fam Zheng wrote: > > v3: Move blk_set_aio_context to the front of mirror_start_job to avoid > > accessing target without acquiring its aio context. [Stefan] > > Use error_free_or_abort in test code. [Ste

Re: [Qemu-devel] [Qemu-block] [PATCH v3 14/16] block/qcow2: falloc/full preallocating growth

2017-05-31 Thread Stefan Hajnoczi
On Fri, May 26, 2017 at 06:55:16PM +0200, Max Reitz wrote: > @@ -2677,6 +2679,102 @@ static int qcow2_truncate(BlockDriverState *bs, > int64_t offset, > } > break; > > +case PREALLOC_MODE_FALLOC: > +case PREALLOC_MODE_FULL: > +{ > +int64_t allocation_start,

[Qemu-devel] [PATCH v2] vhost-user: fix watcher need be removed when vhost-user hotplug

2017-05-31 Thread Yunjian Wang
From: w00273186 "nc" is freed after hotplug vhost-user, but the watcher don't be removed. The QEMU crash when the watcher access the "nc" on socket disconnect. Call Trace: #0 object_get_class (obj=obj@entry=0x2) at qom/object.c:751 #1 0x7fc031c79f41 in qemu_chr_fe_disconnect (be=)

Re: [Qemu-devel] [PATCH 07/17] json: learn to parse uint64 numbers

2017-05-31 Thread Marc-André Lureau
Hi On Wed, May 31, 2017 at 2:08 PM Markus Armbruster wrote: > Marc-André Lureau writes: > > > Hi > > > > On Mon, May 15, 2017 at 6:00 PM Markus Armbruster > wrote: > > > >> Marc-André Lureau writes: > >> > >> > Switch strtoll() usage to qemu_strtoi64() helper while at it. > >> > > >> > Replac

Re: [Qemu-devel] [PATCH v2] vhost-user: fix watcher need be removed when vhost-user hotplug

2017-05-31 Thread Marc-André Lureau
On Wed, May 31, 2017 at 2:49 PM Yunjian Wang wrote: > From: w00273186 > > "nc" is freed after hotplug vhost-user, but the watcher don't be removed. > The QEMU crash when the watcher access the "nc" on socket disconnect. > > Call Trace: > #0 object_get_class (obj=obj@entry=0x2) at qom/object

  1   2   3   4   5   >