Re: [Qemu-devel] [PATCH V2] add migration capability to bypass the shared memory

2017-09-25 Thread Zhang Haoyu
If hotplug memory during migration, the calculation of migration_dirty_pages maybe incorrect, should fixed as below, -void migration_bitmap_extend(ram_addr_t old, ram_addr_t new) +void migration_bitmap_extend(RAMBlock *block, ram_addr_t old, ram_addr_t new) { /* called in qemu main thread, so

Re: [Qemu-devel] [PATCH V2] add migration capability to bypass the shared memory

2017-09-25 Thread Zhang Haoyu
If hotplug memory during migration, the calculation of migration_dirty_pages maybe not correct, void migration_bitmap_extend(ram_addr_t old, ram_addr_t new) { ... migration_dirty_pages += new - old; call_rcu(old_bitmap, migration_bitmap_free, rcu); ... } Thanks, Zha

Re: [Qemu-devel] [PATCH] add migration capability to bypass the shared memory

2017-09-20 Thread Zhang Haoyu
Hi, Any update? Thanks, Zhang Haoyu On 2016/8/30 12:11, Lai Jiangshan wrote: > On Wed, Aug 10, 2016 at 5:03 PM, Juan Quintela wrote: >> Lai Jiangshan wrote: >> >> Hi >> >> First of all, I like a lot the patchset, but I would preffer to split it >>

Re: [Qemu-devel] [PATCH V2] add migration capability to bypass the shared memory

2017-09-20 Thread Zhang Haoyu
Hi Jiangshan, Any update from this patch? Thanks, Zhang Haoyu On 2016/8/11 22:45, Lai Jiangshan wrote: > Note, the old local migration patchset: > https://lists.gnu.org/archive/html/qemu-devel/2013-12/msg00073.html > > this patch can be considered as a new local migration implement

Re: [Qemu-devel] [RFC] introduce bitmap to bdrv_commit totrackdirtysector

2015-03-09 Thread Zhang Haoyu
mental backup mechanism. Maybe I missed something. Thanks, Zhang Haoyu > > And does qemu support commit any external snapshot to its backing file? > > Yes.

Re: [Qemu-devel] [RFC] introduce bitmap to bdrv_commit to trackdirtysector

2015-03-09 Thread Zhang Haoyu
On 2015-03-10 09:54:47, Fam Zheng wrote: > On Tue, 03/10 09:30, Zhang Haoyu wrote: > > > > On 2015-03-10 08:29:19, Fam Zheng wrote: > > > On Mon, 03/09 16:14, Zhang Haoyu wrote: > > > > Hi John, Vladimir > > > > We can using active block commit

Re: [Qemu-devel] question about live migration with storage

2015-03-09 Thread Zhang Haoyu
On 2015-01-15 18:08:39, Paolo Bonzini wrote: > > On 15/01/2015 10:56, Zhang Haoyu wrote: > > I see, when waiting the completion of drive_mirror IO, the coroutine will be > > switched back to main-thread to poll and process other events, like qmp > > request, > &g

Re: [Qemu-devel] [RFC] introduce bitmap to bdrv_commit to trackdirty sector

2015-03-09 Thread Zhang Haoyu
On 2015-03-10 08:29:19, Fam Zheng wrote: > On Mon, 03/09 16:14, Zhang Haoyu wrote: > > Hi John, Vladimir > > We can using active block commit to implement incremental backup without > > guest disruption, > > e.g., > > origin <= A <= B <= C <= cur

Re: [Qemu-devel] [RFC] introduce bitmap to bdrv_commit to track dirty sector

2015-03-09 Thread Zhang Haoyu
_start() the unneeded snapshot in source or destination end. So, comparing with above mechanism, what's the advantages of the incremental backup implemented by John and Vladimir? Thanks, Zhang Haoyu On 2015-03-09 15:38:40, Paolo Bonzini wrote: > >On 09/03/2015 08:03, Zhang Haoyu wrot

Re: [Qemu-devel] [RFC] introduce bitmap to bdrv_commit to track dirty sector

2015-03-09 Thread Zhang Haoyu
On 2015-03-03 18:00:09, Paolo Bonzini wrote: > > On 03/03/2015 07:52, Zhang Haoyu wrote: > > Hi, > > If introducing bitmap to bdrv_commit to track dirty sector, > > could we implement guest non-disruption while performing commit? > > That is already implemente

[Qemu-devel] [RFC] introduce bitmap to bdrv_commit to track dirty sector

2015-03-02 Thread Zhang Haoyu
Hi, If introducing bitmap to bdrv_commit to track dirty sector, could we implement guest non-disruption while performing commit? Thanks, Zhang Haoyu

[Qemu-devel] [PATCH] fix mc146818rtc wrong subsection name to avoid vmstate_subsection_load() fail

2015-02-05 Thread Zhang Haoyu
fix mc146818rtc wrong subsection name to avoid vmstate_subsection_load() fail during incoming migration or loadvm. Signed-off-by: Zhang Haoyu --- hw/timer/mc146818rtc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/timer/mc146818rtc.c b/hw/timer/mc146818rtc.c index

Re: [Qemu-devel] [RFC] optimization for qcow2 cache get/put

2015-01-26 Thread Zhang Haoyu
On 2015-01-27 09:24:13, Zhang Haoyu wrote: > > On 2015-01-26 22:11:59, Max Reitz wrote: > >On 2015-01-26 at 08:20, Zhang Haoyu wrote: >> > Hi, all > > > > > > Regarding too large qcow2 image, e.g., 2TB, > > > so long disruption happened when per

Re: [Qemu-devel] [RFC] optimization for qcow2 cache get/put

2015-01-26 Thread Zhang Haoyu
On 2015-01-26 22:11:59, Max Reitz wrote: >On 2015-01-26 at 08:20, Zhang Haoyu wrote: > > Hi, all > > > > Regarding too large qcow2 image, e.g., 2TB, > > so long disruption happened when performing snapshot, >> which was caused by cache update and IO wait.

[Qemu-devel] [RFC] optimization for qcow2 cache get/put

2015-01-26 Thread Zhang Haoyu
, if not found, then the c->entries. Any idea? Thanks, Zhang Haoyu

Re: [Qemu-devel] [question] incremental backup a running vm

2015-01-26 Thread Zhang Haoyu
On 2015-01-26 19:29:03, Paolo Bonzini wrote: > > On 26/01/2015 12:13, Zhang Haoyu wrote: > > Thanks, Paolo, > > but too many internal snapshots were saved by customers, >> switching to external snapshot mechanism has significant impaction > > on subsequent upgrade.

Re: [Qemu-devel] [question] incremental backup a running vm

2015-01-26 Thread Zhang Haoyu
On 2015-01-26 17:29:43, Paolo Bonzini wrote: > > On 26/01/2015 02:07, Zhang Haoyu wrote: > > Hi, Kashyap > > I've tried ‘drive_backup’ via QMP, >> but the snapshots were missed to backup to destination, > > I think the reason is that backup_run() only copy the &

Re: [Qemu-devel] [question] incremental backup a running vm

2015-01-25 Thread Zhang Haoyu
On 2015-01-23 07:30:19, Kashyap Chamarthy wrote: >On Wed, Jan 21, 2015 at 11:39:44AM +0100, Paolo Bonzini wrote: > > > > > > On 21/01/2015 11:32, Zhang Haoyu wrote: > > > Hi, >> > > > > Does drive_mirror support incremental ba

[Qemu-devel] [question] incremental backup a running vm

2015-01-21 Thread Zhang Haoyu
for the changed data. Next time backup, only the dirty data will be mirrored to destination. Even the VM shutdown and start after several days, the bitmap will be loaded while starting vm. Any ideas? Thanks, Zhang Haoyu

Re: [Qemu-devel] [PATCH] spice-char: fix wrong assert condition

2015-01-18 Thread Zhang Haoyu
On 2015-01-17 19:55:16, Peter Maydell wrote: >On 17 January 2015 at 11:52, Peter Maydell wrote: > > On 17 January 2015 at 06:48, Zhang Haoyu wrote: > >> G_IO_OUT|G_IO_HUP are passed from all of the callers > >> of chr_add_watch hooker, the assert condition MUST be &g

[Qemu-devel] [PATCH] spice-char: fix wrong assert condition

2015-01-16 Thread Zhang Haoyu
G_IO_OUT|G_IO_HUP are passed from all of the callers of chr_add_watch hooker, the assert condition MUST be changed. Signed-off-by: Zhang Haoyu --- spice-qemu-char.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spice-qemu-char.c b/spice-qemu-char.c index 7e0d300..b81a9db

Re: [Qemu-devel] question about live migration with storage

2015-01-15 Thread Zhang Haoyu
On 2015-01-15 17:11:49, Paolo Bonzini wrote: > > On 15/01/2015 04:54, Zhang Haoyu wrote: > >>>> > >> 2) Finer-grain control the parameters of block migration (dirty > >>>> > >> bitmap > >>>> > >> granularity). >

Re: [Qemu-devel] question about live migration with storage

2015-01-14 Thread Zhang Haoyu
On 2015-01-14 17:07:08, Paolo Bonzini wrote: > > > On 14/01/2015 08:58, Zhang Haoyu wrote: > >> 2) Finer-grain control the parameters of block migration (dirty bitmap > >> granularity). > >> > >> 3) Block and RAM migration do not share the

Re: [Qemu-devel] question about live migration with storage

2015-01-14 Thread Zhang Haoyu
On 2015-01-14 15:42:41, Paolo Bonzini wrote: > > On 14/01/2015 03:41, Zhang Haoyu wrote: > > Hi, Paolo, > > what's advantages of drive_mirror over traditional mechanism implemented in > > block-migration.c ? > > Why libvirt use drive_mirror instead of traditio

Re: [Qemu-devel] question about live migration with storage

2015-01-13 Thread Zhang Haoyu
On 2015-01-13 17:45:45, Paolo Bonzini wrote: > > On 13/01/2015 03:03, Zhang Haoyu wrote: > > >I want to live migrate a vm with storage, with regard to the migration of > > >storage, > > >should I use drive_mirror or traditional mechanism implemented in > >

Re: [Qemu-devel] question about live migration with storage

2015-01-12 Thread Zhang Haoyu
On 2015-01-13 09:49:00, Zhang Haoyu wrote: >Hi, > >I want to live migrate a vm with storage, with regard to the migration of >storage, >should I use drive_mirror or traditional mechanism implemented in >block-migration.c ? Because I don't use libvirtd to manage vm, if I w

[Qemu-devel] question about live migration with storage

2015-01-12 Thread Zhang Haoyu
Hi, I want to live migrate a vm with storage, with regard to the migration of storage, should I use drive_mirror or traditional mechanism implemented in block-migration.c ? Any advices? Thanks, Zhang Haoyu

Re: [Qemu-devel] How to clone a running vm?

2015-01-12 Thread Zhang Haoyu
On 2015-01-12 15:50:13, Zhang Haoyu wrote: >Hi, > >I want to clone a running vm without shutoff, >can below method work? >1) create a snapshot for the vm >2) create a new qcow2 image from the snapshot, but how? >3) use the new qcow2 image as backing image to clone vms >

[Qemu-devel] How to clone a running vm?

2015-01-11 Thread Zhang Haoyu
Hi, I want to clone a running vm without shutoff, can below method work? 1) create a snapshot for the vm 2) create a new qcow2 image from the snapshot, but how? 3) use the new qcow2 image as backing image to clone vms Any ideas? Thanks, Zhang Haoyu

Re: [Qemu-devel] Does kvm friendly support GPT?

2015-01-11 Thread Zhang Haoyu
On 2014-12-22 09:28:52, Paolo Bonzini wrote: > >On 22/12/2014 07:39, Zhang Haoyu wrote: >> Hi, >> >> When I perform P2V from native servers with win2008 to kvm vm, >> some cases failed due to the physical disk was using GPT for partition, >> and QEMU doesn

Re: [Qemu-devel] vhost-user: migration?

2015-01-09 Thread Zhang Haoyu
Hi, what's the status of migration support for vhost-user? Thanks, Zhang Haoyu On 2014-06-18 22:07:49, Michael S. Tsirkin wrote: > On Wed, Jun 18, 2014 at 04:37:57PM +0300, Nikolay Nikolaev wrote: > > > > > > > > On Wed,

Re: [Qemu-devel] [question] How to get the guest physical memory usage from host?

2014-12-22 Thread Zhang Haoyu
d you detail the peeking techniques mentioned above? >> >> Thanks, >> Zhang Haoyu > > Generally I meant virDomainMemoryPeek, but nothing prevents you to > write code with same functionality, if libvirt usage is not preferred, > it is only about asking monitor for chunks of memory and parse them in > a proper way. > Thanks, Andrey.

Re: [Qemu-devel] cannot receive qemu-dev/kvm-dev mails sent by myself

2014-12-22 Thread Zhang Haoyu
On 2014/12/23 9:36, Fam Zheng wrote: > On Mon, 12/22 20:21, Zhang Haoyu wrote: >> >> On 2014/12/22 20:05, Paolo Bonzini wrote: >>> >>> >>> On 22/12/2014 12:40, Zhang Haoyu wrote: >>>> On 2014/12/22 17:54, Paolo Bonzini wrote: >>>&

Re: [Qemu-devel] cannot receive qemu-dev/kvm-dev mails sent by myself

2014-12-22 Thread Zhang Haoyu
On 2014/12/22 20:05, Paolo Bonzini wrote: > > > On 22/12/2014 12:40, Zhang Haoyu wrote: >> On 2014/12/22 17:54, Paolo Bonzini wrote: >>> >>> >>> On 22/12/2014 10:48, Zhang Haoyu wrote: >>>> Hi, >>>> >>>> I cannot re

Re: [Qemu-devel] cannot receive qemu-dev/kvm-dev mails sent by myself

2014-12-22 Thread Zhang Haoyu
On 2014/12/22 17:54, Paolo Bonzini wrote: > > > On 22/12/2014 10:48, Zhang Haoyu wrote: >> Hi, >> >> I cannot receive qemu-dev/kvm-dev mails sent by myself, >> but mails from others can be received, >> any helps? > > For qemu-devel, you need to conf

Re: [Qemu-devel] Does kvm friendly support GPT?

2014-12-22 Thread Zhang Haoyu
On 2014/12/22 17:52, Paolo Bonzini wrote: > > > On 22/12/2014 10:40, Zhang Haoyu wrote: >>> 2) the FAT driver is not free, which prevents distribution in Fedora and >>> several other distributions >>> >> Sorry, I cannot follow you, >> the "

[Qemu-devel] cannot receive qemu-dev/kvm-dev mails sent by myself

2014-12-22 Thread Zhang Haoyu
Hi, I cannot receive qemu-dev/kvm-dev mails sent by myself, but mails from others can be received, any helps? Thanks, Zhang Haoyu

Re: [Qemu-devel] Does kvm friendly support GPT?

2014-12-22 Thread Zhang Haoyu
On 2014/12/22 17:28, Paolo Bonzini wrote: > > > On 22/12/2014 07:39, Zhang Haoyu wrote: >> Hi, >> >> When I perform P2V from native servers with win2008 to kvm vm, >> some cases failed due to the physical disk was using GPT for partition, >> and QEMU doesn

Re: [Qemu-devel] [question] How to get the guest physical memory usage from host?

2014-12-22 Thread Zhang Haoyu
On 2014/12/22 17:16, Andrey Korolyov wrote: > On Mon, Dec 22, 2014 at 11:57 AM, Zhang Haoyu > wrote: >> >> On 2014/12/22 16:41, Andrey Korolyov wrote: >>> On Mon, Dec 22, 2014 at 6:59 AM, Zhang Haoyu >>> wrote: >>>> Hi, >>>> >&

Re: [Qemu-devel] [question] How to get the guest physical memory usage from host?

2014-12-22 Thread Zhang Haoyu
On 2014/12/22 16:41, Andrey Korolyov wrote: > On Mon, Dec 22, 2014 at 6:59 AM, Zhang Haoyu > wrote: >> Hi, >> >> How to get the guest physical memory usage from host? >> I don't want to introduce a guest-agent to get the info. >> >> Thanks, >&

Re: [Qemu-devel] [PATCH] support vhost-user socket to reconnect

2014-12-21 Thread Zhang Haoyu
Hi, Kun Is this patch one of patch series? I don't see any place to reference "is_reconnect" field. On 2014/12/22 15:06, zhangkun wrote: > From: zhangkun > > Signed-off-by: zhangkun > --- > net/vhost-user.c | 10 +- > 1 file changed, 9 insertions(+), 1 deletion(-) > > diff --git a/ne

[Qemu-devel] Does kvm friendly support GPT?

2014-12-21 Thread Zhang Haoyu
/OVMF But, it seems that OVMF is not stable enough for kvm. Any advises? Thanks, Zhang Haoyu

[Qemu-devel] [question] How to get the guest physical memory usage from host?

2014-12-21 Thread Zhang Haoyu
Hi, How to get the guest physical memory usage from host? I don't want to introduce a guest-agent to get the info. Thanks, Zhang Haoyu

[Qemu-devel] [question] kvm fully support vga adapter pass-through ?

2014-11-18 Thread Zhang Haoyu
Hi all, Does the combination of qemu-2.0.1 and linux-3.10 fully support direct-assign vga adapters to vm? Thanks, Zhang Haoyu

Re: [Qemu-devel] Where is the VM live migration code?

2014-11-17 Thread Zhang Haoyu
> Hi, > > I saw this page: > > http://www.linux-kvm.org/page/Migration. > > It looks like Migration is a feature provided by KVM? But when I look > at the Linux kernel source code, i.e., virt/kvm, and arch/x86/kvm, I > don't see the code for this migration feature. > Most of live migration code

Re: [Qemu-devel] [question] updating the base image for all clones which have been running for months

2014-11-06 Thread Zhang Haoyu
nt to install some applications for all of the clones, >>>> what should I do? > >How would you do it for bare metal? Do the same for your guests. > For bare-metal, I use manager to push the applications to each host-agent which is running in each host, the host-agent is resp

[Qemu-devel] [PATCH] qcow2-cache: conditionally call bdrv_flush() in qcow2_cache_flush()

2014-11-06 Thread Zhang Haoyu
Needless to call bdrv_flush() in qcow2_cache_flush() if no cache entry is dirty. Signed-off-by: Zhang Haoyu --- block/qcow2-cache.c | 24 +--- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/block/qcow2-cache.c b/block/qcow2-cache.c index 904f6b1..09ee155

Re: [Qemu-devel] [question] updating the base image for all clones which havebeen running for months

2014-11-03 Thread Zhang Haoyu
t should I do? > >Install the applications on each clone separately, or use some other >method to make it available (like installing on a shared network >resource). > Could you detail "installing on a shared network resource"? Thanks, Zhang Haoyu >> Can I rebase ima

[Qemu-devel] [question] updating the base image for all clones which have been running for months

2014-11-03 Thread Zhang Haoyu
agent, which is responsible to install the applications. Thanks, Zhang Haoyu

[Qemu-devel] [question] How is the progress of optimizing qcow2_check_metadata_overlap() with reagard to cpu overhead?

2014-10-25 Thread Zhang Haoyu
Hi, Max How is the progress of optimizing qcow2_check_metadata_overlap? http://thread.gmane.org/gmane.comp.emulators.kvm.devel/127037/focus=127364 Thanks, Zhang Haoyu

[Qemu-devel] [PATCH v5] snapshot: use local variable to bdrv_pwrite_sync L1 table

2014-10-22 Thread Zhang Haoyu
Use local variable to bdrv_pwrite_sync L1 table, needless to make conversion of cached L1 table between big-endian and host style. Signed-off-by: Zhang Haoyu Reviewed-by: Max Reitz --- v4 -> v5: - delete superfluous check of "l1_size2 != 0" after qemu_try_blockalign(l1_siz

Re: [Qemu-devel] [PATCH v4] snapshot: use local variable to bdrv_pwrite_syncL1 table

2014-10-22 Thread Zhang Haoyu
>> Use local variable to bdrv_pwrite_sync L1 table, >> needless to make conversion of cached L1 table between >> big-endian and host style. >> >> Signed-off-by: Zhang Haoyu >> Reviewed-by: Max Reitz >> --- >> v3 -> v4: >> - convert lo

[Qemu-devel] [PATCH v4] snapshot: use local variable to bdrv_pwrite_sync L1 table

2014-10-22 Thread Zhang Haoyu
Use local variable to bdrv_pwrite_sync L1 table, needless to make conversion of cached L1 table between big-endian and host style. Signed-off-by: Zhang Haoyu Reviewed-by: Max Reitz --- v3 -> v4: - convert local L1 table to host-style before copy it back to s->l1_table v2 -> v3:

Re: [Qemu-devel] [Qemu-trivial] [PATCH v3] snapshot: use local variable to bdrv_pwrite_sync L1 table

2014-10-21 Thread Zhang Haoyu
>Use local variable to bdrv_pwrite_sync L1 table, >needless to make conversion of cached L1 table between >big-endian and host style. > >Signed-off-by: Zhang Haoyu >Reviewed-by: Max Reitz >--- >v2 -> v3: > - replace g_try_malloc0 with qemu_try_blockalign > - co

[Qemu-devel] [PATCH v3] snapshot: use local variable to bdrv_pwrite_sync L1 table

2014-10-21 Thread Zhang Haoyu
Use local variable to bdrv_pwrite_sync L1 table, needless to make conversion of cached L1 table between big-endian and host style. Signed-off-by: Zhang Haoyu Reviewed-by: Max Reitz --- v2 -> v3: - replace g_try_malloc0 with qemu_try_blockalign - copy the latest local L1 table back t

Re: [Qemu-devel] [Qemu-stable] [PATCH v2] snapshot: use local variable tobdrv_pwrite_sync L1 table

2014-10-21 Thread Zhang Haoyu
>> Use local variable to bdrv_pwrite_sync L1 table, >> needless to make conversion of cached L1 table between >> big-endian and host style. >> >> Signed-off-by: Zhang Haoyu >> --- >> v1 -> v2: >> - remove the superflous assignment, l1_table =

[Qemu-devel] [PATCH v2] snapshot: use local variable to bdrv_pwrite_sync L1 table

2014-10-21 Thread Zhang Haoyu
Use local variable to bdrv_pwrite_sync L1 table, needless to make conversion of cached L1 table between big-endian and host style. Signed-off-by: Zhang Haoyu --- v1 -> v2: - remove the superflous assignment, l1_table = NULL; - replace 512 with BDRV_SECTOR_SIZE, and align_offset with ROUND

Re: [Qemu-devel] [PATCH] snapshot: use local variable to bdrv_pwrite_syncL1 table

2014-10-21 Thread Zhang Haoyu
>> Use local variable to bdrv_pwrite_sync L1 table, >> needless to make conversion of cached L1 table between >> big-endian and host style. >> >> Signed-off-by: Zhang Haoyu >> --- >> block/qcow2-refcount.c | 22 +++--- >>

Re: [Qemu-devel] [question] savevm/delvm: Is it necessary to performbdrv_drain_all before savevm and delvm?

2014-10-21 Thread Zhang Haoyu
hot_delete()? >> Both deleting snapshot and the coroutine of pending io >> read/write(bdrv_co_do_rw) >> are performed in main thread, could BDRVQcowState.lock work? > >Yes. s->lock is not a mutex for threads, but a coroutine based one. > Yes, you are right. >The probl

[Qemu-devel] [PATCH bugfix] snapshot: add bdrv_drain_all() to bdrv_snapshot_delete() to avoid concurrency problem

2014-10-21 Thread Zhang Haoyu
() to bdrv_snapshot_delete() to avoid this problem. Signed-off-by: Zhang Haoyu --- block/snapshot.c | 4 1 file changed, 4 insertions(+) diff --git a/block/snapshot.c b/block/snapshot.c index 85c52ff..ebc386a 100644 --- a/block/snapshot.c +++ b/block/snapshot.c @@ -236,6 +236,10 @

[Qemu-devel] [PATCH] snapshot: use local variable to bdrv_pwrite_sync L1 table

2014-10-21 Thread Zhang Haoyu
Use local variable to bdrv_pwrite_sync L1 table, needless to make conversion of cached L1 table between big-endian and host style. Signed-off-by: Zhang Haoyu --- block/qcow2-refcount.c | 22 +++--- 1 file changed, 7 insertions(+), 15 deletions(-) diff --git a/block/qcow2

Re: [Qemu-devel] [question] savevm/delvm: Is it necessary to perform bdrv_drain_all before savevm and delvm?

2014-10-20 Thread Zhang Haoyu
blem mentioned above, please see the discussing mail. >I do see that there might be a chance of concurrency, but that doesn't >automatically mean the requests are conflicting. > >Would you feel better with taking s->lock in qcow2_snapshot_delete()? Both deleting snapshot and the coroutine of pending io read/write(bdrv_co_do_rw) are performed in main thread, could BDRVQcowState.lock work? Thanks, Zhang Haoyu >This might actually be a valid concern. > >Kevin

Re: [Qemu-devel] [question] savevm/delvm: Is it necessary to perform bdrv_drain_all before savevm and delvm?

2014-10-20 Thread Zhang Haoyu
s? This coroutine is also in main thread. Am I missing something? Thanks, Zhang Haoyu >Kevin

[Qemu-devel] [question] savevm/delvm: Is it neccesary to perform bdrv_drain_all before savevm and delvm?

2014-10-20 Thread Zhang Haoyu
Hi, I noticed that bdrv_drain_all is performed in load_vmstate before bdrv_snapshot_goto, and bdrv_drain_all is performed in qmp_transaction before internal_snapshot_prepare, so is it also neccesary to perform bdrv_drain_all in savevm and delvm? Thanks, Zhang Haoyu

Re: [Qemu-devel] [question] is it possible that big-endian l1tableoffsetreferencedby other I/O while updating l1 table offset inqcow2_update_snapshot_refcount?

2014-10-13 Thread Zhang Haoyu
gt;>>>>> introducing another local buffer should mitigate the problem, if there >>>>>>> is any. >>>>>>> >>>>>> l1_table is not necessarily a local variable to >>>>>> qcow2_update_snapshot_refcount, >&

Re: [Qemu-devel] [question] is it possible that big-endian l1 tableoffsetreferencedby other I/O while updating l1 table offset in qcow2_update_snapshot_refcount?

2014-10-13 Thread Zhang Haoyu
l1_size2); >>>>>> >>>>>>free(tmp_l1_table); >>>>>>} >>>>> l1_table is already a local variable (local to >>>>> qcow2_update_snapshot_refcount()), so I can't really imagine how >>>>

Re: [Qemu-devel] [question] is it possible that big-endian l1 tableoffsetreferenced by other I/O while updating l1 table offset in qcow2_update_snapshot_refcount?

2014-10-13 Thread Zhang Haoyu
to >> qcow2_update_snapshot_refcount, >> which depends on condition of "if (l1_table_offset != s->l1_table_offset)", >> if the condition not true, l1_table = s->l1_table. > >Oh, yes, you're right. Okay, so in theory nothing should happen anyway, >because qcow2 does not have to be reentrant (so s->l1_table will not be >accessed while it's big endian and therefore possibly not in CPU order). Could you detail how qcow2 does not have to be reentrant? In below stack, qcow2_update_snapshot_refcount |- cpu_to_be64s(&l1_table[i]) |- bdrv_pwrite_sync |-- bdrv_pwrite |--- bdrv_pwritev | bdrv_prwv_co |- aio_poll(aio_context) <== this aio_context is qemu_aio_context |-- aio_dispatch |--- bdrv_co_io_em_complete | qemu_coroutine_enter(co->coroutine, NULL); <== coroutine entry is bdrv_co_do_rw bdrv_co_do_rw will access l1_table to perform I/O operation. Thanks, Zhang Haoyu >But I find it rather ugly to convert the cached L1 table to big endian, >so I'd be fine with the patch you proposed. > >Max

Re: [Qemu-devel] [question] is it possible that big-endian l1 tableoffset referenced by other I/O while updating l1 table offset in qcow2_update_snapshot_refcount?

2014-10-12 Thread Zhang Haoyu
bdrv_pwrite_sync(bs->file, l1_table_offset, tmp_l1_table, >> l1_size2); >> >> free(tmp_l1_table); >> } > >l1_table is already a local variable (local to >qcow2_update_snapshot_refcount()), so I can't really imagine how >introducing another local buffer should mitigate the problem, if there >is any. > l1_table is not necessarily a local variable to qcow2_update_snapshot_refcount, which depends on condition of "if (l1_table_offset != s->l1_table_offset)", if the condition not true, l1_table = s->l1_table. Thanks, Zhang Haoyu >Max

Re: [Qemu-devel] [PATCH] qcow2: fix double-free of Qcow2DiscardRegion in qcow2_process_discards

2014-10-12 Thread Zhang Haoyu
On 2014-10-12 15:34, Kevin Wolf wrote: Am 11.10.2014 um 09:14 hat Zhang Haoyu geschrieben: In qcow2_update_snapshot_refcount -> qcow2_process_discards() -> bdrv_discard() may free the Qcow2DiscardRegion which is referenced by "next" pointer in qcow2_process_discards() now, in n

[Qemu-devel] [PATCH] qcow2: fix leak of Qcow2DiscardRegion in update_refcount_discard

2014-10-11 Thread Zhang Haoyu
When the Qcow2DiscardRegion is adjacent to another one referenced by "d", free this Qcow2DiscardRegion metadata referenced by "p" after it was removed from s->discards queue. Signed-off-by: Zhang Haoyu --- block/qcow2-refcount.c | 1 + 1 file changed, 1 insertion(+) d

[Qemu-devel] [PATCH] qcow2: fix double-free of Qcow2DiscardRegion in qcow2_process_discards

2014-10-11 Thread Zhang Haoyu
d_pwritev | qcow2_co_writev |- qcow2_alloc_cluster_link_l2 |-- qcow2_free_any_clusters |--- qcow2_free_clusters | update_refcount |- qcow2_process_discards |-- g_free(d) <== In next iteration, this Qcow2DiscardRegion will be double-free. Signed-off-by: Zhang Haoyu Signed-o

Re: [Qemu-devel] [question] Is there a plan to introduce a unified co-scheduling mechanism to CFS ?

2014-10-10 Thread Zhang Haoyu
ve degree can be used to decide the threshold of which vcpus belong to the same gang, just a wild thought. > Regards, > Wanpeng Li >> >> Thanks, >> Zhang Haoyu

[Qemu-devel] [question] Is there a plan to introduce a unified co-scheduling mechanism to CFS ?

2014-10-10 Thread Zhang Haoyu
/task is running in guest. Is there a plane for this work? Thanks, Zhang Haoyu

Re: [Qemu-devel] [question] is it possible that big-endian l1 table offset referenced by other I/O while updating l1 table offset in qcow2_update_snapshot_refcount?

2014-10-09 Thread Zhang Haoyu
tmp_l1_table, l1_table, l1_size * sizeof(uint64_t)); for (i = 0; i < l1_size; i++) { cpu_to_be64s(&tmp_l1_table[i]); } ret = bdrv_pwrite_sync(bs->file, l1_table_offset, tmp_l1_table, l1_size2); free(tmp_l1_table); } Thanks, Zhang Haoyu

[Qemu-devel] [question] is it posssible that big-endian l1 table offset referenced by other I/O while updating l1 table offset in qcow2_update_snapshot_refcount?

2014-10-09 Thread Zhang Haoyu
offset (very large value), so the file is truncated to very large. Any ideas? Thanks, Zhang Haoyu

[Qemu-devel] [PATCH bugfix v2] snapshot: fix referencing wrong variable in while loop in do_delvm

2014-09-29 Thread Zhang Haoyu
The while loop variabal is "bs1", but "bs" is always passed to bdrv_snapshot_delete_by_id_or_name. Broken in commit a89d89d, v1.7.0. v1 -> v2: * add broken commit id to commit message Signed-off-by: Zhang Haoyu Reviewed-by: Markus Armbruster --- savevm.c | 11 +--

[Qemu-devel] [PATCH bugfix] snapshot: fix referencing wrong variable in while loop in do_delvm

2014-09-29 Thread Zhang Haoyu
The while loop variabal is "bs1", but "bs" is always passed to bdrv_snapshot_delete_by_id_or_name. Signed-off-by: Zhang Haoyu --- savevm.c | 11 +-- 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/savevm.c b/savevm.c index e19ae0a..2d8eb96 100644

Re: [Qemu-devel] [question] virtio-blk performancedegradationhappened with virito-serial

2014-09-22 Thread Zhang Haoyu
be virtio_console. > >Looks like the ppoll takes more time to poll more fds. > >Some trace data with systemtap: > >12 fds: > >time rel_time symbol >15 (+1) qemu_poll_ns [enter] >18(+3) qemu_poll_ns [return] > >76 fd: > &g

Re: [Qemu-devel] [question] virtio-blk performance degradation happened with virito-serial

2014-09-16 Thread Zhang Haoyu
rtio_console driver in guest, to see whether there is difference in virtio-blk performance and cpu usage. 2. Does not emulate virito-serial deivce, then install virtio_balloon driver (and also dose not emulate virtio-balloon device), to see whether virtio-blk performance degradation will happen. 3. Emulating virtio-balloon device instead of virtio-serial deivce , then to see whether the virtio-blk performance is hampered. Base on the test result, corresponding analysis will be performed. Any ideas? Thanks, Zhang Haoyu

Re: [Qemu-devel] [question] virtio-blk performance degradation happened with virito-serial

2014-09-11 Thread Zhang Haoyu
ical Slot: 18 >Control: I/O+ Mem+ BusMaster- SpecCycle- MemWINV- VGASnoop- ParErr- > Stepping- SERR+ FastB2B- DisINTx+ >Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort- > SERR- Interrupt: pin A routed to IRQ 10 >Region 0: I/O ports at c0c0 [size=32] >Region 1: Memory at febd4000 (32-bit, non-prefetchable) [size=4K] >Expansion ROM at feb8 [disabled] [size=256K] >Capabilities: [40] MSI-X: Enable+ Count=3 Masked- >Vector table: BAR=1 offset= >PBA: BAR=1 offset=0800 >Kernel driver in use: virtio-pci >Kernel modules: virtio_pci > >Thanks, >Zhang Haoyu

[Qemu-devel] [PATCH v2] kvm: ioapic: conditionally delay irq delivery duringeoi broadcast

2014-09-11 Thread Zhang Haoyu
e missing "}" for if (ioapic->irq_eoi[i] == IOAPIC_SUCCESSIVE_IRQ_MAX_COUNT) { Cc: Michael S. Tsirkin Cc: Jan Kiszka Signed-off-by: Jason Wang Signed-off-by: Zhang Haoyu --- include/trace/events/kvm.h | 20 +++ virt/kvm/ioapic.c | 50 +++

Re: [Qemu-devel] [PATCH] kvm: ioapic: conditionally delay irq delivery during eoi broadcast

2014-09-11 Thread Zhang Haoyu
no suitable irq handler in case it may >> register one very soon and for guest who has a bad irq detection routine ( >> such >> as note_interrupt() in linux ), this bad irq would be recognized soon as in >> the >> past. >

[Qemu-devel] [PATCH] kvm: ioapic: conditionally delay irq delivery duringeoi broadcast

2014-09-11 Thread Zhang Haoyu
o suitable irq handler in case it may register one very soon and for guest who has a bad irq detection routine ( such as note_interrupt() in linux ), this bad irq would be recognized soon as in the past. Cc: Michael S. Tsirkin Signed-off-by: Jason Wang Signed-off-by: Zhang Haoyu --- includ

Re: [Qemu-devel] [PATCH] kvm: ioapic: conditionally delay irq delivery duringeoi broadcast

2014-09-11 Thread Zhang Haoyu
>> such >> as note_interrupt() in linux ), this bad irq would be recognized soon as in >> the >> past. >> >> Cc: Michael S. Tsirkin >> Signed-off-by: Jason Wang >> Signed-off-by: Zhang Haoyu >> --- >> include/trace/events/kvm.h

[Qemu-devel] [PATCH] kvm: ioapic: conditionally delay irq delivery during eoi broadcast

2014-09-10 Thread Zhang Haoyu
o suitable irq handler in case it may register one very soon and for guest who has a bad irq detection routine ( such as note_interrupt() in linux ), this bad irq would be recognized soon as in the past. Cc: Michael S. Tsirkin Signed-off-by: Jason Wang Signed-off-by: Zhang Haoyu --- includ

Re: [Qemu-devel] [PATCH] kvm: ioapic: conditionally delay irq delivery during eoi broadcast

2014-09-10 Thread Zhang Haoyu
o has a bad irq detection routine ( such as note_interrupt() in linux ), this bad irq would be recognized soon as in the past. Cc: Michael S. Tsirkin Signed-off-by: Jason Wang Signed-off-by: Zhang Haoyu --- include/trace/events/kvm.h | 20 ++ virt/kvm/ioapic.c | 51

[Qemu-devel] [PATCH] kvm: ioapic: conditionally delay irq delivery during eoi broadcast

2014-09-10 Thread Zhang Haoyu
o suitable irq handler in case it may register one very soon and for guest who has a bad irq detection routine ( such as note_interrupt() in linux ), this bad irq would be recognized soon as in the past. Cc: Michael S. Tsirkin Signed-off-by: Jason Wang Signed-off-by: Zhang Haoyu --- includ

Re: [Qemu-devel] [question] virtio-blk performance degradationhappenedwith virito-serial

2014-09-07 Thread Zhang Haoyu
Hi, Paolo, Amit, any ideas? Thanks, Zhang Haoyu On 2014-9-4 15:56, Zhang Haoyu wrote: >>>>> If virtio-blk and virtio-serial share an IRQ, the guest operating system >>>>> has to check each virtqueue for activity. Maybe there is some >>>>> ineff

[Qemu-devel] [question] git clone kvm.git failed

2014-09-04 Thread Zhang Haoyu
7;include/linux/unaligned': File too large How to resolve these errors? Thanks, Zhang Haoyu

Re: [Qemu-devel] [question] virtio-blk performance degradationhappenedwith virito-serial

2014-09-04 Thread Zhang Haoyu
>> > > If virtio-blk and virtio-serial share an IRQ, the guest operating system >> > > has to check each virtqueue for activity. Maybe there is some >> > > inefficiency doing that. >> > > AFAIK virtio-serial registers 64 virtqueues (on 31 ports + console) even >> > > if everything is unused. >>

Re: [Qemu-devel] [question] e1000 interrupt stormhappenedbecauseofits correspondingioapic->irr bit always set

2014-09-03 Thread Zhang Haoyu
> >+* possibility to get proper irq handler >> >+* registered. So we need to give some breath to >> >+* guest. TODO: 1 is too long? >> >+*/ >> >+

Re: [Qemu-devel] [question] virtio-blk performancedegradationhappened with virito-serial

2014-09-03 Thread Zhang Haoyu
got back again, very obvious. >> add comments: >> Although the virtio-serial is enabled, I don't use it at all, the >> degradation still happened. > >Using the vectors= option as mentioned below, you can restrict the >number of MSI vectors the virtio-serial device gets. Yo

Re: [Qemu-devel] [question] virtio-blk performancedegradationhappened with virito-serial

2014-09-01 Thread Zhang Haoyu
? >> >> I am going to observe the difference of perf top data on qemu and perf kvm >> stat data when disable/enable virtio-serial in guest, >> and the difference of perf top data on guest when disable/enable >> virtio-serial in guest, >> any ideas? > >So it's a windows guest; it could be something windows driver >specific, then? Do you see the same on Linux guests too? > I suspect windows driver specific, too. I have not test linux guest, I'll test it later. Thanks, Zhang Haoyu > Amit

Re: [Qemu-devel] [question] virtio-blk performance degradationhappened with virito-serial

2014-09-01 Thread Zhang Haoyu
oing to observe the difference of perf top data on qemu and perf kvm >stat data when disable/enable virtio-serial in guest, >and the difference of perf top data on guest when disable/enable virtio-serial >in guest, >any ideas? > >Thanks, >Zhang Haoyu >>If you restrict the number of vectors the virtio-serial device gets >>(using the -device virtio-serial-pci,vectors= param), does that make >>things better for you? >> >> >> Amit

Re: [Qemu-devel] [question] virtio-blk performance degradationhappened with virito-serial

2014-09-01 Thread Zhang Haoyu
, I think it has no business with legacy interrupt mode, right? I am going to observe the difference of perf top data on qemu and perf kvm stat data when disable/enable virtio-serial in guest, and the difference of perf top data on guest when disable/enable virtio-serial in guest, any ideas?

[Qemu-devel] [question] virtio-blk performance degradation happened with virito-serial

2014-08-29 Thread Zhang Haoyu
,base=localtime -global kvm-pit.lost_tick_policy=discard -global PIIX4_PM.disable_s3 =1 -global PIIX4_PM.disable_s4=1 Any ideas? Thanks, Zhang Haoyu

Re: [Qemu-devel] [question] e1000 interrupt storm happenedbecauseofitscorrespondingioapic->irr bit always set

2014-08-28 Thread Zhang Haoyu
Hi, Yang, Gleb, Michael, Could you help review below patch please? Thanks, Zhang Haoyu >> Hi Jason, >> I tested below patch, it's okay, the e1000 interrupt storm disappeared. >> But I am going to make a bit change on it, could you help review it? >> >>

Re: [Qemu-devel] [question] e1000 interrupt storm happenedbecauseofits correspondingioapic->irr bit always set

2014-08-28 Thread Zhang Haoyu
= 0; ++ ioapic->irq_eoi[i] = 0; >+ } else { >+ ioapic_service(ioapic, i); >+ } >+ } ++ else { ++ ioapic->irq_eoi[i] = 0; ++

Re: [Qemu-devel] [question] e1000 interrupt storm happened becauseofits correspondingioapic->irr bit always set

2014-08-27 Thread Zhang Haoyu
tual interrupt injection sometimes, >> then some time delay sensitive applications will be impacted? > >I don't test it too much but it only give a minor delay of 1% irq in the >hope of guest irq handler will be registered shortly. But I suspect it's >the bug of e1000 who inject the irq in the wrong time. Under what cases >did you meet this issue? Some scenarios, not constant and 100% reproducity, e.g., reboot vm, ifdown e1000 nic, install kaspersky(network configuration is performed during installing stage), .etc. Thanks, Zhang Haoyu >> >> Thanks, >> Zhang Haoyu

Re: [Qemu-devel] [PULL 3/3] vnc: fix screen updates

2014-08-26 Thread Zhang Haoyu
return n; } if (vs->csock == -1) { vnc_disconnect_finish(vs); } else if (sync) { vnc_jobs_join(vs); } -return 0; +return n; Thanks, Zhang Haoyu

  1   2   >