[Qemu-devel] [PATCH for-4.0 2/5] migration: fix the multifd code when receiving less channels

2019-01-13 Thread Fei Li
From: Fei Li In our current code, when multifd is used during migration, if there is an error before the destination receives all new channels, the source keeps running, however the destination does not exit but keeps waiting until the source is killed deliberately. Fix this by dumping the

[Qemu-devel] [PATCH for-4.0 1/5] Fix segmentation fault when qemu_signal_init fails

2019-01-13 Thread Fei Li
From: Fei Li When qemu_signal_init() fails in qemu_init_main_loop(), we return without setting an error. Its callers crash then when they try to report the error with error_report_err(). To avoid such segmentation fault, add a new Error parameter to make the call trace to propagate the err to

[Qemu-devel] [PATCH for-4.0 5/5] migration: unify error handling for process_incoming_migration_co

2019-01-13 Thread Fei Li
From: Fei Li In the current code, if process_incoming_migration_co() fails we do the same error handing: set the error state, close the source file, do the cleanup for multifd, and then exit(EXIT_FAILURE). To make the code clearer, add a "goto fail" to unify the error handling. Cc:

[Qemu-devel] [PATCH for-4.0 0/5] fix some segmentation faults and migration issues

2019-01-13 Thread Fei Li
quot;, but actually these five patches are derivative and not relevant to the mentioned qemu_thread_create patch series. Thus send them separately to make them be merged earlier. Fei Li (5): Fix segmentation fault when qemu_signal_init fails migration: fix the multifd code when receiving les

[Qemu-devel] [PATCH for-4.0 3/5] migration: multifd_save_cleanup() can't fail, simplify

2019-01-13 Thread Fei Li
From: Fei Li multifd_save_cleanup() takes an Error ** argument and returns an error code even though it can't actually fail. Its callers dutifully check for failure. Remove the useless argument and return value, and simplify the callers. Cc: Dr. David Alan Gilbert Cc: Markus Armbr

Re: [Qemu-devel] [PATCH for-4.0 v9 16/16] qemu_thread_join: fix segmentation fault

2019-01-11 Thread Fei Li
在 2019/1/11 上午12:06, Markus Armbruster 写道: Fei Li writes: 在 2019/1/10 下午5:20, Markus Armbruster 写道: fei writes: 在 2019年1月9日,23:24,Markus Armbruster 写道: Fei Li writes: 在 2019/1/9 上午1:29, Markus Armbruster 写道: fei writes: 在 2019年1月8日,01:55,Markus Armbruster 写道: Fei Li writes

Re: [Qemu-devel] [PATCH for-4.0 v9 09/16] qemu_thread: supplement error handling for pci_edu_realize

2019-01-11 Thread Fei Li
在 2019/1/11 上午10:49, Peter Xu 写道: On Thu, Jan 10, 2019 at 09:29:38PM +0800, Fei Li wrote: 在 2019/1/8 下午4:43, Markus Armbruster 写道: Peter Xu writes: On Tue, Jan 08, 2019 at 07:14:11AM +0100, Jiri Slaby wrote: On 07. 01. 19, 18:29, Markus Armbruster wrote: static void pci_edu_uninit

Re: [Qemu-devel] [PATCH for-4.0 v9 09/16] qemu_thread: supplement error handling for pci_edu_realize

2019-01-10 Thread Fei Li
t calling msi_uninit() could be even nicer here. Anyone would like to post a patch? Or should I? Please coordinate fixing this with Fei Li. Have a nice day, thanks all Fei

Re: [Qemu-devel] [PATCH for-4.0 v9 16/16] qemu_thread_join: fix segmentation fault

2019-01-10 Thread Fei Li
在 2019/1/10 下午5:20, Markus Armbruster 写道: fei writes: 在 2019年1月9日,23:24,Markus Armbruster 写道: Fei Li writes: 在 2019/1/9 上午1:29, Markus Armbruster 写道: fei writes: 在 2019年1月8日,01:55,Markus Armbruster 写道: Fei Li writes: To avoid the segmentation fault in qemu_thread_join(), just

Re: [Qemu-devel] [PATCH for-4.0 v9 16/16] qemu_thread_join: fix segmentation fault

2019-01-09 Thread Fei Li
在 2019/1/9 上午1:29, Markus Armbruster 写道: fei writes: 在 2019年1月8日,01:55,Markus Armbruster 写道: Fei Li writes: To avoid the segmentation fault in qemu_thread_join(), just directly return when the QemuThread *thread failed to be created in either qemu-thread-posix.c or qemu-thread-win32.c

Re: [Qemu-devel] [PATCH for-4.0 v9 11/16] qemu_thread: supplement error handling for emulated_realize

2019-01-09 Thread Fei Li
在 2019/1/8 上午1:31, Markus Armbruster 写道: Fei Li writes: Utilize the existed errp to propagate the error and do the corresponding cleanup to replace the temporary &error_abort. Cc: Cc: Markus Armbruster Cc: Gerd Hoffmann Signed-off-by: Fei Li --- hw/usb/ccid-card-emulated.c

Re: [Qemu-devel] [PATCH for-4.0 v9 06/16] qemu_thread: Make qemu_thread_create() handle errors properly

2019-01-09 Thread Fei Li
在 2019/1/9 上午1:07, Markus Armbruster 写道: fei writes: 在 2019年1月8日,01:18,Markus Armbruster 写道: Fei Li writes: qemu_thread_create() abort()s on error. Not nice. Give it a return value and an Error ** argument, so it can return success/failure. Considering qemu_thread_create() is quite

Re: [Qemu-devel] [PATCH for-4.0 v9 00/16] qemu_thread_create: propagate the error to callers to handle

