Re: [Qemu-devel] [PATCH for-2.9 3/5] block: Quiesce old aio context during bdrv_set_aio_context

2017-04-06 Thread Kevin Wolf
Am 06.04.2017 um 16:25 hat Fam Zheng geschrieben: > The fact that the bs->aio_context is changing can confuse the dataplane > iothread, because of the now fine granularity aio context lock. > bdrv_drain should rather be a bdrv_drained_begin/end pair, but since > bs->aio_context is changing, we can

Re: [Qemu-devel] [PATCH 1/2] parallels: create parallels_inactivate() callback of block driver state

2017-04-06 Thread Stefan Hajnoczi
On Wed, Apr 05, 2017 at 06:12:05PM +0300, Denis V. Lunev wrote: > We should avoid to image file at migration end when BDRV_O_INACTIVE s/avoid to image/avoid writing to the image/ ? > is set on the block driver state. All modifications should be done > in advance, i.e. in bdrv_inactivate. > > The

Re: [Qemu-devel] [PATCH for-2.9 4/5] block: Drain BH in bdrv_drained_begin

2017-04-06 Thread Eric Blake
On 04/06/2017 09:25 AM, Fam Zheng wrote: > During block job completion, nothing is preventing > block_job_defer_to_main_loop_bh from being called in a nested > aio_poll(), which is a trouble, such as in this code path: > > qmp_block_commit > commit_active_start > bdrv_reopen >

Re: [Qemu-devel] [PATCH v8 1/9] memory: add section range info for IOMMU notifier

2017-04-06 Thread Alex Williamson
On Thu, 6 Apr 2017 15:08:36 +0800 Peter Xu wrote: > In this patch, IOMMUNotifier.{start|end} are introduced to store section > information for a specific notifier. When notification occurs, we not > only check the notification type (MAP|UNMAP), but also check whether the > notified iova range ov

Re: [Qemu-devel] [PATCH 1/3] move xen-common.c to hw/xen/

2017-04-06 Thread Sahid Orentino Ferdjaoui
On Wed, Apr 05, 2017 at 04:21:29PM -0700, Anthony Xu wrote: > move xen-common.c to hw/xen/ > > Signed-off -by: Anthony Xu nit: s/Signed-off -by/Signed-off-by, not sure if it's really important or not. Reviewed-By: Sahid Orentino Ferdjaoui > > --- > Makefile.target |

[Qemu-devel] [RFC] Proposed qcow2 extension: subcluster allocation

2017-04-06 Thread Alberto Garcia
Hi all, over the past couple of months I discussed with some of you the possibility to extend the qcow2 format in order to improve its performance and reduce its memory requirements (particularly with very large images). After some discussion in the mailing list and the #qemu IRC channel I decide

Re: [Qemu-devel] [PATCH for-2.9 3/5] block: Quiesce old aio context during bdrv_set_aio_context

2017-04-06 Thread Eric Blake
On 04/06/2017 09:25 AM, Fam Zheng wrote: > The fact that the bs->aio_context is changing can confuse the dataplane > iothread, because of the now fine granularity aio context lock. > bdrv_drain should rather be a bdrv_drained_begin/end pair, but since > bs->aio_context is changing, we can just use

Re: [Qemu-devel] [PATCH v5] Allow setting NUMA distance for different NUMA nodes

2017-04-06 Thread Andrew Jones
On Thu, Apr 06, 2017 at 10:18:53AM +0800, He Chen wrote: > This patch is going to add SLIT table support in QEMU, and provides > additional option `dist` for command `-numa` to allow user set vNUMA > distance by QEMU command. > > With this patch, when a user wants to create a guest that contains >

Re: [Qemu-devel] [RFC PATCH 0/4] nvdimm: enable flush hint address structure

2017-04-06 Thread Xiao Guangrong
On 31/03/2017 4:41 PM, Haozhong Zhang wrote: This patch series constructs the flush hint address structures for nvdimm devices in QEMU. It's of course not for 2.9. I send it out early in order to get comments on one point I'm uncertain (see the detailed explanation below). Thanks for any comme

Re: [Qemu-devel] [RFC PATCH 2/4] nvdimm: add functions to initialize and perform flush on back store

2017-04-06 Thread Xiao Guangrong
On 03/31/2017 04:41 PM, Haozhong Zhang wrote: fsync() is used to persist modifications to the back store. If the host NVDIMM is used as the back store, fsync() on Linux will trigger the write to the host flush hint address. Signed-off-by: Haozhong Zhang --- hw/mem/nvdimm.c | 22 +

Re: [Qemu-devel] [RFC PATCH 0/4] nvdimm: enable flush hint address structure

2017-04-06 Thread Xiao Guangrong
On 04/06/2017 05:43 PM, Stefan Hajnoczi wrote: On Fri, Mar 31, 2017 at 04:41:43PM +0800, Haozhong Zhang wrote: This patch series constructs the flush hint address structures for nvdimm devices in QEMU. It's of course not for 2.9. I send it out early in order to get comments on one point I'm u

Re: [Qemu-devel] [PATCH] Put all trace.o into libqemuutil.a

2017-04-06 Thread Stefan Hajnoczi
On Tue, Apr 04, 2017 at 09:39:39PM +, Xu, Anthony wrote: Thanks, applied to my tracing-next tree: https://github.com/stefanha/qemu/commits/tracing-next I fixed up the patch when applying it. Comments below: > Put all trace.o into libqemuutil.a Please use the "trace: " prefix for tracing pa

Re: [Qemu-devel] [RFC PATCH 1/4] pc-dimm: add 'reserved-size' to reserve address range after the ending address

