[Qemu-devel] [PATCH v4 09/32] migration: allow fault thread to pause

2017-11-07 Thread Peter Xu
Allows the fault thread to stop handling page faults temporarily. When network failure happened (and if we expect a recovery afterwards), we should not allow the fault thread to continue sending things to source, instead, it should halt for a while until the connection is rebuilt. When the dest ma

[Qemu-devel] [PATCH v4 29/32] migration: init dst in migration_object_init too

2017-11-07 Thread Peter Xu
Though we may not need it, now we init both the src/dst migration objects in migration_object_init() so that even incoming migration object would be thread safe (it was not). Reviewed-by: Dr. David Alan Gilbert Signed-off-by: Peter Xu --- migration/migration.c | 28 +++-

[Qemu-devel] [PATCH v4 11/32] migration: pass MigrationState to migrate_init()

2017-11-07 Thread Peter Xu
Let the callers take the object, then pass it to migrate_init(). Reviewed-by: Dr. David Alan Gilbert Signed-off-by: Peter Xu --- migration/migration.c | 7 ++- migration/migration.h | 2 +- migration/savevm.c| 5 - 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/migra

[Qemu-devel] [PATCH v4 19/32] migration: introduce SaveVMHandlers.resume_prepare

2017-11-07 Thread Peter Xu
This is hook function to be called when a postcopy migration wants to resume from a failure. For each module, it should provide its own recovery logic before we switch to the postcopy-active state. Reviewed-by: Dr. David Alan Gilbert Signed-off-by: Peter Xu --- include/migration/register.h | 2

[Qemu-devel] [PATCH v4 05/32] migration: implement "postcopy-pause" src logic

2017-11-07 Thread Peter Xu
Now when network down for postcopy, the source side will not fail the migration. Instead we convert the status into this new paused state, and we will try to wait for a rescue in the future. If a recovery is detected, migration_thread() will reset its local variables to prepare for that. Reviewed

[Qemu-devel] [PATCH v4 17/32] migration: new cmd MIG_CMD_POSTCOPY_RESUME

2017-11-07 Thread Peter Xu
Introducing this new command to be sent when the source VM is ready to resume the paused migration. What the destination does here is basically release the fault thread to continue service page faults. Reviewed-by: Dr. David Alan Gilbert Signed-off-by: Peter Xu --- migration/savevm.c | 35

[Qemu-devel] [PATCH v4 22/32] migration: final handshake for the resume

2017-11-07 Thread Peter Xu
Finish the last step to do the final handshake for the recovery. First source sends one MIG_CMD_RESUME to dst, telling that source is ready to resume. Then, dest replies with MIG_RP_MSG_RESUME_ACK to source, telling that dest is ready to resume (after switch to postcopy-active state). When sourc

[Qemu-devel] [PATCH v4 24/32] migration: return incoming task tag for sockets

2017-11-07 Thread Peter Xu
For socket based incoming migration, we attached a background task onto main loop to handle the acception of connections. We never had a way to destroy it before, only if we finished the migration. Let's allow socket_start_incoming_migration() to return the source tag of the listening async work,

[Qemu-devel] [PATCH v4 12/32] migration: rebuild channel on source

2017-11-07 Thread Peter Xu
This patch detects the "resume" flag of migration command, rebuild the channels only if the flag is set. Reviewed-by: Dr. David Alan Gilbert Signed-off-by: Peter Xu --- migration/migration.c | 92 ++- 1 file changed, 69 insertions(+), 23 deletions

[Qemu-devel] [PATCH v4 20/32] migration: synchronize dirty bitmap for resume

2017-11-07 Thread Peter Xu
This patch implements the first part of core RAM resume logic for postcopy. ram_resume_prepare() is provided for the work. When the migration is interrupted by network failure, the dirty bitmap on the source side will be meaningless, because even the dirty bit is cleared, it is still possible that

[Qemu-devel] [PATCH v4 07/32] migration: allow src return path to pause

2017-11-07 Thread Peter Xu
Let the thread pause for network issues. Reviewed-by: Dr. David Alan Gilbert Signed-off-by: Peter Xu --- migration/migration.c | 35 +-- migration/migration.h | 1 + migration/trace-events | 2 ++ 3 files changed, 36 insertions(+), 2 deletions(-) diff --git

[Qemu-devel] [PATCH v4 27/32] migration: store listen task tag

2017-11-07 Thread Peter Xu
Store the task tag for migration types: tcp/unix/fd/exec in current MigrationIncomingState struct. For defered migration, no need to store task tag since there is no task running in the main loop at all. For RDMA, let's mark it as todo. Reviewed-by: Dr. David Alan Gilbert Signed-off-by: Peter Xu

[Qemu-devel] [PATCH v4 21/32] migration: setup ramstate for resume

2017-11-07 Thread Peter Xu
After we updated the dirty bitmaps of ramblocks, we also need to update the critical fields in RAMState to make sure it is ready for a resume. Reviewed-by: Dr. David Alan Gilbert Signed-off-by: Peter Xu --- migration/ram.c| 37 - migration/trace-event