2019-01-07 Thread Fei Li
Hi all, Sorry for the mistakenly deleted " include "qapi/error.h" " for [PATCH for-4.0 v9 11/16] qemu_thread: supplement error handling for emulated_realize, will add this #include back in next version. Have a nice day, and again sorry for the trouble. Fei 在 2019/1/2 下午9:46, no-re...@patche

Re: [Qemu-devel] [PATCH for-4.0 v9 10/16] qemu_thread: supplement error handling for h_resize_hpt_prepare

2019-01-03 Thread Fei Li
在 2019/1/4 下午1:21, David Gibson 写道: On Thu, Jan 03, 2019 at 09:41:49PM +0800, Fei Li wrote: 在 2019/1/3 上午11:43, David Gibson 写道: On Wed, Jan 02, 2019 at 02:44:17PM +0800, 李菲 wrote: 在 2019/1/2 上午10:36, David Gibson 写道: On Tue, Dec 25, 2018 at 10:04:43PM +0800, Fei Li wrote: Add a local_err

Re: [Qemu-devel] [PATCH for-4.0 v9 10/16] qemu_thread: supplement error handling for h_resize_hpt_prepare

2019-01-03 Thread Fei Li
在 2019/1/3 上午11:43, David Gibson 写道: On Wed, Jan 02, 2019 at 02:44:17PM +0800, 李菲 wrote: 在 2019/1/2 上午10:36, David Gibson 写道: On Tue, Dec 25, 2018 at 10:04:43PM +0800, Fei Li wrote: Add a local_err to hold the error, and return the corresponding error code to replace the temporary

Re: [Qemu-devel] [PATCH for-4.0 v9 05/16] migration: unify error handling for process_incoming_migration_co

2019-01-03 Thread Fei Li
在 2019/1/3 下午7:25, Dr. David Alan Gilbert 写道: * Fei Li (f...@suse.com) wrote: In the current code, if process_incoming_migration_co() fails we do the same error handing: set the error state, close the source file, do the cleanup for multifd, and then exit(EXIT_FAILURE). To make the code

Re: [Qemu-devel] [PATCH for-4.0 v9 13/16] qemu_thread: supplement error handling for migration

2019-01-03 Thread Fei Li
在 2019/1/3 下午8:35, Dr. David Alan Gilbert 写道: * Fei Li (f...@suse.com) wrote: Update qemu_thread_create()'s callers by - setting an error on qemu_thread_create() failure for callers that set an error on failure; - reporting the error and returning failure for callers that return

[Qemu-devel] [PATCH for-4.0 v9 16/16] qemu_thread_join: fix segmentation fault

2018-12-25 Thread Fei Li
To avoid the segmentation fault in qemu_thread_join(), just directly return when the QemuThread *thread failed to be created in either qemu-thread-posix.c or qemu-thread-win32.c. Cc: Stefan Weil Signed-off-by: Fei Li Reviewed-by: Fam Zheng --- util/qemu-thread-posix.c | 3 +++ util/qemu

[Qemu-devel] [PATCH for-4.0 v9 13/16] qemu_thread: supplement error handling for migration

2018-12-25 Thread Fei Li
just report errors and choose not to continue on. Cc: Markus Armbruster Cc: Dr. David Alan Gilbert Cc: Peter Xu Signed-off-by: Fei Li --- migration/migration.c| 33 ++--- migration/postcopy-ram.c | 16 migration/ram.c

[Qemu-devel] [PATCH for-4.0 v9 06/16] qemu_thread: Make qemu_thread_create() handle errors properly

2018-12-25 Thread Fei Li
and the next 9 patches will improve on &error_abort for callers who need. Cc: Markus Armbruster Cc: Paolo Bonzini Signed-off-by: Fei Li --- cpus.c | 23 +++ dump.c | 3 ++- hw/misc/edu.c | 4 +++- hw/ppc/spapr

[Qemu-devel] [PATCH for-4.0 v9 07/16] qemu_thread: supplement error handling for qemu_X_start_vcpu

2018-12-25 Thread Fei Li
() return a Boolean value to let its callers know whether it succeeds. Cc: Paolo Bonzini Signed-off-by: Fei Li Reviewed-by: Fam Zheng Reviewed-by: Juan Quintela --- accel/tcg/user-exec-stub.c | 3 +- cpus.c | 86 - include/qom

[Qemu-devel] [PATCH for-4.0 v9 12/16] qemu_thread: supplement error handling for iothread_complete/qemu_signalfd_compat

2018-12-25 Thread Fei Li
: Markus Armbruster Cc: Eric Blake Signed-off-by: Fei Li --- iothread.c | 17 +++-- util/compatfd.c | 11 --- 2 files changed, 19 insertions(+), 9 deletions(-) diff --git a/iothread.c b/iothread.c index 8e8aa01999..7335dacf0b 100644 --- a/iothread.c +++ b/iothread.c @

[Qemu-devel] [PATCH for-4.0 v9 10/16] qemu_thread: supplement error handling for h_resize_hpt_prepare

2018-12-25 Thread Fei Li
Add a local_err to hold the error, and return the corresponding error code to replace the temporary &error_abort. Cc: Markus Armbruster Cc: David Gibson Signed-off-by: Fei Li --- hw/ppc/spapr_hcall.c | 12 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/hw

[Qemu-devel] [PATCH for-4.0 v9 03/16] migration: remove unused &local_err parameter in multifd_save_cleanup

2018-12-25 Thread Fei Li
f-by: Fei Li Reviewed-by: Juan Quintela --- migration/migration.c | 5 + migration/ram.c | 11 --- migration/ram.h | 2 +- 3 files changed, 6 insertions(+), 12 deletions(-) diff --git a/migration/migration.c b/migration/migration.c index 24cb4b9d0d..5d322eb9d6 100644 -

[Qemu-devel] [PATCH for-4.0 v9 15/16] qemu_thread: supplement error handling for touch_all_pages