2017-04-06 Thread Xiao Guangrong
On 03/31/2017 04:41 PM, Haozhong Zhang wrote: If option 'reserved-size=RSVD' is present, QEMU will reserve an address range of size 'RSVD' after the ending address of pc-dimm device. For the following example, -object memory-backend-file,id=mem0,size=4G,... -device nvdimm,id=dimm0,memd

Re: [Qemu-devel] [RFC PATCH 0/4] nvdimm: enable flush hint address structure

2017-04-06 Thread Xiao Guangrong
On 04/06/2017 05:58 PM, Haozhong Zhang wrote: On 04/06/17 17:39 +0800, Xiao Guangrong wrote: On 31/03/2017 4:41 PM, Haozhong Zhang wrote: This patch series constructs the flush hint address structures for nvdimm devices in QEMU. It's of course not for 2.9. I send it out early in order to g

Re: [Qemu-devel] [PATCH for-2.9 2/5] mirror: Fix aio context of mirror_top_bs

2017-04-06 Thread Eric Blake
On 04/06/2017 09:25 AM, Fam Zheng wrote: > It should be moved to the same context as source, before inserting to the > graph. > > Signed-off-by: Fam Zheng > --- > block/mirror.c | 1 + > 1 file changed, 1 insertion(+) Reviewed-by: Eric Blake > > diff --git a/block/mirror.c b/block/mirror.c >

Re: [Qemu-devel] [PATCH for-2.9 2/5] mirror: Fix aio context of mirror_top_bs

2017-04-06 Thread Kevin Wolf
Am 06.04.2017 um 16:25 hat Fam Zheng geschrieben: > It should be moved to the same context as source, before inserting to the > graph. > > Signed-off-by: Fam Zheng Reviewed-by: Kevin Wolf

Re: [Qemu-devel] [PATCH for-2.9 1/5] block: Fix unpaired aio_disable_external in external snapshot

2017-04-06 Thread Kevin Wolf
Am 06.04.2017 um 16:25 hat Fam Zheng geschrieben: > bdrv_replace_child_noperm tries to hand over the quiesce_counter state > from old bs to the new one, but if they are not on the same aio context > this causes unbalance. > > Fix this by forcing callers to move the aio context first, and assert >

Re: [Qemu-devel] [PATCH for-2.9 1/5] block: Fix unpaired aio_disable_external in external snapshot

2017-04-06 Thread Eric Blake
On 04/06/2017 09:25 AM, Fam Zheng wrote: > bdrv_replace_child_noperm tries to hand over the quiesce_counter state > from old bs to the new one, but if they are not on the same aio context > this causes unbalance. > > Fix this by forcing callers to move the aio context first, and assert > it. > >

Re: [Qemu-devel] [RFC PATCH 0/4] nvdimm: enable flush hint address structure

2017-04-06 Thread Dan Williams
On Thu, Apr 6, 2017 at 2:43 AM, Stefan Hajnoczi wrote: > On Fri, Mar 31, 2017 at 04:41:43PM +0800, Haozhong Zhang wrote: >> This patch series constructs the flush hint address structures for >> nvdimm devices in QEMU. >> >> It's of course not for 2.9. I send it out early in order to get >> comment

[Qemu-devel] [PATCH for-2.9 3/5] block: Quiesce old aio context during bdrv_set_aio_context

2017-04-06 Thread Fam Zheng
The fact that the bs->aio_context is changing can confuse the dataplane iothread, because of the now fine granularity aio context lock. bdrv_drain should rather be a bdrv_drained_begin/end pair, but since bs->aio_context is changing, we can just use aio_disable_external and block_job_pause. Report

[Qemu-devel] [PATCH for-2.9 4/5] block: Drain BH in bdrv_drained_begin

2017-04-06 Thread Fam Zheng
During block job completion, nothing is preventing block_job_defer_to_main_loop_bh from being called in a nested aio_poll(), which is a trouble, such as in this code path: qmp_block_commit commit_active_start bdrv_reopen bdrv_reopen_multiple bdrv_reopen_prep

[Qemu-devel] [PATCH for-2.9 2/5] mirror: Fix aio context of mirror_top_bs

2017-04-06 Thread Fam Zheng
It should be moved to the same context as source, before inserting to the graph. Signed-off-by: Fam Zheng --- block/mirror.c | 1 + 1 file changed, 1 insertion(+) diff --git a/block/mirror.c b/block/mirror.c index 9e2fecc..e904fef 100644 --- a/block/mirror.c +++ b/block/mirror.c @@ -1148,6 +114

[Qemu-devel] [PATCH for-2.9 5/5] coroutine: Explicitly specify AioContext when creating coroutine

2017-04-06 Thread Fam Zheng
Coroutine in block layer should always be waken up in bs->aio_context rather than the "current" context where it is entered. They differ when the main loop is doing QMP tasks. Race conditions happen without this patch, because the wrong context is acquired in co_schedule_bh_cb, while the entered c

[Qemu-devel] [PATCH for-2.9 1/5] block: Fix unpaired aio_disable_external in external snapshot

2017-04-06 Thread Fam Zheng
bdrv_replace_child_noperm tries to hand over the quiesce_counter state from old bs to the new one, but if they are not on the same aio context this causes unbalance. Fix this by forcing callers to move the aio context first, and assert it. Reported-by: Ed Swierk Signed-off-by: Fam Zheng --- bl

[Qemu-devel] [PATCH for-2.9 0/5] block: Fixes regarding dataplane and management operations

2017-04-06 Thread Fam Zheng
These are accumulated fixes that showed up when working on the "change" issue and "repeated snapshot + commit" crash on dataplane: [Qemu-devel] [PATCH] blk: fix aio context loss on media change - Vladimir Sementsov-Ogievskiy [Qemu-devel] New iotest repros failures on virtio exter

