[Qemu-devel] [PATCH] migration: rename migration_bitmap_sync_range to ramblock_sync_dirty_bitmap

2019-07-18 Thread Wei Yang
Rename for better understanding of the code. Suggested-by: Paolo Bonzini Signed-off-by: Wei Yang --- migration/ram.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/migration/ram.c b/migration/ram.c index c5f9f4b0ef..66792568e2 100644 --- a/migration/ram.c +++ b

[Qemu-devel] [PATCH] migration: use migration_in_postcopy() to check POSTCOPY_ACTIVE

2019-07-19 Thread Wei Yang
Use common helper function to check the state. Signed-off-by: Wei Yang --- migration/rdma.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/migration/rdma.c b/migration/rdma.c index 3036221ee8..0e73e759ca 100644 --- a/migration/rdma.c +++ b/migration/rdma.c @@ -3140,7

Re: [Qemu-devel] [PATCH] migration: remove unused field bytes_xfer

2019-07-19 Thread Wei Yang
On Fri, Jul 19, 2019 at 07:05:44PM +0100, Dr. David Alan Gilbert wrote: >* Wei Yang (richardw.y...@linux.intel.com) wrote: >> On Tue, Jun 11, 2019 at 10:33:29AM +0200, Juan Quintela wrote: >> >Wei Yang wrote: >> >> On Tue, Apr 02, 2019 at 08:31:06AM +0800, Wei Ya

Re: [Qemu-devel] [PATCH] migration: current_migration is never NULL

2019-07-19 Thread Wei Yang
On Fri, Jul 19, 2019 at 04:10:02PM +0100, Dr. David Alan Gilbert wrote: >* Wei Yang (richardw.y...@linux.intel.com) wrote: >> migration_object_init() create and assign current_migration, which means >> it will never be null until migration_shutdown(). >> >&

Re: [Qemu-devel] [PATCH 1/3] migration/savevm: flush file for iterable_only case

2019-07-19 Thread Wei Yang
On Fri, Jul 19, 2019 at 05:47:59PM +0100, Dr. David Alan Gilbert wrote: >* Wei Yang (richardw.y...@linux.intel.com) wrote: >> It would be proper to flush file even for iterable_only case. >> >> Signed-off-by: Wei Yang > >OK, I don't think this is actually ne

Re: [Qemu-devel] [PATCH 3/3] migration/savevm: move non SaveStateEntry condition check out of iteration

2019-07-19 Thread Wei Yang
On Fri, Jul 19, 2019 at 05:59:50PM +0100, Dr. David Alan Gilbert wrote: >* Wei Yang (richardw.y...@linux.intel.com) wrote: >> in_postcopy and iterable_only are not SaveStateEntry specific, it would >> be more proper to check them out of iteration. >> >> Signed-off-by:

Re: [Qemu-devel] [PATCH] migration/postcopy: use static PostcopyDiscardState instead of allocating it for each block

2019-07-19 Thread Wei Yang
On Fri, Jul 19, 2019 at 06:41:28PM +0100, Dr. David Alan Gilbert wrote: >* Wei Yang (richardw.y...@linux.intel.com) wrote: >> Even we need to do discard for each RAMBlock, we still can leverage the >> same memory space to store the information. >> >> By doing so, we

Re: [Qemu-devel] [PATCH] migration: equation is more proper than and to check LOADVM_QUIT

2019-07-19 Thread Wei Yang
On Fri, Jul 19, 2019 at 07:41:28PM +0100, Dr. David Alan Gilbert wrote: >* Wei Yang (richardw.y...@linux.intel.com) wrote: >> LOADVM_QUIT allows a command to quit all layers of nested loadvm loops, >> while current return value check is not that proper even it works now. >&g

[Qemu-devel] [PATCH] migration/postcopy: use mis->bh instead of allocating a QEMUBH

2019-07-20 Thread Wei Yang
For migration incoming side, it either quit in precopy or postcopy. It is save to use the mis->bh for both instead of allocating a dedicated QEMUBH for postcopy. Signed-off-by: Wei Yang --- migration/savevm.c | 17 - 1 file changed, 4 insertions(+), 13 deletions(-) diff --gi

Re: [Qemu-devel] [PATCH v3 1/2] bitmap: get last word mask from nr directly

2019-07-20 Thread Wei Yang
On Thu, Jul 18, 2019 at 09:04:55AM +0800, Wei Yang wrote: >The value left in nr is the number of bits for the last word, which >could be calculate the last word mask directly. > >Remove the unnecessary size. > May I ask why Patch 2 is picked up, but this one is not? >Signe

Re: [Qemu-devel] [PATCH v3 1/2] bitmap: get last word mask from nr directly

2019-07-21 Thread Wei Yang
On Sun, Jul 21, 2019 at 07:27:14PM +0200, Paolo Bonzini wrote: >On 21/07/19 02:33, Wei Yang wrote: >> On Thu, Jul 18, 2019 at 09:04:55AM +0800, Wei Yang wrote: >>> The value left in nr is the number of bits for the last word, which >>> could be calculate the last word ma

[Qemu-devel] [PATCH] migration/multifd: multifd_load_cleanup() always return 0

2019-07-21 Thread Wei Yang
multifd_load_cleanup() always return 0 and never use the errp, just cleanup a little. Signed-off-by: Wei Yang --- migration/migration.c | 9 ++--- migration/ram.c | 7 +++ migration/ram.h | 2 +- 3 files changed, 6 insertions(+), 12 deletions(-) diff --git a/migration

Re: [Qemu-devel] [PATCH] migration/postcopy: use static PostcopyDiscardState instead of allocating it for each block