2018-12-25 Thread Fei Li
Supplement the error handling for touch_all_pages: add an Error parameter for it to propagate the error to its caller to do the handling in case it fails. Cc: Markus Armbruster Signed-off-by: Fei Li --- util/oslib-posix.c | 25 - 1 file changed, 16 insertions(+), 9

[Qemu-devel] [PATCH for-4.0 v9 11/16] qemu_thread: supplement error handling for emulated_realize

2018-12-25 Thread Fei Li
Utilize the existed errp to propagate the error and do the corresponding cleanup to replace the temporary &error_abort. Cc: Cc: Markus Armbruster Cc: Gerd Hoffmann Signed-off-by: Fei Li --- hw/usb/ccid-card-emulated.c | 15 +-- 1 file changed, 9 insertions(+), 6 deletions(-)

[Qemu-devel] [PATCH for-4.0 v9 05/16] migration: unify error handling for process_incoming_migration_co

2018-12-25 Thread Fei Li
er Cc: Dr. David Alan Gilbert Cc: Peter Xu Signed-off-by: Fei Li --- migration/migration.c | 26 +- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/migration/migration.c b/migration/migration.c index 5d322eb9d6..ded151b1bf 100644 --- a/migration/migrati

[Qemu-devel] [PATCH for-4.0 v9 14/16] qemu_thread: supplement error handling for vnc_start_worker_thread

2018-12-25 Thread Fei Li
Supplement the error handling for vnc_thread_worker_thread: add an Error parameter for it to propagate the error to its caller to handle in case it fails, and make it return a Boolean to indicate whether it succeeds. Cc: Markus Armbruster Cc: Gerd Hoffmann Signed-off-by: Fei Li --- ui/vnc

[Qemu-devel] [PATCH for-4.0 v9 08/16] qemu_thread: supplement error handling for qmp_dump_guest_memory

2018-12-25 Thread Fei Li
Utilize the existed errp to propagate the error instead of the temporary &error_abort. Cc: Markus Armbruster Cc: Marc-André Lureau Signed-off-by: Fei Li --- dump.c | 7 --- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/dump.c b/dump.c index c35d6ddd22..ef5ea324fa 10

[Qemu-devel] [PATCH for-4.0 v9 02/16] migration: fix the multifd code when receiving less channels

2018-12-25 Thread Fei Li
let users decide whether to quit from the destination side when failing to receive packet via some channel. And update the comment for multifd_recv_new_channel(). Cc: Dr. David Alan Gilbert Cc: Peter Xu Cc: Markus Armbruster Signed-off-by: Fei Li Reviewed-by: Peter Xu --- migration/channel.c

[Qemu-devel] [PATCH for-4.0 v9 09/16] qemu_thread: supplement error handling for pci_edu_realize

2018-12-25 Thread Fei Li
Utilize the existed errp to propagate the error instead of the temporary &error_abort. Cc: Markus Armbruster Cc: Jiri Slaby Signed-off-by: Fei Li --- hw/misc/edu.c | 7 --- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/hw/misc/edu.c b/hw/misc/edu.c index 3f4ba7

[Qemu-devel] [PATCH for-4.0 v9 04/16] migration: add more error handling for postcopy_ram_enable_notify

2018-12-25 Thread Fei Li
Call postcopy_ram_incoming_cleanup() to do the cleanup when postcopy_ram_enable_notify fails. Besides, report the error message when qemu_ram_foreach_migratable_block() fails. Cc: Dr. David Alan Gilbert Signed-off-by: Fei Li Reviewed-by: Dr. David Alan Gilbert --- migration/postcopy-ram.c | 1

[Qemu-devel] [PATCH for-4.0 v9 00/16] qemu_thread_create: propagate the error to callers to handle

2018-12-25 Thread Fei Li
dle four fix some migration issues. BTW, I am leaving my current company now, and will use "Fei Li " to continue with this patch series. Please help to review, thanks a lot! :) v9: - To ease the review and involve the appropriate maintainers, split the previous 6/7 patch into 10 patch

[Qemu-devel] [PATCH for-4.0 v9 01/16] Fix segmentation fault when qemu_signal_init fails

2018-12-25 Thread Fei Li
caller. Fixes: 2f78e491d7b46542158ce0b8132ee4e05bc0ade4 Cc: Paolo Bonzini Signed-off-by: Fei Li Reviewed-by: Fam Zheng Reviewed-by: Markus Armbruster --- util/main-loop.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/util/main-loop.c b/util/main-loop.c index affe0403c5

Re: [Qemu-devel] [PATCH for-4.0 v8 6/7] qemu_thread_create: propagate the error to callers to handle

2018-12-25 Thread Fei Li
ment layer. And I will use my new personal email address (shirley17...@gmail.com <mailto:shirley17...@gmail.com>) to follow the new version. :) Merry Christmas, and have a nice day, thanks all! Fei On 12/24/2018 02:53 PM, Fei Li wrote: On 12/24/2018 11:34 AM, Peter Xu wrote: On Fri,

Re: [Qemu-devel] [PATCH for-4.0 v8 6/7] qemu_thread_create: propagate the error to callers to handle

2018-12-23 Thread Fei Li
On 12/24/2018 11:34 AM, Peter Xu wrote: On Fri, Dec 21, 2018 at 05:36:57PM +0800, Fei Li wrote: On 12/19/2018 08:14 PM, Fei Li wrote: On 12/19/2018 06:10 PM, Markus Armbruster wrote: Fei Li writes: On 12/13/2018 03:26 PM, Markus Armbruster wrote: There's a question for David G

Re: [Qemu-devel] [PATCH for-4.0 v8 6/7] qemu_thread_create: propagate the error to callers to handle

2018-12-21 Thread Fei Li
On 12/19/2018 08:14 PM, Fei Li wrote: On 12/19/2018 06:10 PM, Markus Armbruster wrote: Fei Li writes: On 12/13/2018 03:26 PM, Markus Armbruster wrote: There's a question for David Gibson inline.  Please search for /ppc/. Fei Li writes: Make qemu_thread_create() return a Boole