Re: [Qemu-devel] [PATCH 5/5] ram: Remove migration_bitmap_extend()

2017-04-06 Thread Eric Blake
On 04/06/2017 08:13 AM, Juan Quintela wrote: > We have disabled memory hotplug, so we don't need to handle > migration_bitamp there. > > Signed-off-by: Juan Quintela > --- > exec.c | 1 - > include/exec/ram_addr.h | 2 -- > migration/ram.c | 34

Re: [Qemu-devel] [PATCH v2] Split migration bitmaps by ramblock

2017-04-06 Thread Eric Blake
On 04/06/2017 08:14 AM, Juan Quintela wrote: > Hi > > For v2 this is a rebase on top of all the changes that happened in the > prvious two series. > > > Please, comment? > > Later, Juan. > > > *** BLURB HERE *** > > Juan Quintela (1): > ram: Remove migration_bitmap_extend() Is this the i

Re: [Qemu-devel] [Qemu-ppc] [PATCH RFC v1 0/3] Enable MTTCG on PPC64

2017-04-06 Thread G 3
On Apr 6, 2017, at 9:32 AM, Cédric Le Goater wrote: On 04/06/2017 03:28 PM, G 3 wrote: On Apr 6, 2017, at 9:26 AM, Cédric Le Goater wrote: Hello Nikunj, On 04/06/2017 12:22 PM, Nikunj A Dadhania wrote: The series enables Multi-Threaded TCG on PPC64 Patch 01: Use atomic_cmpxchg in store c

Re: [Qemu-devel] [PATCH 1/5] qdev: qdev_hotplug is really a bool

2017-04-06 Thread Eric Blake
On 04/06/2017 08:13 AM, Juan Quintela wrote: > Signed-off-by: Juan Quintela > --- > hw/core/qdev.c | 4 ++-- > include/hw/qdev-core.h | 2 +- > 2 files changed, 3 insertions(+), 3 deletions(-) Reviewed-by: Eric Blake -- Eric Blake eblake redhat com+1-919-301-3266 Libvirt virtual

Re: [Qemu-devel] [PATCH 4/5] migration: Disable hotplug/unplug during migration

2017-04-06 Thread Eric Blake
On 04/06/2017 08:13 AM, Juan Quintela wrote: > Until we have reviewed what can/can't be hotplug during migration, s/hotplug/hotplugged/ > disable it. We can enable it later for the things that we know that > work. For instance, memory hotplug during postcopy don't work s/don't/doesn't/ > curr

[Qemu-devel] [PATCH] target/arm: Add missing entries to excnames[] for log strings

2017-04-06 Thread Peter Maydell
Recent changes have added new EXCP_ values to ARM but forgot to update the excnames[] array which is used to provide human-readable strings when printing information about the exception for debug logging. Add the missing entries, and add a comment to the list of #defines to help avoid the mistake b

Re: [Qemu-devel] [PATCH 3/5] qdev: Move qdev_unplug() to qdev-monitor.c

2017-04-06 Thread Eric Blake
On 04/06/2017 08:13 AM, Juan Quintela wrote: > It is not used by linux-user, otherwise I need to to create one stub > for migration_is_idle() on following patch. > > Signed-off-by: Juan Quintela > --- > hw/core/qdev.c | 34 -- > qdev-monitor.c | 34 +++

Re: [Qemu-devel] [PATCH 2/5] qdev: Export qdev_hot_removed

2017-04-06 Thread Eric Blake
On 04/06/2017 08:13 AM, Juan Quintela wrote: > I need to move qdev_unplug to qdev-monitor in the following patch, and > it needs access to this variable. > > Signed-off-by: Juan Quintela > --- > hw/core/qdev.c | 2 +- > include/hw/qdev-core.h | 1 + > 2 files changed, 2 insertions(+), 1

Re: [Qemu-devel] [Qemu-ppc] [PATCH RFC v1 0/3] Enable MTTCG on PPC64

2017-04-06 Thread G 3
On Apr 6, 2017, at 9:26 AM, Cédric Le Goater wrote: Hello Nikunj, On 04/06/2017 12:22 PM, Nikunj A Dadhania wrote: The series enables Multi-Threaded TCG on PPC64 Patch 01: Use atomic_cmpxchg in store conditional 02: Handle first write to page during atomic operation 03: Generate

Re: [Qemu-devel] [PATCH v3] migration/block:limit the time used for block migration

2017-04-06 Thread Stefan Hajnoczi
On Wed, Apr 05, 2017 at 05:27:58PM +0800, jemmy858...@gmail.com wrote: > From: Lidong Chen > > when migration with high speed, mig_save_device_bulk invoke > bdrv_is_allocated too frequently, and cause vnc reponse slowly. > this patch limit the time used for bdrv_is_allocated. bdrv_is_allocated()

Re: [Qemu-devel] [PATCH v3 10/13] block: Simplify bdrv_append_temp_snapshot() logic

2017-04-06 Thread Kevin Wolf
Am 06.04.2017 um 14:52 hat Eric Blake geschrieben: > On 04/06/2017 04:00 AM, Kevin Wolf wrote: > > Am 05.04.2017 um 21:47 hat Eric Blake geschrieben: > >> Noticed while checking Coccinelle results. Naming a label 'out:' > >> when it is only used on error paths is weird; meanwhile we know > >> that

[Qemu-devel] [PATCH] stellaris: Don't hw_error() on bad register accesses