2019-07-21 Thread Wei Yang
On Fri, Jul 19, 2019 at 06:41:28PM +0100, Dr. David Alan Gilbert wrote: >* Wei Yang (richardw.y...@linux.intel.com) wrote: >> Even we need to do discard for each RAMBlock, we still can leverage the >> same memory space to store the information. >> >> By doing so, we

[Qemu-devel] [PATCH 1/2] migration: return -EINVAL directly when version_id mismatch

2019-07-22 Thread Wei Yang
It is not reasonable to continue when version_id mismatch. Signed-off-by: Wei Yang --- migration/ram.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/migration/ram.c b/migration/ram.c index 7e34c82a72..6bfdfae16e 100644 --- a/migration/ram.c +++ b/migration/ram.c @@ -4216,7

[Qemu-devel] [PATCH 0/2] migration: cleanup ram_load

2019-07-22 Thread Wei Yang
Two cleanup for ram_load: * return -EINVAL for version_id mismatch * extract ram_load_precopy for better readability Wei Yang (2): migration: return -EINVAL directly when version_id mismatch migration: extract ram_load_precopy migration/ram.c | 73

[Qemu-devel] [PATCH 2/2] migration: extract ram_load_precopy

2019-07-22 Thread Wei Yang
After cleanup, it would be clear to audience there are two cases ram_load: * precopy * postcopy And it is not necessary to check postcopy_running on each iteration for precopy. Signed-off-by: Wei Yang --- migration/ram.c | 73 +++-- 1 file

Re: [Qemu-devel] [PATCH] migration/postcopy: use static PostcopyDiscardState instead of allocating it for each block

2019-07-23 Thread Wei Yang
On Tue, Jul 23, 2019 at 04:42:12PM +0100, Dr. David Alan Gilbert wrote: >* Wei Yang (richardw.y...@linux.intel.com) wrote: >> On Fri, Jul 19, 2019 at 06:41:28PM +0100, Dr. David Alan Gilbert wrote: >> >* Wei Yang (richardw.y...@linux.intel.com) wrote: >> >> Even

[Qemu-devel] [Patch v2] migration/postcopy: make PostcopyDiscardState a static variable

2019-07-23 Thread Wei Yang
their users Signed-off-by: Wei Yang --- v2: * make it a static variable, suggested by Dave --- migration/postcopy-ram.c | 70 +--- migration/postcopy-ram.h | 13 +++- migration/ram.c | 30 +++-- 3 files changed, 46 insertions(+), 67

Re: [Qemu-devel] [PATCH] migration/postcopy: use mis->bh instead of allocating a QEMUBH

2019-07-23 Thread Wei Yang
On Tue, Jul 23, 2019 at 06:23:53PM +0100, Dr. David Alan Gilbert wrote: >* Wei Yang (richardw.y...@linux.intel.com) wrote: >> For migration incoming side, it either quit in precopy or postcopy. It >> is save to use the mis->bh for both instead of allocating a dedicated >

Re: [Qemu-devel] [PATCH] migration/multifd: multifd_load_cleanup() always return 0

2019-07-23 Thread Wei Yang
On Tue, Jul 23, 2019 at 04:39:08PM +0100, Dr. David Alan Gilbert wrote: >* Wei Yang (richardw.y...@linux.intel.com) wrote: >> multifd_load_cleanup() always return 0 and never use the errp, just >> cleanup a little. >> >> Signed-off-by: Wei Yang > >I'd rath

Re: [Qemu-devel] [PATCH 2/2] migration: extract ram_load_precopy

2019-07-23 Thread Wei Yang
On Tue, Jul 23, 2019 at 05:47:03PM +0100, Dr. David Alan Gilbert wrote: >* Wei Yang (richardw.y...@linux.intel.com) wrote: >> After cleanup, it would be clear to audience there are two cases >> ram_load: >> >> * precopy >> * postcopy >> >> And it

[Qemu-devel] [PATCH] migration/postcopy: cleanup multifd after postcopy finish

2019-07-23 Thread Wei Yang
In case we enable multifd, not forget to cleanup it. Signed-off-by: Wei Yang --- migration/savevm.c | 4 1 file changed, 4 insertions(+) diff --git a/migration/savevm.c b/migration/savevm.c index 0105068579..27eef72c9d 100644 --- a/migration/savevm.c +++ b/migration/savevm.c @@ -1738,6

[Qemu-devel] [PATCH] docs/nvdimm: add example on persistent backend setup

2019-07-24 Thread Wei Yang
directly and do more investigation on persistent backend setup with ndctl. Signed-off-by: Wei Yang --- docs/nvdimm.txt | 28 1 file changed, 28 insertions(+) diff --git a/docs/nvdimm.txt b/docs/nvdimm.txt index b531cacd35..baba7a940d 100644 --- a/docs/nvdimm.txt +++ b

Re: [Qemu-devel] [PATCH] docs/nvdimm: add example on persistent backend setup

2019-07-24 Thread Wei Yang
t;> Here we provide two examples for persistent backend and gives the link >> to ndctl. By doing so, user could try it directly and do more >> investigation on persistent backend setup with ndctl. >> >> Signed-off-by: Wei Yang >> --- >> docs/nvd

Re: [Qemu-devel] [PATCH] docs/nvdimm: add example on persistent backend setup

2019-07-24 Thread Wei Yang
t;> Here we provide two examples for persistent backend and gives the link >> to ndctl. By doing so, user could try it directly and do more >> investigation on persistent backend setup with ndctl. >> >> Signed-off-by: Wei Yang >> --- >> docs/nvd

Re: [Qemu-devel] [PATCH 2/2] migration: extract ram_load_precopy

2019-07-24 Thread Wei Yang
On Wed, Jul 24, 2019 at 01:10:24PM +0100, Dr. David Alan Gilbert wrote: >* Wei Yang (richardw.y...@linux.intel.com) wrote: >> On Tue, Jul 23, 2019 at 05:47:03PM +0100, Dr. David Alan Gilbert wrote: >> >* Wei Yang (richardw.y...@linux.intel.com) wrote: >> >> After