Re: [Qemu-devel] [PATCH for-4.0 v8 3/7] migration: fix the multifd code when receiving less channels

2018-12-19 Thread Fei Li
On 12/19/2018 10:11 PM, Markus Armbruster wrote: Fei Li writes: On 12/13/2018 02:17 PM, Markus Armbruster wrote: Fei Li writes: In our current code, when multifd is used during migration, if there is an error before the destination receives all new channels, the source keeps running

Re: [Qemu-devel] [PATCH for-4.0 v8 6/7] qemu_thread_create: propagate the error to callers to handle

2018-12-19 Thread Fei Li
On 12/20/2018 01:29 AM, Eric Blake wrote: On 12/19/18 6:14 AM, Fei Li wrote:    28 files changed, 243 insertions(+), 101 deletions(-) I recommend to split this patch.  First part adds the Error ** parameter to qemu_thread_create(), passing &error_abort everywhere. No functional ch

Re: [Qemu-devel] [PATCH for-4.0 v8 6/7] qemu_thread_create: propagate the error to callers to handle

2018-12-19 Thread Fei Li
On 12/19/2018 06:10 PM, Markus Armbruster wrote: Fei Li writes: On 12/13/2018 03:26 PM, Markus Armbruster wrote: There's a question for David Gibson inline. Please search for /ppc/. Fei Li writes: Make qemu_thread_create() return a Boolean to indicate if it succeeds rather

Re: [Qemu-devel] [PATCH for-4.0 v8 6/7] qemu_thread_create: propagate the error to callers to handle

2018-12-18 Thread Fei Li
On 12/17/2018 03:29 PM, Fei Li wrote: On 12/13/2018 03:26 PM, Markus Armbruster wrote: There's a question for David Gibson inline.  Please search for /ppc/. Fei Li writes: Make qemu_thread_create() return a Boolean to indicate if it succeeds rather than failing with an error. An

Re: [Qemu-devel] [PATCH for-4.0 v8 3/7] migration: fix the multifd code when receiving less channels

2018-12-17 Thread Fei Li
On 12/13/2018 02:17 PM, Markus Armbruster wrote: Fei Li writes: In our current code, when multifd is used during migration, if there is an error before the destination receives all new channels, the source keeps running, however the destination does not exit but keeps waiting until the

Re: [Qemu-devel] [PATCH for-4.0 v8 6/7] qemu_thread_create: propagate the error to callers to handle

2018-12-16 Thread Fei Li
On 12/13/2018 03:26 PM, Markus Armbruster wrote: There's a question for David Gibson inline. Please search for /ppc/. Fei Li writes: Make qemu_thread_create() return a Boolean to indicate if it succeeds rather than failing with an error. And add an Error parameter to hold the

[Qemu-devel] [PATCH for-4.0 v8 7/7] qemu_thread_join: fix segmentation fault

2018-12-11 Thread Fei Li
To avoid the segmentation fault in qemu_thread_join(), just directly return when the QemuThread *thread failed to be created in either qemu-thread-posix.c or qemu-thread-win32.c. Cc: Stefan Weil Signed-off-by: Fei Li Reviewed-by: Fam Zheng --- util/qemu-thread-posix.c | 3 +++ util/qemu

[Qemu-devel] [PATCH for-4.0 v8 6/7] qemu_thread_create: propagate the error to callers to handle

2018-12-11 Thread Fei Li
Make qemu_thread_create() return a Boolean to indicate if it succeeds rather than failing with an error. And add an Error parameter to hold the error message and let the callers handle it. Cc: Markus Armbruster Cc: Daniel P. Berrangé Cc: Dr. David Alan Gilbert Signed-off-by: Fei Li

[Qemu-devel] [PATCH for-4.0 v8 4/7] migration: remove unused &local_err parameter in multifd_save_cleanup

2018-12-11 Thread Fei Li
f-by: Fei Li Reviewed-by: Juan Quintela --- migration/migration.c | 5 + migration/ram.c | 11 --- migration/ram.h | 2 +- 3 files changed, 6 insertions(+), 12 deletions(-) diff --git a/migration/migration.c b/migration/migration.c index 72106bddf0..0537fc0c26 100644 -

[Qemu-devel] [PATCH for-4.0 v8 5/7] migration: add more error handling for postcopy_ram_enable_notify

2018-12-11 Thread Fei Li
Call postcopy_ram_incoming_cleanup() to do the cleanup when postcopy_ram_enable_notify fails. Besides, report the error message when qemu_ram_foreach_migratable_block() fails. Cc: Dr. David Alan Gilbert Signed-off-by: Fei Li Reviewed-by: Dr. David Alan Gilbert --- migration/postcopy-ram.c | 1

[Qemu-devel] [PATCH for-4.0 v8 0/7] qemu_thread_create: propagate errors to callers to check

2018-12-11 Thread Fei Li
- Merge v1's last two patches into one to avoid the compile error - Fix one omitted error in patch1 and update some error messages Fei Li (7): Fix segmentation fault when qemu_signal_init fails qemu_init_vcpu: add a new Error parameter to propagate migration: fix the multifd code when rec

[Qemu-devel] [PATCH for-4.0 v8 1/7] Fix segmentation fault when qemu_signal_init fails

2018-12-11 Thread Fei Li
caller. Fixes: 2f78e491d7b46542158ce0b8132ee4e05bc0ade4 Cc: Paolo Bonzini Signed-off-by: Fei Li Reviewed-by: Fam Zheng Reviewed-by: Markus Armbruster --- util/main-loop.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/util/main-loop.c b/util/main-loop.c index affe0403c5

[Qemu-devel] [PATCH for-4.0 v8 3/7] migration: fix the multifd code when receiving less channels