[Qemu-devel] [PATCH v4 25/32] migration: return incoming task tag for exec

2017-11-07 Thread Peter Xu
Return the async task tag for exec typed incoming migration in exec_start_incoming_migration(). Reviewed-by: Dr. David Alan Gilbert Signed-off-by: Peter Xu --- migration/exec.c | 18 +++--- migration/exec.h | 2 +- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/mig

[Qemu-devel] [PATCH v4 13/32] migration: new state "postcopy-recover"

2017-11-07 Thread Peter Xu
Introducing new migration state "postcopy-recover". If a migration procedure is paused and the connection is rebuilt afterward successfully, we'll switch the source VM state from "postcopy-paused" to the new state "postcopy-recover", then we'll do the resume logic in the migration thread (along wit

[Qemu-devel] [PATCH v4 23/32] migration: free SocketAddress where allocated

2017-11-07 Thread Peter Xu
Freeing the SocketAddress struct in socket_start_incoming_migration is slightly confusing. Let's free the address in the same context where we allocated it. Reviewed-by: Dr. David Alan Gilbert Signed-off-by: Peter Xu --- migration/socket.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(

[Qemu-devel] [PATCH v4 14/32] migration: wakeup dst ram-load-thread for recover

2017-11-07 Thread Peter Xu
On the destination side, we cannot wake up all the threads when we got reconnected. The first thing to do is to wake up the main load thread, so that we can continue to receive valid messages from source again and reply when needed. At this point, we switch the destination VM state from postcopy-p

[Qemu-devel] [PATCH v4 26/32] migration: return incoming task tag for fd

2017-11-07 Thread Peter Xu
Allow to return the task tag in fd_start_incoming_migration(). Reviewed-by: Dr. David Alan Gilbert Signed-off-by: Peter Xu --- migration/fd.c | 18 +++--- migration/fd.h | 2 +- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/migration/fd.c b/migration/fd.c index 30

[Qemu-devel] [PATCH v4 16/32] migration: new message MIG_RP_MSG_RECV_BITMAP

2017-11-07 Thread Peter Xu
Introducing new return path message MIG_RP_MSG_RECV_BITMAP to send received bitmap of ramblock back to source. This is the reply message of MIG_CMD_RECV_BITMAP, it contains not only the header (including the ramblock name), and it was appended with the whole ramblock received bitmap on the destina

[Qemu-devel] [PATCH v4 30/32] migration: delay the postcopy-active state switch

2017-11-07 Thread Peter Xu
Switch the state until we try to start the VM on destination side. The problem is that without doing this we may have a very small window that we'll be in such a state: - dst VM is in postcopy-active state, - main thread is handling MIG_CMD_PACKAGED message, which loads all the device states, -

[Qemu-devel] [PATCH v4 28/32] migration: allow migrate_incoming for paused VM

2017-11-07 Thread Peter Xu
migrate_incoming command is previously only used when we were providing "-incoming defer" in the command line, to defer the incoming migration channel creation. However there is similar requirement when we are paused during postcopy migration. The old incoming channel might have been destroyed alr

[Qemu-devel] [PATCH v4 32/32] migration, hmp: new command "migrate_pause"

2017-11-07 Thread Peter Xu
HMP version of QMP "migrate-pause". Signed-off-by: Peter Xu --- hmp-commands.hx | 14 ++ hmp.c | 9 + hmp.h | 1 + 3 files changed, 24 insertions(+) diff --git a/hmp-commands.hx b/hmp-commands.hx index ffcdc34652..0c9f0cc4f2 100644 --- a/hmp-commands.hx

[Qemu-devel] [PATCH v4 31/32] migration, qmp: new command "migrate-pause"

2017-11-07 Thread Peter Xu
It is used to manually trigger the postcopy pause state. It works just like when we found the migration stream failed during postcopy, but provide an explicit way for user in case of misterious socket hangs. Signed-off-by: Peter Xu --- migration/migration.c | 18 ++ qapi/migrati

Re: [Qemu-devel] [PATCH v2] util/async: use atomic_mb_set in qemu_bh_cancel

2017-11-07 Thread Sergio Lopez Pascual
Hi Fam, On Wed, Nov 8, 2017 at 2:29 AM, Fam Zheng wrote: >>I/O thread | worker thread > > Isn't the left column "workder thread" and the right one "I/O thread"? > Yes, you're right. I'm going to switch them back. Thanks, Sergio.

[Qemu-devel] [PATCH v3] util/async: use atomic_mb_set in qemu_bh_cancel

2017-11-07 Thread Sergio Lopez
Commit b7a745d added a qemu_bh_cancel call to the completion function as an optimization to prevent it from unnecessarily rescheduling itself. This completion function is scheduled from worker_thread, after setting the state of a ThreadPoolElement to THREAD_DONE. This was considered to be safe, a

Re: [Qemu-devel] [PATCH v2] s390x/cpu: expose the guest crash information

2017-11-07 Thread QingFeng Hao
在 2017/11/8 3:35, Eric Blake 写道: On 11/07/2017 05:00 AM, QingFeng Hao wrote: + +## +# @GuestPanicInformationS390: +# +# S390 specific guest panic information (PSW) +# +# Since: 2.11 +## +{'struct': 'GuestPanicInformationS390', + 'data': { 'psw-mask': 'uint64', +   'psw-addr': 'uint64'

Re: [Qemu-devel] kvm: virtio-net: saved image requires TUN_F_UFO support

2017-11-07 Thread Stefan Priebe - Profihost AG
Hi Paolo, Am 06.11.2017 um 12:27 schrieb Paolo Bonzini: > On 06/11/2017 12:09, Stefan Priebe - Profihost AG wrote: >> HI Paolo, >> >> could this patchset be related? > > Uh oh, yes it should. Jason, any ways to fix it? I suppose we need to > disable UFO in the newest machine types, but do we al

Re: [Qemu-devel] i440/piix and dynamic sysbus check

2017-11-07 Thread Marc-André Lureau
Hi Eduardo On Tue, Nov 7, 2017 at 5:53 PM, Eduardo Habkost wrote: > On Tue, Nov 07, 2017 at 05:40:17PM +0100, Marc-André Lureau wrote: >> Hi, >> >> I am working on a TPM CRB device (last sent version: >> https://lists.gnu.org/archive/html/qemu-devel/2017-10/msg02014.html). >> It's a sysbus device

Re: [Qemu-devel] [Bug 1268279] Re: Windows 7 x86 does not start on 1.7.50 from git

2017-11-07 Thread Dmitry
Ticket have to been closed 2017-10-28 16:54 GMT+03:00 Thomas Huth <1268...@bugs.launchpad.net>: > Triaging old bug tickets... can you still reproduce this issue with the > latest version of QEMU? Or could we close this ticket nowadays? > > ** Changed in: qemu >Status: New => Incomplete >

Re: [Qemu-devel] [RFC v3 10/27] monitor: create monitor dedicate iothread

2017-11-07 Thread Peter Xu
On Tue, Nov 07, 2017 at 03:11:31PM +0800, Fam Zheng wrote: > On Mon, 11/06 17:46, Peter Xu wrote: > > +static GMainContext *monitor_io_context_get(void) > > +{ > > +return iothread_get_g_main_context(mon_global.mon_iothread); > > +} > > + > > +static void monitor_iothread_init(void) > > +{ > >

Re: [Qemu-devel] [RFC v3 23/27] qmp: isolate responses into io thread

2017-11-07 Thread Peter Xu
On Tue, Nov 07, 2017 at 03:57:08PM +0800, Fam Zheng wrote: > On Mon, 11/06 17:46, Peter Xu wrote: > > @@ -4294,6 +4366,11 @@ static GMainContext *monitor_io_context_get(void) > > return iothread_get_g_main_context(mon_global.mon_iothread); > > } > > > > +static AioContext *monitor_aio_conte

Re: [Qemu-devel] [Qemu-ppc] [PATCH v1] spapr_pci: fix the path while fetching loc-code from host DT

2017-11-07 Thread David Gibson
On Wed, Nov 08, 2017 at 01:30:04PM +1100, Alexey Kardashevskiy wrote: > On 08/11/17 00:18, Seeteena Thoufeek wrote: > > The function spapr_phb_vfio_get_loc_code uses wrong path for > > fetching loc-code from host DT > > > > this is the call that needs to be fixed: > > /* Construct and read from ho

Re: [Qemu-devel] we allow passing -machine type=foo more than once but are confused about which to use...

2017-11-07 Thread Markus Armbruster
Thomas Huth writes: > On 31.10.2017 19:33, Peter Maydell wrote: >> (cc Markus because I know how much he likes weirdnesses in our >> command line parsing :-)) Heh! Let me give you a guided tour to this corner of the CLI swamp :) >> https://stackoverflow.com/questions/46955244/qemu-run-arm-ubun

Re: [Qemu-devel] [PATCH v3 01/46] Replace all occurances of __FUNCTION__ with __func__

2017-11-07 Thread Markus Armbruster
Eric Blake writes: > On 11/07/2017 04:12 AM, Markus Armbruster wrote: >> Juan Quintela writes: >> >>> Alistair Francis wrote: Replace all occurs of __FUNCTION__ except for the check in checkpatch with the non GCC specific __func__. > +++ b/audio/audio_int.h @@ -253,7 +

Re: [Qemu-devel] kvm: virtio-net: saved image requires TUN_F_UFO support

2017-11-07 Thread Jason Wang
On 2017年11月08日 15:41, Stefan Priebe - Profihost AG wrote: Hi Paolo, Am 06.11.2017 um 12:27 schrieb Paolo Bonzini: On 06/11/2017 12:09, Stefan Priebe - Profihost AG wrote: HI Paolo, could this patchset be related? Uh oh, yes it should. Jason, any ways to fix it? I suppose we need to disab

<    1   2   3   4