[PATCH v2 22/22] qemu-iotests/199: add source-killed case to bitmaps postcopy

Vladimir Sementsov-Ogievskiy posted 22 patches 5 years, 11 months ago
There is a newer version of this series
[PATCH v2 22/22] qemu-iotests/199: add source-killed case to bitmaps postcopy
Posted by Vladimir Sementsov-Ogievskiy 5 years, 11 months ago
Previous patches fixes behavior of bitmaps migration, so that errors
are handled by just removing unfinished bitmaps, and not fail or try to
recover postcopy migration. Add corresponding test.

Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
---
 tests/qemu-iotests/199     | 15 +++++++++++++++
 tests/qemu-iotests/199.out |  4 ++--
 2 files changed, 17 insertions(+), 2 deletions(-)

diff --git a/tests/qemu-iotests/199 b/tests/qemu-iotests/199
index 0d12e6b1ae..d38913fa44 100755
--- a/tests/qemu-iotests/199
+++ b/tests/qemu-iotests/199
@@ -235,6 +235,21 @@ class TestDirtyBitmapPostcopyMigration(iotests.QMPTestCase):
         self.vm_a.launch()
         check_bitmaps(self.vm_a, 0)
 
+    def test_early_kill_source(self):
+        self.start_postcopy()
+
+        self.vm_a_events = self.vm_a.get_qmp_events()
+        self.vm_a.kill()
+
+        self.vm_a.launch()
+
+        match = {'data': {'status': 'completed'}}
+        e_complete = self.vm_b.event_wait('MIGRATION', match=match)
+        self.vm_b_events.append(e_complete)
+
+        check_bitmaps(self.vm_a, 0)
+        check_bitmaps(self.vm_b, 0)
+
 
 if __name__ == '__main__':
     iotests.main(supported_fmts=['qcow2'])
diff --git a/tests/qemu-iotests/199.out b/tests/qemu-iotests/199.out
index fbc63e62f8..8d7e996700 100644
--- a/tests/qemu-iotests/199.out
+++ b/tests/qemu-iotests/199.out
@@ -1,5 +1,5 @@
-..
+...
 ----------------------------------------------------------------------
-Ran 2 tests
+Ran 3 tests
 
 OK
-- 
2.21.0


Re: [PATCH v2 22/22] qemu-iotests/199: add source-killed case to bitmaps postcopy
Posted by Andrey Shinkevich 5 years, 11 months ago
On 17/02/2020 18:02, Vladimir Sementsov-Ogievskiy wrote:
> Previous patches fixes behavior of bitmaps migration, so that errors
> are handled by just removing unfinished bitmaps, and not fail or try to
> recover postcopy migration. Add corresponding test.
> 
> Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
> ---
>   tests/qemu-iotests/199     | 15 +++++++++++++++
>   tests/qemu-iotests/199.out |  4 ++--
>   2 files changed, 17 insertions(+), 2 deletions(-)
> 
> diff --git a/tests/qemu-iotests/199 b/tests/qemu-iotests/199
> index 0d12e6b1ae..d38913fa44 100755
> --- a/tests/qemu-iotests/199
> +++ b/tests/qemu-iotests/199
> @@ -235,6 +235,21 @@ class TestDirtyBitmapPostcopyMigration(iotests.QMPTestCase):
>           self.vm_a.launch()
>           check_bitmaps(self.vm_a, 0)
>   
> +    def test_early_kill_source(self):
> +        self.start_postcopy()
> +
> +        self.vm_a_events = self.vm_a.get_qmp_events()
> +        self.vm_a.kill()
> +
> +        self.vm_a.launch()
> +
> +        match = {'data': {'status': 'completed'}}
> +        e_complete = self.vm_b.event_wait('MIGRATION', match=match)

A failed migration gets the status 'completed'. That misleads a user but 
is not in the scope of this series, I guess.

> +        self.vm_b_events.append(e_complete)
> +
> +        check_bitmaps(self.vm_a, 0)
> +        check_bitmaps(self.vm_b, 0)
> +
>   
>   if __name__ == '__main__':
>       iotests.main(supported_fmts=['qcow2'])
> diff --git a/tests/qemu-iotests/199.out b/tests/qemu-iotests/199.out
> index fbc63e62f8..8d7e996700 100644
> --- a/tests/qemu-iotests/199.out
> +++ b/tests/qemu-iotests/199.out
> @@ -1,5 +1,5 @@
> -..
> +...
>   ----------------------------------------------------------------------
> -Ran 2 tests
> +Ran 3 tests
>   
>   OK
> 

The updated test passed.

Reviewed-by: Andrey Shinkevich <andrey.shinkevich@virtuozzo.com>
-- 
With the best regards,
Andrey Shinkevich

Re: [PATCH v2 22/22] qemu-iotests/199: add source-killed case to bitmaps postcopy
Posted by Vladimir Sementsov-Ogievskiy 5 years, 6 months ago
19.02.2020 20:15, Andrey Shinkevich wrote:
> On 17/02/2020 18:02, Vladimir Sementsov-Ogievskiy wrote:
>> Previous patches fixes behavior of bitmaps migration, so that errors
>> are handled by just removing unfinished bitmaps, and not fail or try to
>> recover postcopy migration. Add corresponding test.
>>
>> Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
>> ---
>>   tests/qemu-iotests/199     | 15 +++++++++++++++
>>   tests/qemu-iotests/199.out |  4 ++--
>>   2 files changed, 17 insertions(+), 2 deletions(-)
>>
>> diff --git a/tests/qemu-iotests/199 b/tests/qemu-iotests/199
>> index 0d12e6b1ae..d38913fa44 100755
>> --- a/tests/qemu-iotests/199
>> +++ b/tests/qemu-iotests/199
>> @@ -235,6 +235,21 @@ class TestDirtyBitmapPostcopyMigration(iotests.QMPTestCase):
>>           self.vm_a.launch()
>>           check_bitmaps(self.vm_a, 0)
>> +    def test_early_kill_source(self):
>> +        self.start_postcopy()
>> +
>> +        self.vm_a_events = self.vm_a.get_qmp_events()
>> +        self.vm_a.kill()
>> +
>> +        self.vm_a.launch()
>> +
>> +        match = {'data': {'status': 'completed'}}
>> +        e_complete = self.vm_b.event_wait('MIGRATION', match=match)
> 
> A failed migration gets the status 'completed'. That misleads a user but is not in the scope of this series, I guess.

It's not failed. Only bitmaps are not migrated, which is not a problem.. Probably we should invent some additional status or QAPI event for this, but yes, not in this series.

> 
>> +        self.vm_b_events.append(e_complete)
>> +
>> +        check_bitmaps(self.vm_a, 0)
>> +        check_bitmaps(self.vm_b, 0)
>> +
>>   if __name__ == '__main__':
>>       iotests.main(supported_fmts=['qcow2'])
>> diff --git a/tests/qemu-iotests/199.out b/tests/qemu-iotests/199.out
>> index fbc63e62f8..8d7e996700 100644
>> --- a/tests/qemu-iotests/199.out
>> +++ b/tests/qemu-iotests/199.out
>> @@ -1,5 +1,5 @@
>> -..
>> +...
>>   ----------------------------------------------------------------------
>> -Ran 2 tests
>> +Ran 3 tests
>>   OK
>>
> 
> The updated test passed.
> 
> Reviewed-by: Andrey Shinkevich <andrey.shinkevich@virtuozzo.com>


-- 
Best regards,
Vladimir