2018-12-11 Thread Fei Li
let users decide whether to quit from the destination side when failing to receive packet via some channel. Cc: Dr. David Alan Gilbert Signed-off-by: Fei Li Reviewed-by: Peter Xu --- migration/channel.c | 11 ++- migration/migration.c | 9 +++-- migration/migration.h | 2

[Qemu-devel] [PATCH for-4.0 v8 2/7] qemu_init_vcpu: add a new Error parameter to propagate

2018-12-11 Thread Fei Li
_init_vcpu() to propagate the error and let the further callers check it. Besides, make qemu_init_vcpu() return a Boolean value to let its callers know whether it succeeds. Cc: Paolo Bonzini Signed-off-by: Fei Li Reviewed-by: Fam Zheng Reviewed-by: Juan Quintela --- accel/tcg/user-exec-stub.c

Re: [Qemu-devel] [PATCH RFC v2 3/5] migration: fix the multifd code when receiving less channels

2018-12-05 Thread Fei Li
On 11/30/2018 11:45 AM, Fei Li wrote: On 11/29/2018 10:46 PM, Philippe Mathieu-Daudé wrote: Hi Fei, On 29/11/18 11:03, Fei Li wrote: In our current code, when multifd is used during migration, if there is an error before the destination receives all new channels, the source keeps running

Re: [Qemu-devel] [PATCH RFC v7 5/9] migration: fix the multifd code when sending less channels

2018-12-03 Thread Fei Li
Hi Juan, Kindly ping again. :) Have a nice day, thanks Fei On 11/12/2018 12:43 PM, Fei Li wrote: Hi Juan, Kindly ping, as this multifd migration topic needs your suggestions. :) Have a nice day, thanks Fei On 11/03/2018 12:33 AM, Dr. David Alan Gilbert wrote: * Peter Xu (pet...@redhat.com

Re: [Qemu-devel] [PATCH RFC 2/5] qemu_thread_join: fix segmentation fault

2018-11-30 Thread Fei Li
On 11/29/2018 10:32 PM, Philippe Mathieu-Daudé wrote: Hi Fei, On 28/11/18 11:33, Fei Li wrote: To avoid the segmentation fault in qemu_thread_join(), just directly return when the QemuThread *thread failed to be created in either qemu-thread-posix.c or qemu-thread-win32.c. Signed-off-by

Re: [Qemu-devel] [PATCH for-3.1? RFC v2 0/5] fix some segmentation faults and migration issues

2018-11-29 Thread Fei Li
On 11/29/2018 10:20 PM, Eric Blake wrote: On 11/29/18 4:03 AM, Fei Li wrote: These five patches almost get the Reviewed-by and are extracted from previous "[PATCH RFC v7 0/9] qemu_thread_create: propagate errors to callers to check."  The mentioned patch series have waited on o

Re: [Qemu-devel] [PATCH RFC v2 4/5] migration: remove unused &local_err parameter in multifd_save_cleanup

2018-11-29 Thread Fei Li
On 11/29/2018 10:50 PM, Philippe Mathieu-Daudé wrote: On 29/11/18 11:03, Fei Li wrote: Always call migrate_set_error() to set the error state without relying on whether multifd_save_cleanup() succeeds. As the passed &local_err is never used in multifd_save_cleanup(), remove it. And make

Re: [Qemu-devel] [PATCH RFC v2 3/5] migration: fix the multifd code when receiving less channels

2018-11-29 Thread Fei Li
On 11/29/2018 10:46 PM, Philippe Mathieu-Daudé wrote: Hi Fei, On 29/11/18 11:03, Fei Li wrote: In our current code, when multifd is used during migration, if there is an error before the destination receives all new channels, the source keeps running, however the destination does not exit

Re: [Qemu-devel] [PATCH RFC v2 1/5] Fix segmentation fault when qemu_signal_init fails

2018-11-29 Thread Fei Li
r this tip! :) Have a nice day Fei Fei Li writes: When qemu_signal_init() fails in qemu_init_main_loop(), we return without setting an error. Its callers crash then when they try to report the error with error_report_err(). To avoid such segmentation fault, add a new Error parameter to make the

[Qemu-devel] [PATCH RFC v2 5/5] migration: add more error handling for postcopy_ram_enable_notify

2018-11-29 Thread Fei Li
Call postcopy_ram_incoming_cleanup() to do the cleanup when postcopy_ram_enable_notify fails. Besides, report the error message when qemu_ram_foreach_migratable_block() fails. Cc: Dr. David Alan Gilbert Signed-off-by: Fei Li --- migration/postcopy-ram.c | 1 + migration/savevm.c | 1 + 2

[Qemu-devel] [PATCH RFC v2 0/5] fix some segmentation faults and migration issues

2018-11-29 Thread Fei Li
end) these five almost-done patches and hope they can be merged for the next tag. Thanks for the review. :) v2: - Update the commit message for patch 1/5, and get one more Reviewed-by. - Get one Reviewed-by for patch 3/5. Fei Li (5): Fix segmentation fault when qemu_signal_init fails qemu_t

[Qemu-devel] [PATCH RFC v2 3/5] migration: fix the multifd code when receiving less channels

2018-11-29 Thread Fei Li
let users decide whether to quit from the destination side when failing to receive packet via some channel. Signed-off-by: Fei Li Reviewed-by: Peter Xu --- migration/channel.c | 11 ++- migration/migration.c | 9 +++-- migration/migration.h | 2 +- migration/ram.c | 7

[Qemu-devel] [PATCH RFC v2 1/5] Fix segmentation fault when qemu_signal_init fails

2018-11-29 Thread Fei Li
caller. Fixes: 2f78e491d7b46542158ce0b8132ee4e05bc0ade4 Cc: Markus Armbruster Cc: Fam Zheng Signed-off-by: Fei Li Reviewed-by: Fam Zheng Reviewed-by: Markus Armbruster --- util/main-loop.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/util/main-loop.c b/util/main

