[Qemu-devel] [PATCH v2 0/3] UUID validation during migration

Yury Kotov posted 3 patches 6 years, 2 months ago
Test FreeBSD passed
Test checkpatch passed
Test docker-mingw@fedora passed
Test docker-clang@ubuntu passed
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20190903162246.18524-1-yury-kotov@yandex-team.ru
Maintainers: Paolo Bonzini <pbonzini@redhat.com>, Markus Armbruster <armbru@redhat.com>, "Dr. David Alan Gilbert" <dgilbert@redhat.com>, Eric Blake <eblake@redhat.com>, Juan Quintela <quintela@redhat.com>, Thomas Huth <thuth@redhat.com>, Laurent Vivier <lvivier@redhat.com>
migration/migration.c  |   9 +++
migration/migration.h  |   1 +
migration/savevm.c     |  45 +++++++++++++
qapi/migration.json    |   5 +-
tests/libqtest.c       |  36 ++++++-----
tests/libqtest.h       |   9 +++
tests/migration-test.c | 140 ++++++++++++++++++++++++++++++++---------
7 files changed, 199 insertions(+), 46 deletions(-)
[Qemu-devel] [PATCH v2 0/3] UUID validation during migration
Posted by Yury Kotov 6 years, 2 months ago
Hi,

V2:
* Remove x- prefix from capability name
* Fix expected status checking
* Fix description of capability

This series adds an UUID validation at the start of the migration
on the target side. The idea is to identify the source of migration.

Possible case of problem:
1. There are 3 servers: A, B and C
2. Server A has a VM 1, server B has a VM 2
3. VM 1 and VM 2 want to migrate to the server C
4. Target of VM 1 starts on the server C and dies too quickly for some reason
5. Target of VM 2 starts just after that and listen the same tcp port X, which
   the target of VM 1 wanted to use
6. Source of VM 1 connects to the tcp port X, and migrates to VM 2 source
7. It's possible that migration might be successful (e.g., devices are the same)
8. So, the target of VM 2 is in undefined state

The series adds a capability to prevent successful (by mistake) migration.

The new capability validate-uuid only affects the source so that it sends
its UUID to the target. The target will validate the received UUID and stop
the migration if UUIDs are not equal.

Regards,
Yury

Yury Kotov (3):
  migration: Add validate-uuid capability
  tests/libqtest: Allow setting expected exit status
  tests/migration: Add a test for validate-uuid capability

 migration/migration.c  |   9 +++
 migration/migration.h  |   1 +
 migration/savevm.c     |  45 +++++++++++++
 qapi/migration.json    |   5 +-
 tests/libqtest.c       |  36 ++++++-----
 tests/libqtest.h       |   9 +++
 tests/migration-test.c | 140 ++++++++++++++++++++++++++++++++---------
 7 files changed, 199 insertions(+), 46 deletions(-)

-- 
2.17.1


Re: [Qemu-devel] [PATCH v2 0/3] UUID validation during migration
Posted by Dr. David Alan Gilbert 6 years, 2 months ago
* Yury Kotov (yury-kotov@yandex-team.ru) wrote:
> Hi,

> V2:
> * Remove x- prefix from capability name
> * Fix expected status checking
> * Fix description of capability
> 
> This series adds an UUID validation at the start of the migration
> on the target side. The idea is to identify the source of migration.
> 
> Possible case of problem:
> 1. There are 3 servers: A, B and C
> 2. Server A has a VM 1, server B has a VM 2
> 3. VM 1 and VM 2 want to migrate to the server C
> 4. Target of VM 1 starts on the server C and dies too quickly for some reason
> 5. Target of VM 2 starts just after that and listen the same tcp port X, which
>    the target of VM 1 wanted to use
> 6. Source of VM 1 connects to the tcp port X, and migrates to VM 2 source
> 7. It's possible that migration might be successful (e.g., devices are the same)
> 8. So, the target of VM 2 is in undefined state
> 
> The series adds a capability to prevent successful (by mistake) migration.
> 
> The new capability validate-uuid only affects the source so that it sends
> its UUID to the target. The target will validate the received UUID and stop
> the migration if UUIDs are not equal.
> 
> Regards,
> Yury

Queued

> Yury Kotov (3):
>   migration: Add validate-uuid capability
>   tests/libqtest: Allow setting expected exit status
>   tests/migration: Add a test for validate-uuid capability
> 
>  migration/migration.c  |   9 +++
>  migration/migration.h  |   1 +
>  migration/savevm.c     |  45 +++++++++++++
>  qapi/migration.json    |   5 +-
>  tests/libqtest.c       |  36 ++++++-----
>  tests/libqtest.h       |   9 +++
>  tests/migration-test.c | 140 ++++++++++++++++++++++++++++++++---------
>  7 files changed, 199 insertions(+), 46 deletions(-)
> 
> -- 
> 2.17.1
> 
> 
--
Dr. David Alan Gilbert / dgilbert@redhat.com / Manchester, UK