2017-04-06 Thread Peter Maydell
Current recommended style is to log a guest error on bad register accesses, not kill the whole system with hw_error(). Change the hw_error() calls to log as LOG_GUEST_ERROR or LOG_UNIMP or use g_assert_not_reached() as appropriate. Signed-off-by: Peter Maydell --- hw/arm/stellaris.c | 60 ++

Re: [Qemu-devel] [PATCH] Put all trace.o into libqemuutil.a

2017-04-06 Thread Stefan Hajnoczi
On Wed, Apr 05, 2017 at 11:15:58AM +0300, Lluís Vilanova wrote: > Xu, Anthony writes: > > > Put all trace.o into libqemuutil.a > > Currently all trace.o are linked into qemu-system, qemu-img, > > qemu-nbd, qemu-io etc., even the corresponding components > > are not included. > > Put all trace.o

Re: [Qemu-devel] [Qemu-ppc] [PATCH RFC v1 0/3] Enable MTTCG on PPC64

2017-04-06 Thread Cédric Le Goater
On 04/06/2017 03:28 PM, G 3 wrote: > > On Apr 6, 2017, at 9:26 AM, Cédric Le Goater wrote: > >> Hello Nikunj, >> >> On 04/06/2017 12:22 PM, Nikunj A Dadhania wrote: >>> The series enables Multi-Threaded TCG on PPC64 >>> >>> Patch 01: Use atomic_cmpxchg in store conditional >>> 02: Handle fi

Re: [Qemu-devel] [PATCH v3 10/13] block: Simplify bdrv_append_temp_snapshot() logic