[Qemu-devel] [PATCH RFC v2 4/5] migration: remove unused &local_err parameter in multifd_save_cleanup

2018-11-29 Thread Fei Li
Always call migrate_set_error() to set the error state without relying on whether multifd_save_cleanup() succeeds. As the passed &local_err is never used in multifd_save_cleanup(), remove it. And make the function be: void multifd_save_cleanup(void). Signed-off-by: Fei Li Reviewed-by:

[Qemu-devel] [PATCH RFC v2 2/5] qemu_thread_join: fix segmentation fault

2018-11-29 Thread Fei Li
To avoid the segmentation fault in qemu_thread_join(), just directly return when the QemuThread *thread failed to be created in either qemu-thread-posix.c or qemu-thread-win32.c. Signed-off-by: Fei Li Reviewed-by: Fam Zheng --- util/qemu-thread-posix.c | 3 +++ util/qemu-thread-win32.c | 2

Re: [Qemu-devel] [PATCH RFC 1/5] Fix segmentation fault when qemu_signal_init fails

2018-11-29 Thread Fei Li
On 11/29/2018 04:35 PM, Markus Armbruster wrote: Fei Li writes: On 11/28/2018 08:53 PM, Markus Armbruster wrote: Fei Li writes: When qemu_signal_init() fails in qemu_init_main_loop(), we return without setting an error. Its callers crash then when they try to report the error with

Re: [Qemu-devel] [PATCH RFC 1/5] Fix segmentation fault when qemu_signal_init fails

2018-11-28 Thread Fei Li
On 11/28/2018 08:53 PM, Markus Armbruster wrote: Fei Li writes: When qemu_signal_init() fails in qemu_init_main_loop(), we return without setting an error. Its callers crash then when they try to report the error with error_report_err(). Yes, that's a bug. Broken in 2f78e491d7b, v

[Qemu-devel] [PATCH RFC 5/5] migration: add more error handling for postcopy_ram_enable_notify

2018-11-28 Thread Fei Li
Call postcopy_ram_incoming_cleanup() to do the cleanup when postcopy_ram_enable_notify fails. Besides, report the error message when qemu_ram_foreach_migratable_block() fails. Cc: Dr. David Alan Gilbert Signed-off-by: Fei Li --- migration/postcopy-ram.c | 1 + migration/savevm.c | 1 + 2

[Qemu-devel] [PATCH RFC 2/5] qemu_thread_join: fix segmentation fault

2018-11-28 Thread Fei Li
To avoid the segmentation fault in qemu_thread_join(), just directly return when the QemuThread *thread failed to be created in either qemu-thread-posix.c or qemu-thread-win32.c. Signed-off-by: Fei Li Reviewed-by: Fam Zheng --- util/qemu-thread-posix.c | 3 +++ util/qemu-thread-win32.c | 2

[Qemu-devel] [PATCH RFC 4/5] migration: remove unused &local_err parameter in multifd_save_cleanup

2018-11-28 Thread Fei Li
Always call migrate_set_error() to set the error state without relying on whether multifd_save_cleanup() succeeds. As the passed &local_err is never used in multifd_save_cleanup(), remove it. And make the function be: void multifd_save_cleanup(void). Signed-off-by: Fei Li Reviewed-by:

[Qemu-devel] [PATCH RFC 3/5] migration: fix the multifd code when receiving less channels

2018-11-28 Thread Fei Li
let users decide whether to quit from the destination side when failing to receive packet via some channel. Cc: Dr. David Alan Gilbert Cc: Peter Xu Signed-off-by: Fei Li --- migration/channel.c | 11 ++- migration/migration.c | 9 +++-- migration/migration.h | 2 +- migration

[Qemu-devel] [PATCH RFC 1/5] Fix segmentation fault when qemu_signal_init fails

2018-11-28 Thread Fei Li
caller. Cc: Markus Armbruster Cc: Fam Zheng Signed-off-by: Fei Li Reviewed-by: Fam Zheng --- util/main-loop.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/util/main-loop.c b/util/main-loop.c index affe0403c5..443cb4cfe8 100644 --- a/util/main-loop.c +++ b/util/main

[Qemu-devel] [PATCH RFC 0/5] fix some segmentation faults and migration issues

2018-11-28 Thread Fei Li
end) these five almost-done patches and hope they can be merged for the next tag. Thanks for the review. :) Fei Li (5): Fix segmentation fault when qemu_signal_init fails qemu_thread_join: fix segmentation fault migration: fix the multifd code when receiving less channels migration: rem

Re: [Qemu-devel] [PATCH RFC v7 5/9] migration: fix the multifd code when sending less channels

2018-11-11 Thread Fei Li
Hi Juan, Kindly ping, as this multifd migration topic needs your suggestions. :) Have a nice day, thanks Fei On 11/03/2018 12:33 AM, Dr. David Alan Gilbert wrote: * Peter Xu (pet...@redhat.com) wrote: On Fri, Nov 02, 2018 at 11:00:24AM +0800, Fei Li wrote: On 11/02/2018 10:37 AM, Peter Xu

Re: [Qemu-devel] [PATCH RFC v7 9/9] qemu_thread_create: propagate the error to callers to handle

2018-11-05 Thread Fei Li
On 11/05/2018 09:53 PM, Juan Quintela wrote: Fei Li wrote: Make qemu_thread_create() return a Boolean to indicate if it succeeds rather than failing with an error. And add an Error parameter to hold the error message and let the callers handle it. Nice work, thanks. Signed-off-by: Fei

Re: [Qemu-devel] [PATCH RFC v7 6/9] migration: fix the multifd code when receiving less channels