[Qemu-devel] [PATCH v2 1/2] migration: return -EINVAL directly when version_id mismatch

2019-07-24 Thread Wei Yang
It is not reasonable to continue when version_id mismatch. Signed-off-by: Wei Yang Reviewed-by: Dr. David Alan Gilbert --- migration/ram.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/migration/ram.c b/migration/ram.c index 66792568e2..69c8a6bb0f 100644 --- a/migration

[Qemu-devel] [PATCH v2 2/2] migration: extract ram_load_precopy

2019-07-24 Thread Wei Yang
After cleanup, it would be clear to audience there are two cases ram_load: * precopy * postcopy And it is not necessary to check postcopy_running on each iteration for precopy. Signed-off-by: Wei Yang Reviewed-by: Dr. David Alan Gilbert --- v2: fix a comment --- migration/ram.c | 73

[Qemu-devel] [PATCH v2 0/2] migration: cleanup ram_load

2019-07-24 Thread Wei Yang
Two cleanup for ram_load: * return -EINVAL for version_id mismatch * extract ram_load_precopy for better readability v2: fix a comment Wei Yang (2): migration: return -EINVAL directly when version_id mismatch migration: extract ram_load_precopy migration/ram.c | 73

[Qemu-devel] [PATCH v2] migration/postcopy: use mis->bh instead of allocating a QEMUBH

2019-07-24 Thread Wei Yang
For migration incoming side, it either quit in precopy or postcopy. It is safe to use the mis->bh for both instead of allocating a dedicated QEMUBH for postcopy. Signed-off-by: Wei Yang Reviewed-by: Dr. David Alan Gilbert --- v2: fix a typo in change log --- migration/savevm.c |

[Qemu-devel] [RFC PATCH] migration/postcopy: skip compression when postcopy is active

2019-07-24 Thread Wei Yang
capability at the same time. Signed-off-by: Wei Yang --- migration/migration.c | 11 --- migration/ram.c | 10 ++ 2 files changed, 10 insertions(+), 11 deletions(-) diff --git a/migration/migration.c b/migration/migration.c index 5a496addbd..33c373033d 100644 --- a/migration

[Qemu-devel] [PATCH 3/3] migration/savevm: move non SaveStateEntry condition check out of iteration

2019-07-09 Thread Wei Yang
in_postcopy and iterable_only are not SaveStateEntry specific, it would be more proper to check them out of iteration. Signed-off-by: Wei Yang --- migration/savevm.c | 13 ++--- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/migration/savevm.c b/migration/savevm.c index

[Qemu-devel] [PATCH 1/3] migration/savevm: flush file for iterable_only case

2019-07-09 Thread Wei Yang
It would be proper to flush file even for iterable_only case. Signed-off-by: Wei Yang --- migration/savevm.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/migration/savevm.c b/migration/savevm.c index c0e557b4c2..becedcc1c6 100644 --- a/migration/savevm.c +++ b/migration

[Qemu-devel] [PATCH 2/3] migration/savevm: split qemu_savevm_state_complete_precopy() into two parts

2019-07-09 Thread Wei Yang
This is a preparation patch for further cleanup. No functional change, just wrap two major part of qemu_savevm_state_complete_precopy() into function. Signed-off-by: Wei Yang --- migration/savevm.c | 66 ++ 1 file changed, 49 insertions(+), 17

[Qemu-devel] [PATCH 0/3] migration/savevm: move non SaveStateEntry condition check out of iteration

2019-07-09 Thread Wei Yang
iteration. These three patches prepare the code and move the condition check out of the iteration. Wei Yang (3): migration/savevm: flush file for iterable_only case migration/savevm: split qemu_savevm_state_complete_precopy() into two parts migration/savevm: move non SaveStateEntry

[Qemu-devel] [PATCH 0/2] migration/postcopy: cleanup function postcopy_chunk_hostpages_pass

2019-07-09 Thread Wei Yang
Here are two trivial function cleanup. BTW, I didn't test them since TPS == HPS. How could I setup a guest with TPS != HPS? Wei Yang (2): migration/postcopy: reduce one operation to calculate fixup_start_addr migration/postcopy: do_fixup is true when host_offset is non-zero migration/

[Qemu-devel] [PATCH 1/2] migration/postcopy: reduce one operation to calculate fixup_start_addr

2019-07-09 Thread Wei Yang
Use the same way for run_end to calculate run_start, which saves one operation. Signed-off-by: Wei Yang --- migration/ram.c | 10 ++ 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/migration/ram.c b/migration/ram.c index 410e0f89fe..c4dc36e525 100644 --- a/migration/ram.c

[Qemu-devel] [PATCH 2/2] migration/postcopy: do_fixup is true when host_offset is non-zero

2019-07-09 Thread Wei Yang
This means it is not necessary to spare an extra variable to hold this condition. Use host_offset directly is fine. Signed-off-by: Wei Yang --- migration/ram.c | 5 + 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/migration/ram.c b/migration/ram.c index c4dc36e525..b0ca0059c4

[Qemu-devel] [PATCH] migration/postcopy: use static PostcopyDiscardState instead of allocating it for each block

2019-07-10 Thread Wei Yang
Even we need to do discard for each RAMBlock, we still can leverage the same memory space to store the information. By doing so, we avoid memory allocation and deallocation to the system and also avoid potential failure of memory allocation which breaks the migration. Signed-off-by: Wei Yang

[Qemu-devel] [PATCH] migration/postcopy: PostcopyState is already set in loadvm_postcopy_handle_advise()

