History | View | Annotate | Download (2.2 kB)
migration: eliminate s->migration_file
The indirection is useless now. Backends can open s->file directly.
Reviewed-by: Orit Wasserman <owasserm@redhat.com>Reviewed-by: Juan Quintela <quintela@redhat.com>Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>...
qemu-file: add writable socket QEMUFile
Reviewed-by: Orit Wasserman <owasserm@redhat.com>Reviewed-by: Juan Quintela <quintela@redhat.com>Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>Signed-off-by: Juan Quintela <quintela@redhat.com>
migration: use QEMUFile for migration channel lifetime
As a start, use QEMUFile to store the destination and close it.qemu_get_fd gets a file descriptor that will be used by the writecallbacks.
Reviewed-by: Orit Wasserman <owasserm@redhat.com>Reviewed-by: Juan Quintela <quintela@redhat.com>...
migration: use QEMUFile for writing outgoing migration data
Second, drop the file descriptor indirection, and write directly to theQEMUFile.
migration: make writes blocking
Move all the writes to the migration_thread, and make writingsblocking. Notice that are still using the iothread for everythingthat we do.
Signed-off-by: Juan Quintela <quintela@redhat.com>
migration: include qemu-file.h
They don't use/know anything about buffered-file.
misc: move include files to include/qemu/
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
migration: move include files to include/migration/
block: move include files to include/block/
janitor: do not include qemu-char everywhere
Touching char/char.h basically causes the whole of QEMU tobe rebuilt. Avoid this, it is usually unnecessary.
migration: clean up server sockets and handlers before invoking process_incoming_migration
A first step towards making a common "suffix" for all migration protocols,and moving it to process_incoming_migration.
Reviewed-by: Orit Wasserman <owasserm@redhat.com>...
migration: xxx_close will only be called once
No need to test s->fd again, it is tested in the caller.
Reviewed-by: Orit Wasserman <owasserm@redhat.com>Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
migration: close socket QEMUFile from socket_close
The common suffix now is process_incoming_migration+qemu_fclose.
migration: move qemu_fclose to process_incoming_migration
The common suffix is now just process_incoming_migration.
migration: centralize call to migrate_fd_error()
The call to migrate_fd_error() was missing for non-socket backends, socentralize it in qmp_migrate().
Before:
(qemu) migrate fd:ffff migrate: An undefined error has occurred (qemu) info migrate...
migration: use qemu-sockets to establish Unix sockets
This makes migration-unix.c again a cut-and-paste job from migration-tcp.c,exactly as it was in the beginning. :)
migration (outgoing): add error propagation for all protocols
Error propagation is already there for socket backends. Add it to otherprotocols, simplifying code that tests for errors that will never happen.With all protocols understanding Error, the code can be simplified...
migration (incoming): add error propagation to fd and exec protocols
And remove the superfluous integer return value.
Reviewed-by: Luiz Capitulino <lcapitulino@redhat.com>Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
prepare for future GPLv2+ relicensing
All files under GPLv2 will get GPLv2+ changes starting tomorrow.event_notifier.c and exec-obsolete.h were only ever touched by Red Hatemployees and can be relicensed now.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>...
unix_close(): check for close() errors too (v2)
In case close() fails, we want to report the error back.
Changes v1 -> v2: - Use braces on if statement to match coding style
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
migration: make migration-{tcp,unix} consistent
Files are almost identical in functionality, just remove thedifferences that make no sense.
Signed-off-by: Juan Quintela <quintela@redhat.com>Reviewed-by: Anthony Liguori <aliguori@us.ibm.com>
migration: Don't use callback on file defining it
migration: propagate error correctly
unix and tcp outgoing migration have error values, but didn't returnedit. Make them return the error. Notice that EINPROGRESS & EWOULDBLOCKare not considered errors as call will be retry later.
Signed-off-by: Juan Quintela <quintela@redhat.com>...
migration: Fold MigrationState into FdMigrationState
migration: Rename FdMigrationState MigrationState
migration: Refactor MigrationState creation
migration: move migrate_new to do_migrate
Once there, remove all parameters that don't need to be passed to*start_outgoing_migration() functions
migration: Make *start_outgoing_migration return FdMigrationState
Use glib memory allocation and free functions
qemu_malloc/qemu_free no longer exist after this commit.
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Remove unused sysemu.h include directives
Remove unused sysemu.h include directives to speed up buildwith the following patches.
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
Fix conversions from pointer to int and vice versa
Here the int values fds0, sigfd, s, sock and fd are convertedto void pointers which are later converted back to an int value.
These conversions should always use intptr_t instead of unsigned long.
They are needed for environments where sizeof(long) != sizeof(void *)....
Factorize common migration incoming code
Signed-off-by: Juan Quintela <quintela@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
migration: Clear fd also in error cases
Not clearing the fd and closing the file makes qemu spin using 100%CPUafter incoming migration error.
See for instance bug:https://bugzilla.redhat.com/show_bug.cgi?id=518032
migration: unix migration should obey autostart are the other ones
This was the only incoming migration without autostart check
Do not use dprintf
dprintf is already claimed by POSIX1, and on at least one systemis implemented as a macro
[1] http://www.opengroup.org/onlinepubs/9699919799/functions/dprintf.html
Signed-off-by: malc <av1474@comtv.ru>
Avoid permanently disabled QEMU monitor when UNIX migration fails
If a UNIX migration command is attempt to a UNIX socket which doesnot exist, then the monitor is suspended, but never resumed. Thisprevents any further use of the monitor
Don't leak file descriptors
We're leaking file descriptors to child processes. Set FD_CLOEXEC on filedescriptors that don't need to be passed to children to stop this misbehaviour.
Signed-off-by: Kevin Wolf <kwolf@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
live migration: Propagate output monitor to callback handler
In order to allow proper progress reporting to the monitor thatinitiated the migration, forward the monitor reference through themigration layer down to SaveLiveStateHandler.
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>...
Block live migration
This patch introduces block migration called during live migration. Blockare being copied to the destination in an async way. First the code willtransfer the whole disk and then transfer all dirty blocks accumulted duringthe migration....
Migration via unix sockets.
Implement migration via unix sockets. While you can fake this usingexec and netcat, this involves forking another process and isgenerally not very nice. By doing this directly in qemu, we can avoidthe copy through the external nc command. This is useful for...