2018-11-05 Thread Fei Li
On 11/02/2018 10:46 AM, Peter Xu wrote: On Thu, Nov 01, 2018 at 06:17:12PM +0800, Fei Li wrote: [...] @@ -1339,7 +1339,7 @@ bool multifd_recv_all_channels_created(void) } /* Return true if multifd is ready for the migration, otherwise false */ -bool multifd_recv_new_channel

Re: [Qemu-devel] [PATCH RFC v7 1/9] Fix segmentation fault when qemu_signal_init fails

2018-11-05 Thread Fei Li
Hi, On 11/05/2018 09:32 PM, Juan Quintela wrote: Fei Li wrote: When qemu_signal_init() fails in qemu_init_main_loop(), we return without setting an error. Its callers crash then when they try to report the error with error_report_err(). To avoid such segmentation fault, add a new Error

Re: [Qemu-devel] [PATCH RFC v7 7/9] migration: remove unused &local_err parameter in migrate_set_error

2018-11-05 Thread Fei Li
On 11/05/2018 09:59 PM, Juan Quintela wrote: Fei Li wrote: Always call migrate_set_error() to set the error state without relying on whether multifd_save_cleanup() succeeds. As the passed &local_err is never used in multifd_save_cleanup(), remove it. Error is not used, you are right.

Re: [Qemu-devel] [PATCH RFC v7 0/9] qemu_thread_create: propagate errors to callers to check

2018-11-04 Thread Fei Li
Sorry that somehow forget the "#include "qemu/error-report.h" for hw/usb/ccid-card-emulated.c Have a nice day, thanks Fei On 11/04/2018 02:09 AM, no-re...@patchew.org wrote: Hi, This series failed docker-quick@centos7 build test. Please find the testing commands and their output below. If you

Re: [Qemu-devel] [PATCH RFC v7 5/9] migration: fix the multifd code when sending less channels

2018-11-02 Thread Fei Li
On 11/02/2018 11:32 AM, Peter Xu wrote: On Fri, Nov 02, 2018 at 11:00:24AM +0800, Fei Li wrote: On 11/02/2018 10:37 AM, Peter Xu wrote: On Thu, Nov 01, 2018 at 06:17:11PM +0800, Fei Li wrote: Set the migration state to "failed" instead of "setup" when failing to

Re: [Qemu-devel] [PATCH RFC v7 4/9] migration: fix some segmentation faults when using multifd

2018-11-01 Thread Fei Li
On 11/02/2018 10:31 AM, Peter Xu wrote: On Thu, Nov 01, 2018 at 06:17:10PM +0800, Fei Li wrote: When multifd is used during migration, a segmentaion fault will occur in the source when multifd_save_cleanup() is called again if the multifd_send_state has been freed in earlier error handling

Re: [Qemu-devel] [PATCH RFC v7 5/9] migration: fix the multifd code when sending less channels

2018-11-01 Thread Fei Li
On 11/02/2018 10:37 AM, Peter Xu wrote: On Thu, Nov 01, 2018 at 06:17:11PM +0800, Fei Li wrote: Set the migration state to "failed" instead of "setup" when failing to send packet via some channel. Could you please provide more information in the commit message? E.g.,

[Qemu-devel] [PATCH RFC v7 9/9] qemu_thread_create: propagate the error to callers to handle

2018-11-01 Thread Fei Li
Make qemu_thread_create() return a Boolean to indicate if it succeeds rather than failing with an error. And add an Error parameter to hold the error message and let the callers handle it. Signed-off-by: Fei Li --- cpus.c | 45 - dump.c

[Qemu-devel] [PATCH RFC v7 8/9] migration: add more error handling for postcopy_ram_enable_notify

2018-11-01 Thread Fei Li
Call postcopy_ram_incoming_cleanup() to do the cleanup when postcopy_ram_enable_notify fails. Besides, report the error message when qemu_ram_foreach_migratable_block() fails. Cc: Dr. David Alan Gilbert Signed-off-by: Fei Li --- migration/postcopy-ram.c | 1 + migration/savevm.c | 1 + 2

[Qemu-devel] [PATCH RFC v7 0/9] qemu_thread_create: propagate errors to callers to check

2018-11-01 Thread Fei Li
to one to avoid the compile error - Fix one omitted error in patch1 and update some error messages Fei Li (9): Fix segmentation fault when qemu_signal_init fails qemu_init_vcpu: add a new Error parameter to propagate qemu_thread_join: fix segmentation fault migration: fix some segmentatio

[Qemu-devel] [PATCH RFC v7 6/9] migration: fix the multifd code when receiving less channels

2018-11-01 Thread Fei Li
let users decide whether to quit from the destination side when failing to receive packet via some channel. Cc: Dr. David Alan Gilbert Cc: Peter Xu Signed-off-by: Fei Li --- migration/channel.c | 11 ++- migration/migration.c | 9 +++-- migration/migration.h | 2 +- migration

[Qemu-devel] [PATCH RFC v7 7/9] migration: remove unused &local_err parameter in migrate_set_error

2018-11-01 Thread Fei Li
Always call migrate_set_error() to set the error state without relying on whether multifd_save_cleanup() succeeds. As the passed &local_err is never used in multifd_save_cleanup(), remove it. Cc: Dr. David Alan Gilbert Signed-off-by: Fei Li --- migration/migration.c | 5 + migration/r

[Qemu-devel] [PATCH RFC v7 4/9] migration: fix some segmentation faults when using multifd

2018-11-01 Thread Fei Li
) when multifd_recv_initial_packet() fails. Signed-off-by: Fei Li --- migration/ram.c | 28 +--- 1 file changed, 21 insertions(+), 7 deletions(-) diff --git a/migration/ram.c b/migration/ram.c index 7e7deec4d8..4db3b3e8f4 100644 --- a/migration/ram.c +++ b/migration/ram.c @@ -907,6 +907,11 @@