2019-07-11 Thread Wei Yang
PostcopyState is already set to ADVISE at the beginning of loadvm_postcopy_handle_advise(). Remove the redundant set. Signed-off-by: Wei Yang --- migration/savevm.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/migration/savevm.c b/migration/savevm.c index 8a2ada529e..2350e219fc 100644

Re: [Qemu-devel] [PATCH] migration/postcopy: fix document of postcopy_send_discard_bm_ram()

2019-07-11 Thread Wei Yang
On Thu, Jul 11, 2019 at 10:34:27AM +0100, Dr. David Alan Gilbert wrote: >* Wei Yang (richardw.y...@linux.intel.com) wrote: >> Commit 6b6712efccd3 ('ram: Split dirty bitmap by RAMBlock') changes the >> parameter of postcopy_send_discard_bm_ram(), while left the d

[Qemu-devel] [PATCH] migration: check length directly to make sure the range is aligned

2019-07-11 Thread Wei Yang
Since the start addr is already checked, to make sure the range is aligned, checking the length is enough. Signed-off-by: Wei Yang --- exec.c | 7 +++ 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/exec.c b/exec.c index 50ea9c5aaa..8fa980baae 100644 --- a/exec.c +++ b/exec.c

Re: [Qemu-devel] [PATCH v2] i386, acpi: check acpi_memory_hotplug capacity in pre_plug

2019-02-18 Thread Wei Yang
On Mon, Feb 18, 2019 at 02:53:36PM +0100, Igor Mammedov wrote: >On Mon, 18 Feb 2019 13:21:29 +0000 >Wei Yang wrote: > >> On Mon, Feb 18, 2019 at 01:56:02PM +0100, Igor Mammedov wrote: >> >On Mon, 18 Feb 2019 12:13:24 + >> >Wei Yang wrote: >> > >

[Qemu-devel] [PATCH v3] i386, acpi: check acpi_memory_hotplug capacity in pre_plug

2019-02-18 Thread Wei Yang
). Fix it by checking if memory hotplug is enabled at pre_plug stage where we can gracefully abort hotplug request. Signed-off-by: Wei Yang CC: Igor Mammedov CC: Eric Blake --- v3: * replace acpi_memory_hotplug with memory-hotplug-support in changelog * fix code alignment of ich9_pm_devic

[Qemu-devel] [PATCH 1/2] CODING_STYLE: specify the indent rule for multiline code

2019-02-18 Thread Wei Yang
We didn't specify the indent rule for multiline code here, which may misleading users. And in current code, the code use different rules. Add this rule in CODING_STYLE to make sure this is clear to every one. Signed-off-by: Wei Yang Suggested-by: Igor Mammedov --- CODING_STYLE

[Qemu-devel] [PATCH 0/2] CODING_STYLE: trivial update

2019-02-18 Thread Wei Yang
The first one is suggested by Igor Mammedov to provide rule for multiline code. The second is a trivial fix to make example code all indented with 4 spaces. Wei Yang (2): CODING_STYLE: specify the indent rule for multiline code CODING_STYLE: indent example code as all others CODING_STYLE

[Qemu-devel] [PATCH 2/2] CODING_STYLE: indent example code as all others

2019-02-18 Thread Wei Yang
All the example code are indented with four spaces except this one. Fix this by adding four spaces here. Signed-off-by: Wei Yang --- CODING_STYLE | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/CODING_STYLE b/CODING_STYLE index 73f66ca185..27581d80c1 100644 --- a

[Qemu-devel] [PATCH 0/2] PCDIMM cleanup

2019-02-18 Thread Wei Yang
Two trivial cleanup for pc-dimm. Patch [1] remove the check on class->hotpluggable since pc-dimm is always hotpluggable. Patch [2] remove realized callback since the task is done in pre_plug stage. Wei Yang (2): pc-dimm: remove check on pc-dimm hotpluggable pc-dimm: remove realize callb

[Qemu-devel] [PATCH 2/2] pc-dimm: remove realize callback

2019-02-18 Thread Wei Yang
ff-by: Wei Yang --- hw/acpi/memory_hotplug.c | 1 - hw/mem/nvdimm.c | 11 --- hw/mem/pc-dimm.c | 5 - include/hw/mem/pc-dimm.h | 3 --- 4 files changed, 20 deletions(-) diff --git a/hw/acpi/memory_hotplug.c b/hw/acpi/memory_hotplug.c index b19673d337..cb5284d36f 1

[Qemu-devel] [PATCH 1/2] pc-dimm: remove check on pc-dimm hotpluggable

2019-02-18 Thread Wei Yang
Function acpi_memory_plug_cb() is only invoked when dev is a PCDIMM, which is hotpluggable. This means it is not necessary to check this property again. This patch removes this check. Signed-off-by: Wei Yang --- hw/acpi/memory_hotplug.c | 4 1 file changed, 4 deletions(-) diff --git a/hw

Re: [Qemu-devel] [PATCH v3] i386, acpi: check acpi_memory_hotplug capacity in pre_plug

2019-02-19 Thread Wei Yang
On Tue, Feb 19, 2019 at 08:53:22AM +0800, Wei Yang wrote: >Currently we do device realization like below: > > hotplug_handler_pre_plug() > dc->realize() > hotplug_handler_plug() > >Before we do device realization and plug, we should allocate necessary >resources

[Qemu-devel] [PATCH v4] i386, acpi: check acpi_memory_hotplug capacity in pre_plug

2019-02-19 Thread Wei Yang
). Fix it by checking if memory hotplug is enabled at pre_plug stage where we can gracefully abort hotplug request. Signed-off-by: Wei Yang CC: Igor Mammedov CC: Eric Blake --- v4: * fix code alignment of piix4_device_pre_plug_cb v3: * replace acpi_memory_hotplug with memory-hotpl

