[Qemu-devel] Can not hotplug device to pci-to-pci bridge using machine type older than 1.7

2018-01-25 Thread Fei Li
Hi, After I hotplug a pci device to a pci2pci bridge (I use "pci.1") with machine type 1.7 or older, I can not see the pci device via `lspci` in the guest, but can see it via `info qtree` in the hmp. What's more, after I reboot the guest or hotplug another pci device to pci.0, I can see the p

Re: [Qemu-devel] Can not hotplug device to pci-to-pci bridge using machine type older than 1.7

2018-01-31 Thread Fei Li
On 01/29/2018 09:33 PM, Igor Mammedov wrote: On Thu, 25 Jan 2018 16:01:39 +0800 Fei Li wrote: Hi, After I hotplug a pci device to a pci2pci bridge (I use "pci.1") with machine type 1.7 or older, I can not see the pci device via `lspci` in the guest, but can see it via `info qtr

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 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

[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

[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 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 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 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 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

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 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 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 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 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

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

2018-10-10 Thread Fei Li
error_propagate - Return a bool: false/true to indicate if one function succeeds - 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 u

[Qemu-devel] [PATCH RFC v5 3/7] qemu_init_vcpu: add a new Error parameter to propagate

2018-10-10 Thread Fei Li
succeeds. Signed-off-by: Fei Li Reviewed-by: Fam Zheng --- accel/tcg/user-exec-stub.c | 2 +- cpus.c | 34 +- include/qom/cpu.h | 2 +- target/alpha/cpu.c | 4 +++- target/arm/cpu.c| 4

[Qemu-devel] [PATCH RFC v5 5/7] migration: fix the multifd code

2018-10-10 Thread Fei Li
;c) is not initialized, there is no need to close the channel. Or else a segmentation fault will occur in multifd_recv_terminate_threads() when multifd_recv_initial_packet() fails. Signed-off-by: Fei Li --- migration/ram.c | 22 -- 1 file changed, 16 insertions(+), 6 del

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

2018-10-10 Thread Fei Li
ate the err to the final caller. Signed-off-by: Fei Li Reviewed-by: Fam Zheng --- include/qemu/osdep.h | 2 +- util/compatfd.c | 9 ++--- util/main-loop.c | 9 - 3 files changed, 11 insertions(+), 9 deletions(-) diff --git a/include/qemu/osdep.h b/include/qemu/osdep.h in

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

2018-10-10 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

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

2018-10-10 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 v5 2/7] ui/vnc.c: polish vnc_init_func

2018-10-10 Thread Fei Li
. Signed-off-by: Fei Li Reviewed-by: Fam Zheng --- include/ui/console.h | 2 +- ui/vnc-jobs.c| 9 ++--- ui/vnc-jobs.h| 2 +- ui/vnc.c | 12 +--- 4 files changed, 17 insertions(+), 8 deletions(-) diff --git a/include/ui/console.h b/include/ui/console.h index

[Qemu-devel] [PATCH RFC v5 4/7] qemu_thread_join: fix segmentation fault

2018-10-10 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 v5 1/7] Fix segmentation fault when qemu_signal_init fails

2018-10-11 Thread Fei Li
On 10/11/2018 06:02 PM, Markus Armbruster wrote: Fei Li writes: Currently, when qemu_signal_init() fails it only returns a non-zero value but without propagating any Error. But its callers need a non-null err when runs error_report_err(err), or else 0->msg occurs. The bug is

Re: [Qemu-devel] [PATCH RFC v5 2/7] ui/vnc.c: polish vnc_init_func

2018-10-11 Thread Fei Li
On 10/11/2018 09:13 PM, Markus Armbruster wrote: Fei Li writes: Add a new Error parameter for vnc_display_init() to handle errors in its caller: vnc_init_func(), just like vnc_display_open() does. And let the call trace propagate the Error. Besides, make vnc_start_worker_thread() return a

Re: [Qemu-devel] [PATCH RFC v5 3/7] qemu_init_vcpu: add a new Error parameter to propagate

2018-10-11 Thread Fei Li
On 10/11/2018 09:19 PM, Markus Armbruster wrote: Fei Li writes: The caller of qemu_init_vcpu() already passed the **errp to handle Which caller? There are many. Or do you mean "The callers"? Oh, sorry, I mean "The callers" :) errors. In view of this, add a new Er

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

2018-10-11 Thread Fei Li
On 10/11/2018 09:45 PM, Markus Armbruster wrote: 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 error message and let the callers handle it. Signed-off-by: Fei Li

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

2018-10-12 Thread Fei Li
On 10/12/2018 03:56 PM, Markus Armbruster wrote: Fei Li writes: On 10/11/2018 06:02 PM, Markus Armbruster wrote: Fei Li writes: Currently, when qemu_signal_init() fails it only returns a non-zero value but without propagating any Error. But its callers need a non-null err when runs

Re: [Qemu-devel] [PATCH RFC v5 2/7] ui/vnc.c: polish vnc_init_func

2018-10-12 Thread Fei Li
On 10/12/2018 04:18 PM, Markus Armbruster wrote: Fei Li writes: On 10/11/2018 09:13 PM, Markus Armbruster wrote: Fei Li writes: Add a new Error parameter for vnc_display_init() to handle errors in its caller: vnc_init_func(), just like vnc_display_open() does. And let the call trace

Re: [Qemu-devel] [PATCH RFC v5 3/7] qemu_init_vcpu: add a new Error parameter to propagate

2018-10-12 Thread Fei Li
On 10/12/2018 04:24 PM, Markus Armbruster wrote: Fei Li writes: On 10/11/2018 09:19 PM, Markus Armbruster wrote: Fei Li writes: The caller of qemu_init_vcpu() already passed the **errp to handle Which caller? There are many. Or do you mean "The callers"? Oh, sorry, I

Re: [Qemu-devel] [PATCH RFC v5 2/7] ui/vnc.c: polish vnc_init_func

2018-10-12 Thread Fei Li
On 10/12/2018 06:23 PM, Fei Li wrote: On 10/12/2018 04:18 PM, Markus Armbruster wrote: Fei Li writes: On 10/11/2018 09:13 PM, Markus Armbruster wrote: Fei Li writes: Add a new Error parameter for vnc_display_init() to handle errors in its caller: vnc_init_func(), just like

[Qemu-devel] [PATCH v2] ui/vnc.c: polish vnc_init_func

2018-10-12 Thread Fei Li
Add a new Error parameter for vnc_display_init() to handle errors in its caller: vnc_init_func(), just like vnc_display_open() does. And let its callees propagate the Error, like init_keyboard_layout(). Signed-off-by: Fei Li --- include/ui/console.h | 2 +- ui/curses.c | 4 +++- ui

Re: [Qemu-devel] [PATCH v2] ui/vnc.c: polish vnc_init_func

2018-10-12 Thread Fei Li
On 10/12/2018 07:50 PM, Fei Li wrote: Add a new Error parameter for vnc_display_init() to handle errors in its caller: vnc_init_func(), just like vnc_display_open() does. And let its callees propagate the Error, like init_keyboard_layout(). Signed-off-by: Fei Li As this version do a big

Re: [Qemu-devel] [PATCH v2] ui/vnc.c: polish vnc_init_func

2018-10-15 Thread Fei Li
On 10/15/2018 03:58 PM, Markus Armbruster wrote: Fei Li writes: Add a new Error parameter for vnc_display_init() to handle errors in its caller: vnc_init_func(), just like vnc_display_open() does. And let its callees propagate the Error, like init_keyboard_layout(). Signed-off-by: Fei Li

Re: [Qemu-devel] [PATCH v2 27/35] vnc: Clean up error reporting in vnc_init_func()

2018-10-15 Thread Fei Li
On 10/15/2018 07:53 PM, Markus Armbruster wrote: Calling error_report() in a function that takes an Error ** argument is suspicious. vnc_init_func() does that, and then fails without setting an error. Its caller main(), via qemu_opts_foreach(), is fine with it, but clean it up anyway. Cc: G

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

2018-10-17 Thread Fei Li
Sorry for the late reply! Omitted this one.. On 10/12/2018 09:26 PM, Markus Armbruster wrote: Fei Li writes: On 10/12/2018 03:56 PM, Markus Armbruster wrote: Fei Li writes: On 10/11/2018 06:02 PM, Markus Armbruster wrote: Fei Li writes: Currently, when qemu_signal_init() fails it

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

2018-10-18 Thread Fei Li
Kindly ping. :) Main discuss whether adding the Error for qemu_thread_create() or not. For details, please see blow: On 10/17/2018 04:17 PM, Fei Li wrote: Sorry for the late reply! Omitted this one.. On 10/12/2018 09:26 PM, Markus Armbruster wrote: Fei Li writes: On 10/12/2018 03:56 PM

[Qemu-devel] [PATCH RFC 0/2] Fix migration issues

2018-10-22 Thread Fei Li
ut after closing the window by clicking, the qemu on the dest still hangs there until I exclusively kill the qemu on the source. The source host keeps running as expected, but I guess the hang phenonmenon in the dest is not right. Would someone kindly give some suggestions on this? Thanks a lot. Fei

[Qemu-devel] [PATCH RFC 1/2] migration: fix the multifd code

2018-10-22 Thread Fei Li
;c) is not initialized, there is no need to close the channel. Or else a segmentation fault will occur in multifd_recv_terminate_threads() when multifd_recv_initial_packet() fails. Signed-off-by: Fei Li --- migration/ram.c | 26 -- 1 file changed, 20 insertions(+), 6 del

[Qemu-devel] [PATCH RFC 2/2] migration: fix some error handling

2018-10-22 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

Re: [Qemu-devel] [PATCH RFC 0/2] Fix migration issues

2018-10-25 Thread Fei Li
On 10/25/2018 05:27 AM, Peter Xu wrote: On Mon, Oct 22, 2018 at 07:08:52PM +0800, Fei Li wrote: Hi, these two patches are to fix live migration issues. The first is about multifd, and the second is to fix some error handling. But I have a question about using multifd migration. In our

Re: [Qemu-devel] [PATCH RFC 0/2] Fix migration issues

2018-10-26 Thread Fei Li
On 10/25/2018 08:55 PM, Dr. David Alan Gilbert wrote: * Fei Li (f...@suse.com) wrote: Hi, these two patches are to fix live migration issues. The first is about multifd, and the second is to fix some error handling. But I have a question about using multifd migration. In our current code

Re: [Qemu-devel] [PATCH RFC 0/2] Fix migration issues

2018-10-26 Thread Fei Li
On 10/25/2018 08:58 PM, Peter Xu wrote: On Thu, Oct 25, 2018 at 05:04:00PM +0800, Fei Li wrote: [...] @@ -1325,22 +1325,24 @@ bool multifd_recv_all_channels_created(void)  /* Return true if multifd is ready for the migration, otherwise false */  bool multifd_recv_new_channel(QIOChannel

Re: [Qemu-devel] [PATCH RFC 0/2] Fix migration issues

2018-10-29 Thread Fei Li
On 10/26/2018 11:24 PM, Dr. David Alan Gilbert wrote: * Peter Xu (pet...@redhat.com) wrote: On Fri, Oct 26, 2018 at 09:10:19PM +0800, Fei Li wrote: On 10/25/2018 08:58 PM, Peter Xu wrote: On Thu, Oct 25, 2018 at 05:04:00PM +0800, Fei Li wrote: [...] @@ -1325,22 +1325,24 @@ bool

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

2018-10-29 Thread Fei Li
when it fails to receive packet via some channel. Cc: Dr. David Alan Gilbert Cc: Peter Xu Signed-off-by: Fei Li --- migration/channel.c | 7 ++- migration/migration.c | 9 +++-- migration/migration.h | 2 +- migration/ram.c | 17 ++--- migration/ram.h | 2

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

2018-10-29 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 v6 0/7] qemu_thread_create: propagate errors to callers to check

2018-10-29 Thread Fei Li
s - 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 qemu_thread_join: fix segmentation fau

[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 @@

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

2018-10-29 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 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 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 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

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

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-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 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 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

[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

[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 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 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

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.,

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-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 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

[Qemu-devel] [PATCH RFC v3 2/7] ui/vnc.c: polish vnc_init_func

2018-09-19 Thread Fei Li
. Signed-off-by: Fei Li --- include/ui/console.h | 2 +- ui/vnc-jobs.c| 9 ++--- ui/vnc-jobs.h| 2 +- ui/vnc.c | 12 +--- 4 files changed, 17 insertions(+), 8 deletions(-) diff --git a/include/ui/console.h b/include/ui/console.h index fb969caf70..c17803c530

[Qemu-devel] [PATCH RFC v3 3/7] qemu_init_vcpu: add a new Error parameter to propagate

2018-09-19 Thread Fei Li
succeeds. Signed-off-by: Fei Li --- accel/tcg/user-exec-stub.c | 2 +- cpus.c | 34 +- include/qom/cpu.h | 2 +- target/alpha/cpu.c | 4 +++- target/arm/cpu.c| 4 +++- target/cris/cpu.c

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

2018-09-19 Thread Fei Li
ate the err to the final caller. This patch also adds the omitted error handling when creating signalfd pipe fails in qemu_signalfd_compat(). Signed-off-by: Fei Li --- include/qemu/osdep.h | 2 +- util/compatfd.c | 9 ++--- util/main-loop.c | 11 +-- 3 files changed,

[Qemu-devel] [PATCH RFC v3 4/7] migration: fix the compression code

2018-09-19 Thread Fei Li
27; failed." will occur. One test case can reproduce this error is: set the compression on and fail to fully setup the eight compression thread in compress_threads_save_setup(). Signed-off-by: Fei Li --- migration/ram.c | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a

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

2018-09-19 Thread Fei Li
or messages v2: - Pass errp straightly instead of using a local_err & error_propagate - Return a bool: false/true to indicate if one function succeeds - 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

[Qemu-devel] [PATCH RFC v3 5/7] migration: fix the multifd code

2018-09-19 Thread Fei Li
;c) is not initialized, there is no need to close the channel. Or else a segmentation fault will occur in multifd_recv_terminate_threads() when multifd_recv_initial_packet() fails. Signed-off-by: Fei Li --- migration/ram.c | 24 +++- 1 file changed, 19 insertions(+), 5 del

[Qemu-devel] [PATCH RFC v3 6/7] qemu_thread_join: fix segmentation fault

2018-09-19 Thread Fei Li
To avoid the segmentation fault in qemu_thread_join(), just directly return when the QemuThread *thread was failed to be created in both qemu-thread-posix.c and qemu-thread-win32.c. Signed-off-by: Fei Li --- util/qemu-thread-posix.c | 3 +++ util/qemu-thread-win32.c | 2 +- 2 files changed, 4

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

2018-09-19 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

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

2018-09-19 Thread Fei Li
On 09/19/2018 10:49 PM, Fam Zheng wrote: On Wed, 09/19 21:35, Fei Li wrote: Currently, when qemu_signal_init() fails it only returns a non-zero value but without propagating any Error. But its callers need a non-null err when runs error_report_err(err), or else 0->msg occurs. To avoid s

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

2018-09-19 Thread Fei Li
On 09/20/2018 11:28 AM, Peter Xu wrote: On Wed, Sep 19, 2018 at 09:35:17PM +0800, Fei Li wrote: Currently, when qemu_signal_init() fails it only returns a non-zero value but without propagating any Error. But its callers need a non-null err when runs error_report_err(err), or else 0->

Re: [Qemu-devel] [PATCH RFC v3 6/7] qemu_thread_join: fix segmentation fault

2018-09-19 Thread Fei Li
On 09/19/2018 11:14 PM, Fam Zheng wrote: On Wed, 09/19 21:35, Fei Li wrote: To avoid the segmentation fault in qemu_thread_join(), just directly return when the QemuThread *thread was failed to be created in both qemu-thread-posix.c and qemu-thread-win32.c. Per English grammar, I think

Re: [Qemu-devel] [PATCH RFC v3 4/7] migration: fix the compression code

2018-09-19 Thread Fei Li
On 09/20/2018 12:31 PM, Peter Xu wrote: On Wed, Sep 19, 2018 at 09:35:20PM +0800, Fei Li wrote: Add judgement in compress_threads_save_cleanup() to check whether the static CompressParam *comp_param has been allocated. If not, just return; or else Segmentation fault will occur when using the

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

2018-09-20 Thread Fei Li
On 09/19/2018 11:51 PM, Fam Zheng wrote: On Wed, 09/19 21:35, 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. Signed-off-by: Fei Li

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

2018-09-20 Thread Fei Li
On 09/20/2018 03:32 PM, Fam Zheng wrote: On Wed, 09/19 23:51, Fam Zheng wrote: diff --git a/hw/rdma/rdma_backend.c b/hw/rdma/rdma_backend.c index d7a4bbd91f..e7cbb0c368 100644 --- a/hw/rdma/rdma_backend.c +++ b/hw/rdma/rdma_backend.c @@ -165,7 +165,8 @@ static void start_comp_thread(RdmaBacke

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

2018-09-21 Thread Fei Li
On 09/21/2018 09:05 AM, Fam Zheng wrote: On Thu, 09/20 18:19, Fei Li wrote: On 09/19/2018 11:51 PM, Fam Zheng wrote: On Wed, 09/19 21:35, 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

Re: [Qemu-devel] [PATCH RFC v3 4/7] migration: fix the compression code

2018-09-22 Thread Fei Li
Sorry for the late reply. On 09/20/2018 01:33 PM, Peter Xu wrote: On Thu, Sep 20, 2018 at 01:06:21PM +0800, Fei Li wrote: On 09/20/2018 12:31 PM, Peter Xu wrote: On Wed, Sep 19, 2018 at 09:35:20PM +0800, Fei Li wrote: Add judgement in compress_threads_save_cleanup() to check whether the

[Qemu-devel] [PATCH] migration: fix the compression code

2018-09-25 Thread Fei Li
r. Fix this by squashing the terminate_compression_threads() into compress_threads_save_cleanup() and employing the existing judgement condition. One test case can reproduce this error is: set the compression on and fail to fully setup the default eight compression thread in compress_threads_save_set

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

2018-09-26 Thread Fei Li
bool: false/true to indicate if one function succeeds - 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 ui/vnc.c: polish vnc_init_func qemu_in

[Qemu-devel] [PATCH RFC v4 4/7] qemu_thread_join: fix segmentation fault

2018-09-26 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 v4 5/7] migration: fix the multifd code

2018-09-26 Thread Fei Li
;c) is not initialized, there is no need to close the channel. Or else a segmentation fault will occur in multifd_recv_terminate_threads() when multifd_recv_initial_packet() fails. Signed-off-by: Fei Li --- migration/ram.c | 22 -- 1 file changed, 16 insertions(+), 6 del

[Qemu-devel] [PATCH RFC v4 3/7] qemu_init_vcpu: add a new Error parameter to propagate

2018-09-26 Thread Fei Li
succeeds. Signed-off-by: Fei Li Reviewed-by: Fam Zheng --- accel/tcg/user-exec-stub.c | 2 +- cpus.c | 34 +- include/qom/cpu.h | 2 +- target/alpha/cpu.c | 4 +++- target/arm/cpu.c| 4

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

2018-09-26 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 v4 2/7] ui/vnc.c: polish vnc_init_func

2018-09-26 Thread Fei Li
. Signed-off-by: Fei Li Reviewed-by: Fam Zheng --- include/ui/console.h | 2 +- ui/vnc-jobs.c| 9 ++--- ui/vnc-jobs.h| 2 +- ui/vnc.c | 12 +--- 4 files changed, 17 insertions(+), 8 deletions(-) diff --git a/include/ui/console.h b/include/ui/console.h index

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

2018-09-26 Thread Fei Li
ate the err to the final caller. Signed-off-by: Fei Li --- include/qemu/osdep.h | 2 +- util/compatfd.c | 9 ++--- util/main-loop.c | 9 - 3 files changed, 11 insertions(+), 9 deletions(-) diff --git a/include/qemu/osdep.h b/include/qemu/osdep.h index a91068df0e..09ed85f

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

2018-09-26 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

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

2018-09-26 Thread Fei Li
On 09/26/2018 06:36 PM, Fam Zheng wrote: On Wed, 09/26 18:02, Fei Li wrote: diff --git a/util/qemu-thread-posix.c b/util/qemu-thread-posix.c index 289af4fab5..8b044e2798 100644 --- a/util/qemu-thread-posix.c +++ b/util/qemu-thread-posix.c @@ -15,6 +15,7 @@ #include "qemu/ato

Re: [Qemu-devel] [PATCH RFC v4 7/7] qemu_thread_create: propagate theerror to callers to handle

2018-09-30 Thread Fei Li
On 09/29/2018 11:04 AM, Fam Zheng wrote: > On Wed, Sep 26, 2018 at 7:13 PM Fei Li wrote: >> >> >> On 09/26/2018 06:36 PM, Fam Zheng wrote: >>> On Wed, 09/26 18:02, Fei Li wrote: >>>> diff --git a/util/qemu-thread-posix.c b/util/qemu-thread-posix.

  1   2   3   >