[Qemu-devel] [PATCH RFC v7 2/9] qemu_init_vcpu: add a new Error parameter to propagate

2018-11-01 Thread Fei Li
_init_vcpu() to propagate the error and let the further callers check it. Besides, make qemu_init_vcpu() return a Boolean value to let its callers know whether it succeeds. Signed-off-by: Fei Li Reviewed-by: Fam Zheng --- accel/tcg/user-exec-stub.c | 3 ++- cpus.c

[Qemu-devel] [PATCH RFC v7 3/9] qemu_thread_join: fix segmentation fault

2018-11-01 Thread Fei Li
To avoid the segmentation fault in qemu_thread_join(), just directly return when the QemuThread *thread failed to be created in either qemu-thread-posix.c or qemu-thread-win32.c. Signed-off-by: Fei Li Reviewed-by: Fam Zheng --- util/qemu-thread-posix.c | 3 +++ util/qemu-thread-win32.c | 2

[Qemu-devel] [PATCH RFC v7 1/9] Fix segmentation fault when qemu_signal_init fails

2018-11-01 Thread Fei Li
caller. Cc: Markus Armbruster Cc: Fam Zheng Signed-off-by: Fei Li Reviewed-by: Fam Zheng --- util/main-loop.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/util/main-loop.c b/util/main-loop.c index affe0403c5..443cb4cfe8 100644 --- a/util/main-loop.c +++ b/util/main

[Qemu-devel] [PATCH RFC v7 5/9] migration: fix the multifd code when sending less channels

2018-11-01 Thread Fei Li
Set the migration state to "failed" instead of "setup" when failing to send packet via some channel. Cc: Peter Xu Signed-off-by: Fei Li --- migration/ram.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/migration/ram.c b/migration/ram.c index 4db3b3e8f4..c84

Re: [Qemu-devel] [PATCH RFC v6 6/7] migration: fix some error handling

2018-10-31 Thread Fei Li
On 11/01/2018 12:30 AM, Dr. David Alan Gilbert wrote: * Fei Li (f...@suse.com) wrote: On 10/31/2018 03:49 AM, Dr. David Alan Gilbert wrote: * Fei Li (f...@suse.com) wrote: Add error handling for qemu_ram_foreach_migratable_block() when it fails. Always call migrate_set_error() to set the

Re: [Qemu-devel] [PATCH RFC v6 5/7] migration: fix the multifd code when receiving less channels

2018-10-31 Thread Fei Li
this does not bother you too much. ;) Have a nice day, thanks again Fei On 10/29/2018 08:58 PM, Fei Li wrote: In our current code, when multifd is used during migration, if there is an error before the destination receives all new channels, the source keeps running, however the destination does n

Re: [Qemu-devel] [PATCH RFC v6 5/7] migration: fix the multifd code when receiving less channels

2018-10-31 Thread Fei Li
On 10/31/2018 06:18 AM, Peter Xu wrote: On Tue, Oct 30, 2018 at 06:05:18PM +0800, Fei Li wrote: [...] @@ -1366,6 +1373,10 @@ bool multifd_recv_new_channel(QIOChannel *ioc) QEMU_THREAD_JOINABLE); atomic_inc(&multifd_recv_state->count);

Re: [Qemu-devel] [PATCH RFC v6 6/7] migration: fix some error handling

2018-10-31 Thread Fei Li
On 10/31/2018 03:49 AM, Dr. David Alan Gilbert wrote: * Fei Li (f...@suse.com) wrote: Add error handling for qemu_ram_foreach_migratable_block() when it fails. Always call migrate_set_error() to set the error state without relying on whether multifd_save_cleanup() succeeds. As the passed

Re: [Qemu-devel] [PATCH RFC v6 5/7] migration: fix the multifd code when receiving less channels

2018-10-30 Thread Fei Li
On 10/30/2018 02:05 PM, Peter Xu wrote: On Mon, Oct 29, 2018 at 08:58:16PM +0800, Fei Li wrote: In our current code, when multifd is used during migration, if there is an error before the destination receives all new channels, the source keeps running, however the destination does not exit

[Qemu-devel] [PATCH RFC v6 7/7] qemu_thread_create: propagate the error to callers to handle

2018-10-29 Thread Fei Li
Make qemu_thread_create() return a Boolean to indicate if it succeeds rather than failing with an error. And add an Error parameter to hold the error message and let the callers handle it. Signed-off-by: Fei Li --- cpus.c | 45 ++- dump.c

[Qemu-devel] [PATCH RFC v6 3/7] qemu_thread_join: fix segmentation fault

2018-10-29 Thread Fei Li
To avoid the segmentation fault in qemu_thread_join(), just directly return when the QemuThread *thread failed to be created in either qemu-thread-posix.c or qemu-thread-win32.c. Signed-off-by: Fei Li Reviewed-by: Fam Zheng --- util/qemu-thread-posix.c | 3 +++ util/qemu-thread-win32.c | 2

[Qemu-devel] [PATCH RFC v6 6/7] migration: fix some error handling

2018-10-29 Thread Fei Li
Add error handling for qemu_ram_foreach_migratable_block() when it fails. Always call migrate_set_error() to set the error state without relying on whether multifd_save_cleanup() succeeds. As the passed &local_err is never used in multifd_save_cleanup(), remove it. Signed-off-by: Fe

[Qemu-devel] [PATCH RFC v6 4/7] migration: fix some segmentation faults when using multifd

2018-10-29 Thread Fei Li
) when multifd_recv_initial_packet() fails. Signed-off-by: Fei Li --- migration/ram.c | 28 +--- 1 file changed, 21 insertions(+), 7 deletions(-) diff --git a/migration/ram.c b/migration/ram.c index 7e7deec4d8..4db3b3e8f4 100644 --- a/migration/ram.c +++ b/migration/ram.c @@ -907,6 +907,11 @@

<    1   2   3   >