Re: [Qemu-devel] [PATCH 1/2] pc-dimm: remove check on pc-dimm hotpluggable

2019-02-19 Thread Wei Yang
On Tue, Feb 19, 2019 at 01:29:38PM +0100, Philippe Mathieu-Daudé wrote: >On 2/19/19 7:07 AM, Wei Yang wrote: >> Function acpi_memory_plug_cb() is only invoked when dev is a PCDIMM, >> which is hotpluggable. This means it is not necessary to check this >> property again. >

Re: [Qemu-devel] [PATCH 2/2] pc-dimm: remove realize callback

2019-02-19 Thread Wei Yang
On Tue, Feb 19, 2019 at 01:36:57PM +0100, Philippe Mathieu-Daudé wrote: >On 2/19/19 7:07 AM, Wei Yang wrote: >> PCDIMM's realize callback is introduced to do proper setup for NVDIMM. >> >> Currently the NVDIMM setup task is nvdimm_prepare_memory_region(), which >>

Re: [Qemu-devel] [PATCH 2/2] CODING_STYLE: indent example code as all others

2019-02-19 Thread Wei Yang
On Tue, Feb 19, 2019 at 06:38:54PM +0100, Philippe Mathieu-Daudé wrote: >On 2/19/19 2:31 AM, Wei Yang wrote: >> All the example code are indented with four spaces except this one. >> >> Fix this by adding four spaces here. >> >> Signed-off-by: Wei Yang >>

Re: [Qemu-devel] [PATCH 1/2] CODING_STYLE: specify the indent rule for multiline code

2019-02-19 Thread Wei Yang
4 from the >primary line. We should put this style in the example too? > >-- >Eric Blake, Principal Software Engineer >Red Hat, Inc. +1-919-301-3226 >Virtualization: qemu.org | libvirt.org -- Wei Yang Help you, Help me

Re: [Qemu-devel] [PATCH 1/2] CODING_STYLE: specify the indent rule for multiline code

2019-02-19 Thread Wei Yang
On Tue, Feb 19, 2019 at 11:52:29AM -0600, Eric Blake wrote: >On 2/18/19 7:31 PM, Wei Yang wrote: >> We didn't specify the indent rule for multiline code here, which may >> misleading users. And in current code, the code use different rules. >> >> Add this rule in C

Re: [Qemu-devel] [PATCH 2/2] CODING_STYLE: indent example code as all others

2019-02-19 Thread Wei Yang
omments? This looks not relavant to this sectioin. I am afraid I will not add this example here. Sorry for that. >With/without multi-line example: >Reviewed-by: Philippe Mathieu-Daudé > >Thanks! > >Phil. -- Wei Yang Help you, Help me

[Qemu-devel] [PATCH v2 2/2] CODING_STYLE: indent example code as all others

2019-02-19 Thread Wei Yang
All the example code are indented with four spaces except this one. Fix this by adding four spaces here. Signed-off-by: Wei Yang Reviewed-by: Eric Blake Reviewed-by: Philippe Mathieu-Daudé --- CODING_STYLE | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a

[Qemu-devel] [PATCH v2 0/2] CODING_STYLE: trivial update

2019-02-19 Thread Wei Yang
The first one is suggested by Igor Mammedov to provide rule for multiline code. The second is a trivial fix to make example code all indented with 4 spaces. v2: * adjust Patch 1 as suggested by Eric Wei Yang (2): CODING_STYLE: specify the indent rule for multiline code CODING_STYLE

[Qemu-devel] [PATCH v2 1/2] CODING_STYLE: specify the indent rule for multiline code

2019-02-19 Thread Wei Yang
We didn't specify the indent rule for multiline code here, which may misleading users. And in current code, the code use different rules. Add this rule in CODING_STYLE to make sure this is clear to every one. Signed-off-by: Wei Yang Suggested-by: Igor Mammedov --- v2: * rephrase chan

[Qemu-devel] [PATCH v2 0/3] PCDIMM cleanup

2019-02-19 Thread Wei Yang
Three trivial cleanup for pc-dimm. Patch [1] remove the check on class->hotpluggable since pc-dimm is always hotpluggable. Patch [2] remove nvdimm_realize Patch [2] remove pcdimm realize-callback v2: * fix warning in Patch 1 * split Patch 2 into two Wei Yang (3): pc-dimm: remove check

[Qemu-devel] [PATCH v2 1/3] pc-dimm: remove check on pc-dimm hotpluggable

2019-02-19 Thread Wei Yang
Function acpi_memory_plug_cb() is only invoked when dev is a PCDIMM, which is hotpluggable. This means it is not necessary to check this property again. This patch removes this check. Signed-off-by: Wei Yang Reviewed-by: Philippe Mathieu-Daudé --- v2: * remove unused dc --- hw/acpi

[Qemu-devel] [PATCH v2 3/3] pc-dimm: revert "introduce realize callback"

2019-02-19 Thread Wei Yang
realize callback in introduced to check if the backend memory is large enough to contain label data and init its memory region, while this task is handled in pre_plug stage. Now it's time to remove it. Signed-off-by: Wei Yang --- hw/mem/pc-dimm.c | 5 - include/hw/mem/pc-dimm.

[Qemu-devel] [PATCH v2 2/3] mem/nvdimm: remove nvdimm_realize

2019-02-19 Thread Wei Yang
nvdimm_realize is used to prepare its memory region, while this is done in pre_plug stage. This is time to remove it. Signed-off-by: Wei Yang --- v2: split nvdimm part here --- hw/mem/nvdimm.c | 11 --- 1 file changed, 11 deletions(-) diff --git a/hw/mem/nvdimm.c b/hw/mem/nvdimm.c

Re: [Qemu-devel] [PATCH v2 3/3] pc-dimm: revert "introduce realize callback"