2017-04-06 Thread Eric Blake
On 04/06/2017 07:52 AM, Eric Blake wrote: >>> +out: >>> +QDECREF(snapshot_options); >>> g_free(tmp_filename); >>> return bs_snapshot; >> >> bs_snapshot is uninitialised or at least the wrong return value in error >> cases. (Hm... Shouldn't the compiler catch the uninitialised part?)

Re: [Qemu-devel] [PATCH v3 03/13] s390x: Drop useless casts

2017-04-06 Thread Eric Blake
On 04/06/2017 02:36 AM, Cornelia Huck wrote: > On Wed, 5 Apr 2017 14:47:31 -0500 > Eric Blake wrote: > >> An upcoming Coccinelle cleanup script wanted to reformat the casts >> present in this file - but on closer look, we don't need the casts >> at all because C automatically converts void* to a

Re: [Qemu-devel] [PATCH v3 03/13] s390x: Drop useless casts

2017-04-06 Thread Cornelia Huck
On Wed, 5 Apr 2017 14:47:31 -0500 Eric Blake wrote: > An upcoming Coccinelle cleanup script wanted to reformat the casts > present in this file - but on closer look, we don't need the casts > at all because C automatically converts void* to any other pointer. > > Signed-off-by: Eric Blake > --

Re: [Qemu-devel] [Qemu-ppc] [PATCH RFC v1 0/3] Enable MTTCG on PPC64

2017-04-06 Thread Cédric Le Goater
Hello Nikunj, On 04/06/2017 12:22 PM, Nikunj A Dadhania wrote: > The series enables Multi-Threaded TCG on PPC64 > > Patch 01: Use atomic_cmpxchg in store conditional > 02: Handle first write to page during atomic operation > 03: Generate memory barriers for sync/isync and load/store c

[Qemu-devel] [PATCH 2/2] migration/block: use blk_pwrite_zeroes for each zero cluster

2017-04-06 Thread jemmy858585
From: Lidong Chen BLOCK_SIZE is (1 << 20), qcow2 cluster size is 65536 by default, this maybe cause the qcow2 file size is bigger after migration. This patch check each cluster, use blk_pwrite_zeroes for each zero cluster. Signed-off-by: Lidong Chen --- migration/block.c | 34 +

Re: [Qemu-devel] [PATCH v3 10/13] block: Simplify bdrv_append_temp_snapshot() logic

2017-04-06 Thread Eric Blake
On 04/06/2017 08:27 AM, Kevin Wolf wrote: @@ -2209,13 +2209,10 @@ static BlockDriverState *bdrv_append_temp_snapshot(BlockDriverState *bs, More context: > bs_snapshot = bdrv_open(NULL, NULL, snapshot_options, flags, errp); > snapshot_options = NULL; > if (!bs_snapshot) { >

Re: [Qemu-devel] [PATCH for-2.10 05/10] s390x/css: provide introspection for virtual subchannel and device busid

2017-04-06 Thread Cornelia Huck
On Thu, 6 Apr 2017 14:19:10 +0200 Thomas Huth wrote: > On 06.04.2017 13:16, Cornelia Huck wrote: > > +out_err: > > +error_propagate(errp, err); > > +css_subch_assign(sch->cssid, sch->ssid, sch->schid, sch->devno, NULL); > > +ccw_dev->sch = NULL; > > +g_free(sch); > > +return;

[Qemu-devel] [PATCH 2/5] qdev: Export qdev_hot_removed

2017-04-06 Thread Juan Quintela
I need to move qdev_unplug to qdev-monitor in the following patch, and it needs access to this variable. Signed-off-by: Juan Quintela --- hw/core/qdev.c | 2 +- include/hw/qdev-core.h | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/hw/core/qdev.c b/hw/core/qdev.c ind

[Qemu-devel] [PATCH 1/2] block: make bdrv_get_cluster_size public

2017-04-06 Thread jemmy858585
From: Lidong Chen The bdrv_get_cluster_size function is need by block migration to optimize zero cluster. Signed-off-by: Lidong Chen --- block/io.c| 2 +- include/block/block.h | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/block/io.c b/block/io.c index 2709a7

[Qemu-devel] [PATCH v2] Split migration bitmaps by ramblock

2017-04-06 Thread Juan Quintela
Hi For v2 this is a rebase on top of all the changes that happened in the prvious two series. Please, review. [RFC] This series split the migration and unsent bitmaps by ramblock. This makes it easier to synchronize in small bits. This is on top of the RAMState and not-hotplug series. Why? r

[Qemu-devel] [PATCH 51/54] ram: Use ramblock and page offset instead of absolute offset

2017-04-06 Thread Juan Quintela
This removes the needto pass also the absolute offset. Signed-off-by: Juan Quintela --- migration/ram.c | 65 - 1 file changed, 27 insertions(+), 38 deletions(-) diff --git a/migration/ram.c b/migration/ram.c index 4132503..fc1f08f 100644

[Qemu-devel] [PATCH] ram: Remove migration_bitmap_extend()

2017-04-06 Thread Juan Quintela
We have disabled memory hotplug, so we don't need to handle migration_bitamp there. Signed-off-by: Juan Quintela --- exec.c | 1 - include/exec/ram_addr.h | 2 -- migration/ram.c | 34 -- 3 files changed, 37 deletions(-) diff --git a/ex

[Qemu-devel] [PATCH 5/5] ram: Remove migration_bitmap_extend()

2017-04-06 Thread Juan Quintela
We have disabled memory hotplug, so we don't need to handle migration_bitamp there. Signed-off-by: Juan Quintela --- exec.c | 1 - include/exec/ram_addr.h | 2 -- migration/ram.c | 34 -- 3 files changed, 37 deletions(-) diff --git a/ex

[Qemu-devel] [PATCH 48/54] ram: Use page number instead of an address for the bitmap operations

2017-04-06 Thread Juan Quintela
We use an unsigned long for the page number. Notice that our bitmaps already got that for the index, so we have that limit. Signed-off-by: Juan Quintela -- rename page to page_abs everywhere. fix trace types for pages Signed-off-by: Juan Quintela --- migration/ram.c| 76

[Qemu-devel] [PATCH 4/5] migration: Disable hotplug/unplug during migration

2017-04-06 Thread Juan Quintela
Until we have reviewed what can/can't be hotplug during migration, disable it. We can enable it later for the things that we know that work. For instance, memory hotplug during postcopy don't work currently. Signed-off-by: Juan Quintela -- - Fix typo. Thanks Thomas. - Delay migration check a

[Qemu-devel] [PATCH 49/54] ram: Remember last_page instead of last_offset

2017-04-06 Thread Juan Quintela
Signed-off-by: Juan Quintela -- Improve comment Fix typo Signed-off-by: Juan Quintela --- migration/ram.c | 14 +++--- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/migration/ram.c b/migration/ram.c index 52ab14b..5b2045d 100644 --- a/migration/ram.c +++ b/migration/ra

[Qemu-devel] [PATCH 54/54] migration: Remove MigrationState parameter from migration_is_idle()

2017-04-06 Thread Juan Quintela
Only user don't have a MigrationState handly. Signed-off-by: Juan Quintela Reviewed-by: Dr. David Alan Gilbert --- include/migration/migration.h | 2 +- migration/migration.c | 8 +++- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/include/migration/migration.h b/inc

[Qemu-devel] [PATCH 3/5] qdev: Move qdev_unplug() to qdev-monitor.c

2017-04-06 Thread Juan Quintela
It is not used by linux-user, otherwise I need to to create one stub for migration_is_idle() on following patch. Signed-off-by: Juan Quintela --- hw/core/qdev.c | 34 -- qdev-monitor.c | 34 ++ 2 files changed, 34 insertions(+), 34

[Qemu-devel] [PATCH] target/arm: Add assertion about FSC format for syndrome registers

2017-04-06 Thread Peter Maydell
In tlb_fill() we construct a syndrome register value from a fault status register value which is filled in by arm_tlb_fill(). arm_tlb_fill() returns FSR values which might be in the format used with short-format page descriptors, or the format used with long-format (LPAE) descriptors. The syndrome

[Qemu-devel] [PATCH 47/54] ram: reorganize last_sent_block

2017-04-06 Thread Juan Quintela
We were setting it far away of when we changed it. Now everything is done inside save_page_header. Once there, reorganize code to pass RAMState. We also set CONTINUE flag in a single place. Signed-off-by: Juan Quintela Reviewed-by: Dr. David Alan Gilbert Reviewed-by: Peter Xu --- migration/

[Qemu-devel] [PATCH 53/54] ram: Use RAMBitmap type for coherence

2017-04-06 Thread Juan Quintela
Signed-off-by: Juan Quintela Reviewed-by: Dr. David Alan Gilbert --- migration/ram.c | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/migration/ram.c b/migration/ram.c index 3675dad..92d6ff7 100644 --- a/migration/ram.c +++ b/migration/ram.c @@ -1451,7 +1451,7 @@ vo

[Qemu-devel] [PATCH 1/5] qdev: qdev_hotplug is really a bool

2017-04-06 Thread Juan Quintela
Signed-off-by: Juan Quintela --- hw/core/qdev.c | 4 ++-- include/hw/qdev-core.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/hw/core/qdev.c b/hw/core/qdev.c index 1e7fb33..6fa46b5 100644 --- a/hw/core/qdev.c +++ b/hw/core/qdev.c @@ -39,7 +39,7 @@ #include "qapi

[Qemu-devel] [PATCH 50/54] ram: Change offset field in PageSearchStatus to page

2017-04-06 Thread Juan Quintela
We are moving everything to work on pages, not addresses. Signed-off-by: Juan Quintela Reviewed-by: Dr. David Alan Gilbert --- migration/ram.c | 51 ++- 1 file changed, 26 insertions(+), 25 deletions(-) diff --git a/migration/ram.c b/migration/ra

[Qemu-devel] [PATCH 45/54] ram: Pass RAMBlock to bitmap_sync

2017-04-06 Thread Juan Quintela
We change the meaning of start to be the offset from the beggining of the block. Signed-off-by: Juan Quintela --- include/exec/ram_addr.h | 2 ++ migration/ram.c | 8 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/include/exec/ram_addr.h b/include/exec/ram_addr.h

[Qemu-devel] [PATCH v2 0/5] Disable hotplug during migration

2017-04-06 Thread Juan Quintela
Hi This updates patches with all the comments received. I move qdev_unplug() to make linux-user compile. Please, review. [RFC - v1] This series disable hotplug/unplug during migration. Thank to Markus for explaining where I had to put the checks. Why? Because during migration we will fail if

[Qemu-devel] [PATCH 39/54] ram: Move QEMUFile into RAMState

2017-04-06 Thread Juan Quintela
We receive the file from save_live operations and we don't use it until 3 or 4 levels of calls down. Signed-off-by: Juan Quintela Reviewed-by: Dr. David Alan Gilbert --- migration/ram.c | 84 + 1 file changed, 37 insertions(+), 47 deletion

[Qemu-devel] [PATCH 46/54] ram: ram_discard_range() don't use the mis parameter

2017-04-06 Thread Juan Quintela
Signed-off-by: Juan Quintela Reviewed-by: Peter Xu --- include/migration/migration.h | 3 +-- migration/postcopy-ram.c | 6 ++ migration/ram.c | 9 +++-- migration/savevm.c| 3 +-- 4 files changed, 7 insertions(+), 14 deletions(-) diff --git a/include/migr

[Qemu-devel] [PATCH 42/54] ram: We don't need MigrationState parameter anymore

2017-04-06 Thread Juan Quintela
Remove it from callers and callees. Signed-off-by: Juan Quintela Reviewed-by: Dr. David Alan Gilbert Reviewed-by: Peter Xu --- migration/ram.c | 31 --- 1 file changed, 12 insertions(+), 19 deletions(-) diff --git a/migration/ram.c b/migration/ram.c index 8dd750e..

[Qemu-devel] [PATCH 38/54] ram: Add QEMUFile to RAMState

2017-04-06 Thread Juan Quintela
Signed-off-by: Juan Quintela Reviewed-by: Dr. David Alan Gilbert --- migration/ram.c | 17 ++--- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/migration/ram.c b/migration/ram.c index b9f415c..62b44cf 100644 --- a/migration/ram.c +++ b/migration/ram.c @@ -165,6 +165,8

[Qemu-devel] [PATCH 34/54] ram: Create ram_dirty_sync_count()

2017-04-06 Thread Juan Quintela
This is a ram field that was inside MigrationState. Move it to RAMState and make it the same that the other ram stats. Signed-off-by: Juan Quintela Reviewed-by: Peter Xu --- include/migration/migration.h | 2 +- migration/migration.c | 3 +-- migration/ram.c | 6 +- 3

[Qemu-devel] [PATCH 0/2] use blk_pwrite_zeroes for each zero cluster

2017-04-06 Thread jemmy858585
From: Lidong Chen BLOCK_SIZE is (1 << 20), qcow2 cluster size is 65536 by default, this maybe cause the qcow2 file size is bigger after migration. This patch check each cluster, use blk_pwrite_zeroes for each zero cluster. Lidong Chen (2): block: make bdrv_get_cluster_size public migration/b

[Qemu-devel] [PATCH 36/54] ram: Move dirty_pages_rate to RAMState

2017-04-06 Thread Juan Quintela
Treat it like the rest of ram stats counters. Export its value the same way. As an added bonus, no more MigrationState used in migration_bitmap_sync(); Signed-off-by: Juan Quintela Reviewed-by: Dr. David Alan Gilbert Reviewed-by: Peter Xu -- Again, dave was the one reviewing it Signed-off-

[Qemu-devel] [PATCH 37/54] ram: Move postcopy_requests into RAMState

2017-04-06 Thread Juan Quintela
Signed-off-by: Juan Quintela Reviewed-by: Peter Xu --- include/migration/migration.h | 6 ++ migration/migration.c | 5 ++--- migration/ram.c | 13 + 3 files changed, 13 insertions(+), 11 deletions(-) diff --git a/include/migration/migration.h b/include/m

[Qemu-devel] [PATCH 35/54] ram: Remove dirty_bytes_rate

2017-04-06 Thread Juan Quintela
It can be recalculated from dirty_pages_rate. Signed-off-by: Juan Quintela Reviewed-by: Dr. David Alan Gilbert Reviewed-by: Peter Xu -- Dave was the one that reviewed it O:-) Signed-off-by: Juan Quintela --- include/migration/migration.h | 1 - migration/migration.c | 6 +++--- mig

[Qemu-devel] [PATCH 33/54] ram: Move src_page_req* to RAMState

2017-04-06 Thread Juan Quintela
This are the last postcopy fields still at MigrationState. Once there Move MigrationSrcPageRequest to ram.c and remove MigrationState parameters where appropiate. Signed-off-by: Juan Quintela Reviewed-by: Peter Xu --- include/migration/migration.h | 17 +--- migration/migration.c

[Qemu-devel] [PATCH 30/54] ram: Use the RAMState bytes_transferred parameter

2017-04-06 Thread Juan Quintela
Somewhere it was passed by reference, just use it from RAMState. Signed-off-by: Juan Quintela Reviewed-by: Dr. David Alan Gilbert Reviewed-by: Peter Xu --- migration/ram.c | 75 + 1 file changed, 27 insertions(+), 48 deletions(-) diff --

[Qemu-devel] [PATCH 52/54] ram: rename last_ram_offset() last_ram_pages()

2017-04-06 Thread Juan Quintela
We always use it as pages anyways. Signed-off-by: Juan Quintela Reviewed-by: Dr. David Alan Gilbert --- exec.c | 6 +++--- include/exec/ram_addr.h | 2 +- migration/ram.c | 11 +-- 3 files changed, 9 insertions(+), 10 deletions(-) diff --git a/exec.c b/exec.c

[Qemu-devel] [PATCH 31/54] ram: Remove ram_save_remaining

2017-04-06 Thread Juan Quintela
Just unfold it. Move ram_bytes_remaining() with the rest of exported functions. Signed-off-by: Juan Quintela Reviewed-by: Dr. David Alan Gilbert Reviewed-by: Peter Xu --- migration/ram.c | 19 +++ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/migration/ram.c b

[Qemu-devel] [PATCH 28/54] ram: Move migration_bitmap_rcu into RAMState

2017-04-06 Thread Juan Quintela
Once there, rename the type to be shorter. Signed-off-by: Juan Quintela Reviewed-by: Dr. David Alan Gilbert Reviewed-by: Peter Xu --- migration/ram.c | 86 +++-- 1 file changed, 47 insertions(+), 39 deletions(-) diff --git a/migration/ram.c

[Qemu-devel] [PATCH 43/54] ram: Rename qemu_target_page_bits() to qemu_target_page_size()

2017-04-06 Thread Juan Quintela
It was used as a size in all cases except one. Signed-off-by: Juan Quintela Reviewed-by: Dr. David Alan Gilbert --- exec.c | 4 ++-- include/sysemu/sysemu.h | 2 +- migration/migration.c| 4 ++-- migration/postcopy-ram.c | 8 migration/savevm.c | 8

[Qemu-devel] [PATCH 29/54] ram: Move bytes_transferred into RAMState

2017-04-06 Thread Juan Quintela
Signed-off-by: Juan Quintela Reviewed-by: Dr. David Alan Gilbert Reviewed-by: Peter Xu --- migration/ram.c | 35 +-- 1 file changed, 17 insertions(+), 18 deletions(-) diff --git a/migration/ram.c b/migration/ram.c index f6ae17f..7fbaa52 100644 --- a/migration/ra

[Qemu-devel] [PATCH 32/54] ram: Move last_req_rb to RAMState

2017-04-06 Thread Juan Quintela
It was on MigrationState when it is only used inside ram.c for postcopy. Problem is that we need to access it without being able to pass it RAMState directly. Signed-off-by: Juan Quintela Reviewed-by: Peter Xu --- include/migration/migration.h | 2 -- migration/migration.c | 1 - migra

[Qemu-devel] [PATCH 26/54] ram: Everything was init to zero, so use memset

2017-04-06 Thread Juan Quintela
And then init only things that are not zero by default. Signed-off-by: Juan Quintela Reviewed-by: Dr. David Alan Gilbert Reviewed-by: Peter Xu --- migration/ram.c | 25 +++-- 1 file changed, 3 insertions(+), 22 deletions(-) diff --git a/migration/ram.c b/migration/ram.c in

[Qemu-devel] [PATCH 27/54] ram: Move migration_bitmap_mutex into RAMState

2017-04-06 Thread Juan Quintela
Signed-off-by: Juan Quintela Reviewed-by: Dr. David Alan Gilbert Reviewed-by: Peter Xu --- migration/ram.c | 15 --- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/migration/ram.c b/migration/ram.c index 42bb82f..23819cd 100644 --- a/migration/ram.c +++ b/migration/ra

[Qemu-devel] [PATCH 41/54] migration: Remove MigrationState from migration_in_postcopy

2017-04-06 Thread Juan Quintela
We need to call for the migrate_get_current() in more that half of the uses, so call that inside. Signed-off-by: Juan Quintela Reviewed-by: Dr. David Alan Gilbert Reviewed-by: Peter Xu --- include/migration/migration.h | 2 +- migration/migration.c | 6 -- migration/ram.c

[Qemu-devel] [PATCH 25/54] ram: Move migration_dirty_pages to RAMState

2017-04-06 Thread Juan Quintela
Signed-off-by: Juan Quintela Reviewed-by: Peter Xu --- migration/ram.c | 32 ++-- 1 file changed, 18 insertions(+), 14 deletions(-) diff --git a/migration/ram.c b/migration/ram.c index 88392e4..71f8ef3 100644 --- a/migration/ram.c +++ b/migration/ram.c @@ -183,6 +183

[Qemu-devel] [PATCH 44/54] ram: Add page-size to output in 'info migrate'

2017-04-06 Thread Juan Quintela
From: Chao Fan The number of dirty pages is output in 'pages' in the command 'info migrate', so add page-size to calculate the number of dirty pages in bytes. Signed-off-by: Chao Fan Signed-off-by: Li Zhijian Reviewed-by: Eric Blake Signed-off-by: Juan Quintela --- hmp.c | 3

[Qemu-devel] [PATCH 23/54] ram: Move xbzrle_cache_miss_rate into RAMState

2017-04-06 Thread Juan Quintela
Signed-off-by: Juan Quintela Reviewed-by: Dr. David Alan Gilbert Reviewed-by: Peter Xu --- migration/ram.c | 8 +--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/migration/ram.c b/migration/ram.c index b70db68..09f9eff 100644 --- a/migration/ram.c +++ b/migration/ram.c @@ -

[Qemu-devel] [PATCH 22/54] ram: Move xbzrle_cache_miss into RAMState

2017-04-06 Thread Juan Quintela
Signed-off-by: Juan Quintela Reviewed-by: Dr. David Alan Gilbert Reviewed-by: Peter Xu --- migration/ram.c | 12 +++- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/migration/ram.c b/migration/ram.c index cf6681c..b70db68 100644 --- a/migration/ram.c +++ b/migration/ram.c

[Qemu-devel] [PATCH 24/54] ram: Move xbzrle_overflows into RAMState

2017-04-06 Thread Juan Quintela
Once there, remove the now unused AccountingInfo struct and var. Signed-off-by: Juan Quintela Reviewed-by: Dr. David Alan Gilbert Reviewed-by: Peter Xu --- migration/ram.c | 21 + 1 file changed, 5 insertions(+), 16 deletions(-) diff --git a/migration/ram.c b/migration/ram

[Qemu-devel] [PATCH 21/54] ram: Move xbzrle_pages into RAMState

2017-04-06 Thread Juan Quintela
Signed-off-by: Juan Quintela Reviewed-by: Dr. David Alan Gilbert Reviewed-by: Peter Xu -- Comment why we need bytes and pages Signed-off-by: Juan Quintela --- migration/ram.c | 11 +++ 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/migration/ram.c b/migration/ram.c in

[Qemu-devel] [PATCH 17/54] ram: Move norm_pages to RAMState

2017-04-06 Thread Juan Quintela
Signed-off-by: Juan Quintela Reviewed-by: Dr. David Alan Gilbert Reviewed-by: Peter Xu --- migration/ram.c | 26 ++ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/migration/ram.c b/migration/ram.c index 78c7f3d..587e2c7 100644 --- a/migration/ram.c +++ b

[Qemu-devel] [PATCH 40/54] ram: Remove compression_switch and inline its logic

2017-04-06 Thread Juan Quintela
We can calculate its value, so not create a varible for it. Signed-off-by: Juan Quintela -- After Peter and Dave review, I dropped the variable and just inlined the condition. Later, Juan. Signed-off-by: Juan Quintela --- migration/ram.c | 12 1 file changed, 8 insertions(+), 4

[Qemu-devel] [PATCH 19/54] ram: Move iterations into RAMState

2017-04-06 Thread Juan Quintela
Signed-off-by: Juan Quintela Reviewed-by: Peter Xu --- migration/ram.c | 12 +++- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/migration/ram.c b/migration/ram.c index 85d66ea..3e500ae 100644 --- a/migration/ram.c +++ b/migration/ram.c @@ -170,6 +170,8 @@ struct RAMState

[Qemu-devel] [PATCH 20/54] ram: Move xbzrle_bytes into RAMState

2017-04-06 Thread Juan Quintela
Signed-off-by: Juan Quintela Reviewed-by: Dr. David Alan Gilbert --- migration/ram.c | 8 +--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/migration/ram.c b/migration/ram.c index 3e500ae..4dc7869 100644 --- a/migration/ram.c +++ b/migration/ram.c @@ -172,6 +172,8 @@ struct

[Qemu-devel] [PATCH 11/54] ram: Change num_dirty_pages_period type to uint64_t

2017-04-06 Thread Juan Quintela
Signed-off-by: Juan Quintela --- include/exec/ram_addr.h | 2 +- migration/ram.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/include/exec/ram_addr.h b/include/exec/ram_addr.h index b05dc84..9aadc5c 100644 --- a/include/exec/ram_addr.h +++ b/include/exec/ram_addr

[Qemu-devel] [PATCH 14/54] ram: Move dup_pages into RAMState

2017-04-06 Thread Juan Quintela
Once there rename it to its actual meaning, zero_pages. Signed-off-by: Juan Quintela Reviewed-by: Dr. David Alan Gilbert Reviewed-by: Peter Xu --- migration/ram.c | 29 ++--- 1 file changed, 18 insertions(+), 11 deletions(-) diff --git a/migration/ram.c b/migration/ram

[Qemu-devel] [PATCH 18/54] ram: Remove norm_mig_bytes_transferred

2017-04-06 Thread Juan Quintela
Its value can be calculated by other exported. Signed-off-by: Juan Quintela Reviewed-by: Dr. David Alan Gilbert --- include/migration/migration.h | 1 - migration/migration.c | 3 ++- migration/ram.c | 5 - 3 files changed, 2 insertions(+), 7 deletions(-) diff --git a

[Qemu-devel] [PATCH 16/54] ram: Remove unused pages_skipped variable

2017-04-06 Thread Juan Quintela
For compatibility, we need to still send a value, but just specify it and comment the fact. Signed-off-by: Juan Quintela Reviewed-by: Dr. David Alan Gilbert Reviewed-by: Peter Xu --- include/migration/migration.h | 2 -- migration/migration.c | 3 ++- migration/ram.c |

[Qemu-devel] [PATCH 13/54] ram: Move iterations_prev into RAMState

2017-04-06 Thread Juan Quintela
Signed-off-by: Juan Quintela Reviewed-by: Dr. David Alan Gilbert Reviewed-by: Philippe Mathieu-Daudé --- migration/ram.c | 13 ++--- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/migration/ram.c b/migration/ram.c index 32b1cbb..5b6fef8 100644 --- a/migration/ram.c +++ b/

[Qemu-devel] [PATCH 10/54] ram: Move num_dirty_pages_period into RAMState

2017-04-06 Thread Juan Quintela
Signed-off-by: Juan Quintela Reviewed-by: Dr. David Alan Gilbert Reviewed-by: Peter Xu --- migration/ram.c | 20 +++- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/migration/ram.c b/migration/ram.c index d13674f..d6cf032 100644 --- a/migration/ram.c +++ b/migrat

<    1   2   3   4   >