2019-02-19 Thread Wei Yang
On Wed, Feb 20, 2019 at 02:26:16AM +0100, Philippe Mathieu-Daudé wrote: >On 2/20/19 1:51 AM, Wei Yang wrote: >> realize callback in introduced to check if the backend memory is large >> enough to contain label data and init its memory region, while this task >> is hand

Re: [Qemu-devel] [PATCH] doc: update .gitignore and fix typos for docs in tree

2019-02-19 Thread Wei Yang
Number two is the newer usb attached scsi transport. This one doesn't >-automagically create a scsi disk, so you have to explicitly attach one >+automatically create a scsi disk, so you have to explicitly attach one > manually. Multiple logical units are supported. Here is an example > with tree logical units: > >diff --git a/docs/vfio-ap.txt b/docs/vfio-ap.txt >index 1233968..30f3c66 100644 >--- a/docs/vfio-ap.txt >+++ b/docs/vfio-ap.txt >@@ -624,7 +624,7 @@ These are the steps: > -> IOMMU Hardware Support > select S390 AP IOMMU Support > -> VFIO Non-Privileged userspace driver framework >- -> Mediated device driver frramework >+ -> Mediated device driver framework > -> VFIO driver for Mediated devices >-> I/O subsystem > -> VFIO support for AP devices others looks good to me. >-- >1.8.3.1 > -- Wei Yang Help you, Help me

Re: [Qemu-devel] [PATCH v2 1/2] CODING_STYLE: specify the indent rule for multiline code

2019-02-19 Thread Wei Yang
On Tue, Feb 19, 2019 at 09:02:34PM -0600, Eric Blake wrote: >On 2/19/19 6:31 PM, Wei Yang wrote: >> We didn't specify the indent rule for multiline code here, which may >> misleading users. And in current code, the code use different rules. > >s/misleading/mislead/

[Qemu-devel] [PATCH v3 0/2] CODING_STYLE: trivial update

2019-02-19 Thread Wei Yang
The first one is suggested by Igor Mammedov to provide rule for multiline code. The second is a trivial fix to make example code all indented with 4 spaces. v3: * fix typo in both changelog and example v2: * adjust Patch 1 as suggested by Eric Wei Yang (2): CODING_STYLE: specify the

[Qemu-devel] [PATCH v3 1/2] CODING_STYLE: specify the indent rule for multiline code

2019-02-19 Thread Wei Yang
We didn't specify the indent rule for multiline code here, which may mislead users. And in current code, the code use different rules. Add this rule in CODING_STYLE to make sure this is clear to every one. Signed-off-by: Wei Yang Suggested-by: Igor Mammedov Reviewed-by: Eric Blake -

[Qemu-devel] [PATCH v3 2/2] CODING_STYLE: indent example code as all others

2019-02-19 Thread Wei Yang
All the example code are indented with four spaces except this one. Fix this by adding four spaces here. Signed-off-by: Wei Yang Reviewed-by: Eric Blake Reviewed-by: Philippe Mathieu-Daudé --- CODING_STYLE | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a

Re: [Qemu-devel] [PATCH] hw/ide/ich: Compile ich.c only if CONFIG_PCI is also set

2019-02-19 Thread Wei Yang
-obj-$(CONFIG_IDE_VIA) += via.o > common-obj-$(CONFIG_MICRODRIVE) += microdrive.o > common-obj-$(CONFIG_AHCI) += ahci.o >-common-obj-$(CONFIG_AHCI) += ich.o >+common-obj-$(call land,$(CONFIG_AHCI),$(CONFIG_PCI)) += ich.o > common-obj-$(CONFIG_ALLWINNER_A10) += ahci-allwinner.o > common-obj-$(CONFIG_IDE_SII3112) += sii3112.o >-- >1.8.3.1 > -- Wei Yang Help you, Help me

Re: [Qemu-devel] [PATCH] block/pflash_cfi02: Fix memory leak and potential use-after-free

2019-02-19 Thread Wei Yang
On Tue, Feb 19, 2019 at 10:37:27AM -0500, Stephen Checkoway wrote: >Don't dynamically allocate the pflash's timer. But do use timer_del in >an unrealize function to make sure that the timer can't fire after the >pflash_t has been freed. > >Signed-off-by: Stephen Che

Re: [Qemu-devel] [PATCH v2 0/3] PCDIMM cleanup

2019-02-20 Thread Wei Yang
On Thu, Feb 21, 2019 at 02:03:19PM +0800, Xiao Guangrong wrote: > > >On 2/20/19 8:51 AM, Wei Yang wrote: >> Three trivial cleanup for pc-dimm. >> >> Patch [1] remove the check on class->hotpluggable since pc-dimm is always >> hotpluggable. >> Patch [2]

Re: [Qemu-devel] [PATCH 2/2] pc-dimm: remove realize callback

2019-02-22 Thread Wei Yang
On Thu, Feb 21, 2019 at 03:37:53PM +0100, Igor Mammedov wrote: >On Tue, 19 Feb 2019 13:36:57 +0100 >Philippe Mathieu-Daudé wrote: > >> On 2/19/19 7:07 AM, Wei Yang wrote: >> > PCDIMM's realize callback is introduced to do proper setup for NVDIMM. >> > &

Re: [Qemu-devel] [PATCH v4] i386, acpi: check acpi_memory_hotplug capacity in pre_plug

2019-02-22 Thread Wei Yang
On Thu, Feb 21, 2019 at 03:45:51PM +0100, Igor Mammedov wrote: >On Tue, 19 Feb 2019 16:08:26 +0800 >Wei Yang wrote: > >> Currently we do device realization like below: >> >>hotplug_handler_pre_plug() >>dc->realize() >>hotplug_handler_plug()

Re: [Qemu-devel] [PATCH v4] i386, acpi: check acpi_memory_hotplug capacity in pre_plug

2019-02-22 Thread Wei Yang
On Thu, Feb 21, 2019 at 03:45:51PM +0100, Igor Mammedov wrote: >On Tue, 19 Feb 2019 16:08:26 +0800 >Wei Yang wrote: > >> Currently we do device realization like below: >> >>hotplug_handler_pre_plug() >>dc->realize() >>hotplug_handler_plug()

Re: [Qemu-devel] [PATCH v2 0/3] PCDIMM cleanup

2019-02-22 Thread Wei Yang
On Thu, Feb 21, 2019 at 03:50:04PM +0100, Igor Mammedov wrote: >On Wed, 20 Feb 2019 08:51:21 +0800 >Wei Yang wrote: > >> Three trivial cleanup for pc-dimm. >> >> Patch [1] remove the check on class->hotpluggable since pc-dimm is always >> hotpluggable. >>

Re: [Qemu-devel] [PATCH v3 1/2] CODING_STYLE: specify the indent rule for multiline code

2019-02-22 Thread Wei Yang
On Thu, Feb 21, 2019 at 03:55:19PM +0100, Igor Mammedov wrote: >On Wed, 20 Feb 2019 11:15:56 +0800 >Wei Yang wrote: > >> We didn't specify the indent rule for multiline code here, which may >> mislead users. And in current code, the code use different rules. >>

[Qemu-devel] [PATCH v5] i386, acpi: check acpi_memory_hotplug capacity in pre_plug

2019-02-24 Thread Wei Yang
). Fix it by checking if memory hotplug is enabled at pre_plug stage where we can gracefully abort hotplug request. Signed-off-by: Wei Yang CC: Igor Mammedov CC: Eric Blake Signed-off-by: Wei Yang --- v5: * rebase on latest upstream * remove a comment before hotplug_handler_pre_plug *

Re: [Qemu-devel] [PATCH v5] i386, acpi: check acpi_memory_hotplug capacity in pre_plug

2019-02-24 Thread Wei Yang
On Mon, Feb 25, 2019 at 09:07:08AM +0800, Wei Yang wrote: >Currently we do device realization like below: > > hotplug_handler_pre_plug() > dc->realize() > hotplug_handler_plug() > >Before we do device realization and plug, we should allocate necessary >resources

[Qemu-devel] [PATCH v4 2/2] CODING_STYLE: indent example code as all others

2019-02-24 Thread Wei Yang
All the example code are indented with four spaces except this one. Fix this by adding four spaces here. Signed-off-by: Wei Yang Reviewed-by: Eric Blake Reviewed-by: Philippe Mathieu-Daudé --- CODING_STYLE | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a

[Qemu-devel] [PATCH v4 1/2] CODING_STYLE: specify the indent rule for multiline code

2019-02-24 Thread Wei Yang
We didn't specify the indent rule for multiline code here, which may mislead users. And in current code, the code use different rules. Add this rule in CODING_STYLE to make sure this is clear to every one. Signed-off-by: Wei Yang Suggested-by: Igor Mammedov --- v4: * widths -&g

[Qemu-devel] [PATCH v4 0/2] CODING_STYLE: trivial update

2019-02-24 Thread Wei Yang
The first one is suggested by Igor Mammedov to provide rule for multiline code. The second is a trivial fix to make example code all indented with 4 spaces. v4: * one exception case for function v3: * fix typo in both changelog and example v2: * adjust Patch 1 as suggested by Eric Wei

Re: [Qemu-devel] [PATCH v2 0/3] PCDIMM cleanup

2019-02-25 Thread Wei Yang
On Mon, Feb 25, 2019 at 09:05:37AM +0100, Igor Mammedov wrote: >On Sat, 23 Feb 2019 00:02:49 +0000 >Wei Yang wrote: > >> On Thu, Feb 21, 2019 at 03:50:04PM +0100, Igor Mammedov wrote: >> >On Wed, 20 Feb 2019 08:51:21 +0800 >> >Wei Yang wrote: >> &g

Re: [Qemu-devel] [PATCH v5] i386, acpi: check acpi_memory_hotplug capacity in pre_plug

2019-02-25 Thread Wei Yang
On Mon, Feb 25, 2019 at 09:15:34AM +0800, Wei Yang wrote: >On Mon, Feb 25, 2019 at 09:07:08AM +0800, Wei Yang wrote: >>Currently we do device realization like below: >> >> hotplug_handler_pre_plug() >> dc->realize() >> hotplug_handler_plug() >> >

[Qemu-devel] [PATCH] fw_cfg: use __ATTR_RO_MODE to define rev sysfs

2019-02-25 Thread Wei Yang
Leverage __ATTR_RO_MODE to define rev sysfs instead of using open code to define the attribute. Signed-off-by: Wei Yang --- drivers/firmware/qemu_fw_cfg.c | 13 - 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/drivers/firmware/qemu_fw_cfg.c b/drivers/firmware

Re: [Qemu-devel] [PATCH] fw_cfg: use __ATTR_RO_MODE to define rev sysfs

2019-02-26 Thread Wei Yang
On Tue, Feb 26, 2019 at 07:45:46PM +0100, Philippe Mathieu-Daudé wrote: >Hi Wei, > >On 2/26/19 8:31 AM, Wei Yang wrote: >> Leverage __ATTR_RO_MODE to define rev sysfs instead of using open code >> to define the attribute. >> >> Signed-off-by: Wei Yang >>

Re: [Qemu-devel] [PATCH] fw_cfg: use __ATTR_RO_MODE to define rev sysfs

2019-02-26 Thread Wei Yang
On Tue, Feb 26, 2019 at 11:10:06AM -0500, Michael S. Tsirkin wrote: >On Tue, Feb 26, 2019 at 03:31:59PM +0800, Wei Yang wrote: >> Leverage __ATTR_RO_MODE to define rev sysfs instead of using open code >> to define the attribute. >> >> Signed-off-by: Wei Yang

[Qemu-devel] [PATCH 3/4] nvdimm: use NVDIMM_ACPI_IO_LEN for the proper IO size

2019-02-26 Thread Wei Yang
The IO range is defined to 4 bytes with NVDIMM_ACPI_IO_LEN, so it is more proper to use this macro instead of calculating it by sizeof. Signed-off-by: Wei Yang --- hw/acpi/nvdimm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/acpi/nvdimm.c b/hw/acpi/nvdimm.c index

[Qemu-devel] [PATCH 2/4] nvdimm: use *function* directly instead of allocating it again

2019-02-26 Thread Wei Yang
At the beginning or nvdimm_build_common_dsm(), variable *function* is already allocated for Arg2. This patch reuse variable *function* instead of allocating it again. Signed-off-by: Wei Yang --- hw/acpi/nvdimm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/acpi

[Qemu-devel] [PATCH 0/4] nvdimm: clean up

2019-02-26 Thread Wei Yang
Here are 4 cleanup patches for nvdimm. The first three are trivial clean on argument/variable. The last one move setup place of the FIT table. Wei Yang (4): nvdimm: fix typo in nvdimm_build_nvdimm_devices argument nvdimm: use *function* directly instead of allocating it again nvdimm: use

[Qemu-devel] [PATCH 4/4] nvdimm: build FIT in nvdimm_build_acpi

2019-02-26 Thread Wei Yang
ld stage It would be more proper to build fit buffer in nvdimm_build_acpi, which consolidate all acpi related initialization together. This patch moves FIT build in nvdimm_build_acpi. Signed-off-by: Wei Yang --- hw/acpi/nvdimm.c| 6 +- hw/i386/pc.c| 5 - includ

[Qemu-devel] [PATCH 1/4] nvdimm: fix typo in nvdimm_build_nvdimm_devices argument

2019-02-26 Thread Wei Yang
>From dsm_dma_arrea to dsm_dma_area. Signed-off-by: Wei Yang --- hw/acpi/nvdimm.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/acpi/nvdimm.c b/hw/acpi/nvdimm.c index e53b2cb681..39af8cdba8 100644 --- a/hw/acpi/nvdimm.c +++ b/hw/acpi/nvdimm.c @@ -1260,7 +126

Re: [Qemu-devel] [PATCH v2 0/3] PCDIMM cleanup

2019-02-27 Thread Wei Yang
On Wed, Feb 27, 2019 at 02:12:42PM +0100, Igor Mammedov wrote: >On Mon, 25 Feb 2019 12:47:14 +0000 >Wei Yang wrote: > >> On Mon, Feb 25, 2019 at 09:05:37AM +0100, Igor Mammedov wrote: >> >On Sat, 23 Feb 2019 00:02:49 + >> >Wei Yang wrote: >> > >

Re: [Qemu-devel] [PATCH] fw_cfg: use __ATTR_RO_MODE to define rev sysfs

2019-02-27 Thread Wei Yang
On Wed, Feb 27, 2019 at 08:54:58AM -0500, Michael S. Tsirkin wrote: >On Wed, Feb 27, 2019 at 11:07:16AM +0800, Wei Yang wrote: >> On Tue, Feb 26, 2019 at 07:45:46PM +0100, Philippe Mathieu-Daudé wrote: >> >Hi Wei, >> > >> >On 2/26/19 8:31 AM, Wei Yang wrote: >

Re: [Qemu-devel] [PATCH] fw_cfg: use __ATTR_RO_MODE to define rev sysfs

2019-02-27 Thread Wei Yang
On Wed, Feb 27, 2019 at 08:51:11AM -0500, Michael S. Tsirkin wrote: >On Wed, Feb 27, 2019 at 01:33:19PM +0800, Wei Yang wrote: >> On Tue, Feb 26, 2019 at 11:10:06AM -0500, Michael S. Tsirkin wrote: >> >On Tue, Feb 26, 2019 at 03:31:59PM +0800, Wei Yang wrote: >> >&

Re: [Qemu-devel] [PATCH v2 4/4] hw/acpi: Extract build_mcfg to pci.c

2019-04-16 Thread Wei Yang
On Mon, Apr 15, 2019 at 03:01:28PM +0200, Philippe Mathieu-Daud?? wrote: >Hi Wei, > >On 4/15/19 9:03 AM, Wei Yang wrote: >> Now we have two identical build_mcfg function. >> >> Extract them to pci.c. >> >> Signed-off-by: Wei Yang >> >&g

[Qemu-devel] [PATCH v3 3/6] i386, acpi: remove mcfg_ prefix in AcpiMcfgInfo members

2019-04-16 Thread Wei Yang
This is obvious the member in AcpiMcfgInfo describe MCFG's property. Remove the mcfg_ prefix. Signed-off-by: Wei Yang Suggested-by: Igor Mammedov Reviewed-by: Igor Mammedov Reviewed-by: Philippe Mathieu-Daudé --- hw/i386/acpi-build.c | 14 +++--- 1 file changed, 7 insertions(

[Qemu-devel] [PATCH v3 4/6] hw/arm/virt-acpi-build: pass AcpiMcfgInfo to build_mcfg()

2019-04-16 Thread Wei Yang
To build MCFG, two information is necessary: * bus number * base address Abstract these two information to AcpiMcfgInfo so that build_mcfg and build_mcfg_q35 will have the same declaration. Signed-off-by: Wei Yang Reviewed-by: Philippe Mathieu-Daudé --- v3: * move AcpiMcfgInfo to

<    1   2   3   4   5   6   7   8   >