qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel]  [PATCH 0/3] Add acceptance test for migration
@ 2019-09-16  9:34 Balamuruhan S
  2019-09-16  9:34 ` [Qemu-devel] [PATCH 1/3] tests/acceptance/migration: fix post migration check Balamuruhan S
                   ` (2 more replies)
  0 siblings, 3 replies; 12+ messages in thread
From: Balamuruhan S @ 2019-09-16  9:34 UTC (permalink / raw)
  To: qemu-devel
  Cc: ehabkost, ccarrara, groug, Balamuruhan S, sathnaga, clg, crosa,
	qemu-ppc, david

Add new test for migration that bringup vm with different machine types
and migrate it, introduce new API in avocado_qemu to query all the machine
types supported by qemu.

Test run:

# avocado run migration.py
JOB ID     : ef54f57a073eb267d2347e32225f2adbe27969de
JOB LOG    : 
/home/bala/avocado-fvt-wrapper/results/job-2019-08-05T13.54-ef54f57/job.log
 (1/2) migration.py:Migration.test_migration_with_tcp_localhost: PASS
(0.54 s)
 (2/2) migration.py:Migration.test_migration_with_machine_types: PASS
(5.21 s)
RESULTS    : PASS 2 | ERROR 0 | FAIL 0 | SKIP 0 | WARN 0 | INTERRUPT 0 |
CANCEL 0
JOB TIME   : 5.86 s

Currently acceptance test for migration error out as we check
`query-migrate` in target after migration which is not appropriate.

Balamuruhan S (3):
  tests/acceptance/migration: fix post migration check
  tests/acceptance/avocado_qemu: add method to get supported machine
    types
  tests/acceptance/migration: test to migrate will all machine types

 tests/acceptance/avocado_qemu/__init__.py |  6 ++++++
 tests/acceptance/migration.py             | 27 ++++++++++++++++++++++++++-
 2 files changed, 32 insertions(+), 1 deletion(-)

-- 
2.14.5



^ permalink raw reply	[flat|nested] 12+ messages in thread

* [Qemu-devel] [PATCH 1/3] tests/acceptance/migration: fix post migration check
  2019-09-16  9:34 [Qemu-devel] [PATCH 0/3] Add acceptance test for migration Balamuruhan S
@ 2019-09-16  9:34 ` Balamuruhan S
  2019-09-16 18:50   ` Dr. David Alan Gilbert
  2019-09-16  9:34 ` [Qemu-devel] [PATCH 2/3] tests/acceptance/avocado_qemu: add method to get supported machine types Balamuruhan S
  2019-09-16  9:34 ` [Qemu-devel] [PATCH 3/3] tests/acceptance/migration: test to migrate will all " Balamuruhan S
  2 siblings, 1 reply; 12+ messages in thread
From: Balamuruhan S @ 2019-09-16  9:34 UTC (permalink / raw)
  To: qemu-devel
  Cc: ehabkost, ccarrara, groug, Balamuruhan S, sathnaga, clg, crosa,
	qemu-ppc, david

assert `query-migrate` in target doesn't give migration
status and test errors even if migration succeeds.

In target:
{'execute': 'query-migrate'}
{"return": {}}

Signed-off-by: Balamuruhan S <bala24@linux.ibm.com>
---
 tests/acceptance/migration.py | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/tests/acceptance/migration.py b/tests/acceptance/migration.py
index a44c1ae58f..0f3553c8f0 100644
--- a/tests/acceptance/migration.py
+++ b/tests/acceptance/migration.py
@@ -44,7 +44,8 @@ class Migration(Test):
             step=0.1,
             args=(source_vm,)
         )
-        self.assertEqual(dest_vm.command('query-migrate')['status'], 'completed')
-        self.assertEqual(source_vm.command('query-migrate')['status'], 'completed')
+        self.assertEqual(source_vm.command('query-migrate')['status'],
+                         'completed')
         self.assertEqual(dest_vm.command('query-status')['status'], 'running')
-        self.assertEqual(source_vm.command('query-status')['status'], 'postmigrate')
+        self.assertEqual(source_vm.command('query-status')['status'],
+                         'postmigrate')
-- 
2.14.5



^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [Qemu-devel] [PATCH 2/3] tests/acceptance/avocado_qemu: add method to get supported machine types
  2019-09-16  9:34 [Qemu-devel] [PATCH 0/3] Add acceptance test for migration Balamuruhan S
  2019-09-16  9:34 ` [Qemu-devel] [PATCH 1/3] tests/acceptance/migration: fix post migration check Balamuruhan S
@ 2019-09-16  9:34 ` Balamuruhan S
  2019-09-16  9:34 ` [Qemu-devel] [PATCH 3/3] tests/acceptance/migration: test to migrate will all " Balamuruhan S
  2 siblings, 0 replies; 12+ messages in thread
From: Balamuruhan S @ 2019-09-16  9:34 UTC (permalink / raw)
  To: qemu-devel
  Cc: ehabkost, ccarrara, groug, Balamuruhan S, sathnaga, clg, crosa,
	qemu-ppc, david

add `get_machine_types()` to return list of supported machine types
by the qemu binary.

Signed-off-by: Balamuruhan S <bala24@linux.ibm.com>
---
 tests/acceptance/avocado_qemu/__init__.py | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/tests/acceptance/avocado_qemu/__init__.py b/tests/acceptance/avocado_qemu/__init__.py
index bd41e0443c..42a1b572bd 100644
--- a/tests/acceptance/avocado_qemu/__init__.py
+++ b/tests/acceptance/avocado_qemu/__init__.py
@@ -85,6 +85,12 @@ class Test(avocado.Test):
             self._vms[name] = self._new_vm(*args)
         return self._vms[name]
 
+    def get_machine_types(self):
+        cmd = "%s -machine ?" % self.qemu_bin
+        output = avocado.utils.process.getoutput(cmd).split("\n")
+        output.remove("Supported machines are:")
+        return [each.split()[0] for each in output]
+
     def tearDown(self):
         for vm in self._vms.values():
             vm.shutdown()
-- 
2.14.5



^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [Qemu-devel] [PATCH 3/3] tests/acceptance/migration: test to migrate will all machine types
  2019-09-16  9:34 [Qemu-devel] [PATCH 0/3] Add acceptance test for migration Balamuruhan S
  2019-09-16  9:34 ` [Qemu-devel] [PATCH 1/3] tests/acceptance/migration: fix post migration check Balamuruhan S
  2019-09-16  9:34 ` [Qemu-devel] [PATCH 2/3] tests/acceptance/avocado_qemu: add method to get supported machine types Balamuruhan S
@ 2019-09-16  9:34 ` Balamuruhan S
  2019-09-16 14:50   ` Dr. David Alan Gilbert
  2 siblings, 1 reply; 12+ messages in thread
From: Balamuruhan S @ 2019-09-16  9:34 UTC (permalink / raw)
  To: qemu-devel
  Cc: ehabkost, ccarrara, groug, Balamuruhan S, sathnaga, clg, crosa,
	qemu-ppc, david

add migration test to query machine types supported by qemu binary
and migrate vm will all supported type.

Signed-off-by: Balamuruhan S <bala24@linux.ibm.com>
---
 tests/acceptance/migration.py | 26 ++++++++++++++++++++++++++
 1 file changed, 26 insertions(+)

diff --git a/tests/acceptance/migration.py b/tests/acceptance/migration.py
index 0f3553c8f0..74416ccc21 100644
--- a/tests/acceptance/migration.py
+++ b/tests/acceptance/migration.py
@@ -49,3 +49,29 @@ class Migration(Test):
         self.assertEqual(dest_vm.command('query-status')['status'], 'running')
         self.assertEqual(source_vm.command('query-status')['status'],
                          'postmigrate')
+
+
+    def test_migration_with_machine_types(self):
+        migration_port = self._get_free_port()
+        for machine in self.get_machine_types():
+            if 'pseries' in machine:
+                print("migrating with machine type - {}".format(machine))
+                source_vm = self.get_vm('-M', '{},cap-htm=off'.format(machine))
+                dest_uri = 'tcp:localhost:%u' % migration_port
+                dest_vm = self.get_vm('-M', '{},cap-htm=off'.format(machine),
+                                      '-incoming', dest_uri)
+                dest_vm.launch()
+                source_vm.launch()
+                source_vm.qmp('migrate', uri=dest_uri)
+                wait.wait_for(
+                    self.migration_finished,
+                    timeout=self.timeout,
+                    step=0.1,
+                    args=(source_vm,)
+                )
+                self.assertEqual(source_vm.command('query-migrate')['status'],
+                                                   'completed')
+                self.assertEqual(dest_vm.command('query-status')['status'],
+                                                 'running')
+                self.assertEqual(source_vm.command('query-status')['status'],
+                                                   'postmigrate')
-- 
2.14.5



^ permalink raw reply related	[flat|nested] 12+ messages in thread

* Re: [Qemu-devel] [PATCH 3/3] tests/acceptance/migration: test to migrate will all machine types
  2019-09-16  9:34 ` [Qemu-devel] [PATCH 3/3] tests/acceptance/migration: test to migrate will all " Balamuruhan S
@ 2019-09-16 14:50   ` Dr. David Alan Gilbert
  2019-09-17  8:45     ` Balamuruhan S
  0 siblings, 1 reply; 12+ messages in thread
From: Dr. David Alan Gilbert @ 2019-09-16 14:50 UTC (permalink / raw)
  To: Balamuruhan S
  Cc: ehabkost, groug, qemu-devel, sathnaga, clg, crosa, qemu-ppc, david

* Balamuruhan S (bala24@linux.ibm.com) wrote:
> add migration test to query machine types supported by qemu binary
> and migrate vm will all supported type.
> 
> Signed-off-by: Balamuruhan S <bala24@linux.ibm.com>

Depending on the architecture you might find that some machine types
aren't migratable while some are.

Dave

> ---
>  tests/acceptance/migration.py | 26 ++++++++++++++++++++++++++
>  1 file changed, 26 insertions(+)
> 
> diff --git a/tests/acceptance/migration.py b/tests/acceptance/migration.py
> index 0f3553c8f0..74416ccc21 100644
> --- a/tests/acceptance/migration.py
> +++ b/tests/acceptance/migration.py
> @@ -49,3 +49,29 @@ class Migration(Test):
>          self.assertEqual(dest_vm.command('query-status')['status'], 'running')
>          self.assertEqual(source_vm.command('query-status')['status'],
>                           'postmigrate')
> +
> +
> +    def test_migration_with_machine_types(self):
> +        migration_port = self._get_free_port()
> +        for machine in self.get_machine_types():
> +            if 'pseries' in machine:
> +                print("migrating with machine type - {}".format(machine))
> +                source_vm = self.get_vm('-M', '{},cap-htm=off'.format(machine))
> +                dest_uri = 'tcp:localhost:%u' % migration_port
> +                dest_vm = self.get_vm('-M', '{},cap-htm=off'.format(machine),
> +                                      '-incoming', dest_uri)
> +                dest_vm.launch()
> +                source_vm.launch()
> +                source_vm.qmp('migrate', uri=dest_uri)
> +                wait.wait_for(
> +                    self.migration_finished,
> +                    timeout=self.timeout,
> +                    step=0.1,
> +                    args=(source_vm,)
> +                )
> +                self.assertEqual(source_vm.command('query-migrate')['status'],
> +                                                   'completed')
> +                self.assertEqual(dest_vm.command('query-status')['status'],
> +                                                 'running')
> +                self.assertEqual(source_vm.command('query-status')['status'],
> +                                                   'postmigrate')
> -- 
> 2.14.5
> 
> 
--
Dr. David Alan Gilbert / dgilbert@redhat.com / Manchester, UK


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [Qemu-devel] [PATCH 1/3] tests/acceptance/migration: fix post migration check
  2019-09-16  9:34 ` [Qemu-devel] [PATCH 1/3] tests/acceptance/migration: fix post migration check Balamuruhan S
@ 2019-09-16 18:50   ` Dr. David Alan Gilbert
  2019-09-17  8:51     ` Balamuruhan S
  0 siblings, 1 reply; 12+ messages in thread
From: Dr. David Alan Gilbert @ 2019-09-16 18:50 UTC (permalink / raw)
  To: Balamuruhan S
  Cc: ehabkost, groug, qemu-devel, sathnaga, clg, crosa, qemu-ppc, david

* Balamuruhan S (bala24@linux.ibm.com) wrote:
> assert `query-migrate` in target doesn't give migration
> status and test errors even if migration succeeds.
> 
> In target:
> {'execute': 'query-migrate'}
> {"return": {}}

On which version of qemu?

On the current version I see:

{"QMP": {"version": {"qemu": {"micro": 50, "minor": 1, "major": 4}, "package": "v4.1.0-852-g1a0b66e787"}, "capabilities": ["oob"]}}
{ "execute": "qmp_capabilities" }
{"return": {}}
{'execute': 'query-migrate'}
{"return": {"status": "completed"}}

Dave
> Signed-off-by: Balamuruhan S <bala24@linux.ibm.com>
> ---
>  tests/acceptance/migration.py | 7 ++++---
>  1 file changed, 4 insertions(+), 3 deletions(-)
> 
> diff --git a/tests/acceptance/migration.py b/tests/acceptance/migration.py
> index a44c1ae58f..0f3553c8f0 100644
> --- a/tests/acceptance/migration.py
> +++ b/tests/acceptance/migration.py
> @@ -44,7 +44,8 @@ class Migration(Test):
>              step=0.1,
>              args=(source_vm,)
>          )
> -        self.assertEqual(dest_vm.command('query-migrate')['status'], 'completed')
> -        self.assertEqual(source_vm.command('query-migrate')['status'], 'completed')
> +        self.assertEqual(source_vm.command('query-migrate')['status'],
> +                         'completed')
>          self.assertEqual(dest_vm.command('query-status')['status'], 'running')
> -        self.assertEqual(source_vm.command('query-status')['status'], 'postmigrate')
> +        self.assertEqual(source_vm.command('query-status')['status'],
> +                         'postmigrate')
> -- 
> 2.14.5
> 
> 
--
Dr. David Alan Gilbert / dgilbert@redhat.com / Manchester, UK


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [Qemu-devel] [PATCH 3/3] tests/acceptance/migration: test to migrate will all machine types
  2019-09-16 14:50   ` Dr. David Alan Gilbert
@ 2019-09-17  8:45     ` Balamuruhan S
  2019-09-17  9:44       ` Dr. David Alan Gilbert
  0 siblings, 1 reply; 12+ messages in thread
From: Balamuruhan S @ 2019-09-17  8:45 UTC (permalink / raw)
  To: Dr. David Alan Gilbert
  Cc: ehabkost, groug, qemu-devel, sathnaga, clg, crosa, qemu-ppc, david

On Mon, Sep 16, 2019 at 03:50:06PM +0100, Dr. David Alan Gilbert wrote:
> * Balamuruhan S (bala24@linux.ibm.com) wrote:
> > add migration test to query machine types supported by qemu binary
> > and migrate vm will all supported type.
> > 
> > Signed-off-by: Balamuruhan S <bala24@linux.ibm.com>
> 
> Depending on the architecture you might find that some machine types
> aren't migratable while some are.

Thanks Dave, is there a way to query/check whether a machine type on the
architecture is migratable or should we try migrating and handle exception
on failure ?

-- Bala
> 
> Dave
> 
> > ---
> >  tests/acceptance/migration.py | 26 ++++++++++++++++++++++++++
> >  1 file changed, 26 insertions(+)
> > 
> > diff --git a/tests/acceptance/migration.py b/tests/acceptance/migration.py
> > index 0f3553c8f0..74416ccc21 100644
> > --- a/tests/acceptance/migration.py
> > +++ b/tests/acceptance/migration.py
> > @@ -49,3 +49,29 @@ class Migration(Test):
> >          self.assertEqual(dest_vm.command('query-status')['status'], 'running')
> >          self.assertEqual(source_vm.command('query-status')['status'],
> >                           'postmigrate')
> > +
> > +
> > +    def test_migration_with_machine_types(self):
> > +        migration_port = self._get_free_port()
> > +        for machine in self.get_machine_types():
> > +            if 'pseries' in machine:
> > +                print("migrating with machine type - {}".format(machine))
> > +                source_vm = self.get_vm('-M', '{},cap-htm=off'.format(machine))
> > +                dest_uri = 'tcp:localhost:%u' % migration_port
> > +                dest_vm = self.get_vm('-M', '{},cap-htm=off'.format(machine),
> > +                                      '-incoming', dest_uri)
> > +                dest_vm.launch()
> > +                source_vm.launch()
> > +                source_vm.qmp('migrate', uri=dest_uri)
> > +                wait.wait_for(
> > +                    self.migration_finished,
> > +                    timeout=self.timeout,
> > +                    step=0.1,
> > +                    args=(source_vm,)
> > +                )
> > +                self.assertEqual(source_vm.command('query-migrate')['status'],
> > +                                                   'completed')
> > +                self.assertEqual(dest_vm.command('query-status')['status'],
> > +                                                 'running')
> > +                self.assertEqual(source_vm.command('query-status')['status'],
> > +                                                   'postmigrate')
> > -- 
> > 2.14.5
> > 
> > 
> --
> Dr. David Alan Gilbert / dgilbert@redhat.com / Manchester, UK



^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [Qemu-devel] [PATCH 1/3] tests/acceptance/migration: fix post migration check
  2019-09-16 18:50   ` Dr. David Alan Gilbert
@ 2019-09-17  8:51     ` Balamuruhan S
  2019-09-17  9:40       ` Dr. David Alan Gilbert
  0 siblings, 1 reply; 12+ messages in thread
From: Balamuruhan S @ 2019-09-17  8:51 UTC (permalink / raw)
  To: Dr. David Alan Gilbert
  Cc: ehabkost, groug, qemu-devel, sathnaga, clg, crosa, qemu-ppc, david

On Mon, Sep 16, 2019 at 07:50:44PM +0100, Dr. David Alan Gilbert wrote:
> * Balamuruhan S (bala24@linux.ibm.com) wrote:
> > assert `query-migrate` in target doesn't give migration
> > status and test errors even if migration succeeds.
> > 
> > In target:
> > {'execute': 'query-migrate'}
> > {"return": {}}
> 
> On which version of qemu?

sorry I worked on this earlier and I haven't notice the version,
I re-tried the same in upstream Qemu and observed the one you have
posted. Thanks, I will remove this change in the next version.

But I am observing the error often while executing `query-migrate` from
test,

2019-09-17 03:15:34,797 qmp              L0167 DEBUG| >>> {'execute': 'query-migrate'}
2019-09-17 03:15:34,798 qmp              L0175 DEBUG| <<< {'return': {'expected-downtime': 300, 'status': 'active', 'setup-time': 1, 'total-time': 102, 'ram': {'total': 536870912, 'postcopy-requests': 0, 'dirty-sync-count': 1, 'multifd-bytes': 0, 'pages-per-second': 0, 'page-size': 4096, 'remaining': 4521984, 'mbps': 0, 'transferred': 3372844, 'duplicate': 129430, 'dirty-pages-rate': 0, 'skipped': 0, 'normal-bytes': 2203648, 'normal': 538}}}
2019-09-17 03:15:34,899 qmp              L0167 DEBUG| >>> {'execute': 'query-migrate'}
2019-09-17 03:15:34,899 qmp              L0087 DEBUG| <<< {'timestamp': {'seconds': 1568704534, 'microseconds': 802440}, 'event': 'STOP'}
2019-09-17 03:15:34,900 qmp              L0175 DEBUG| <<< {'return': {'status': 'completed', 'setup-time': 1, 'downtime': 30, 'total-time': 137, 'ram': {'total': 536870912, 'postcopy-requests': 0, 'dirty-sync-count': 4, 'multifd-bytes': 0, 'pages-per-second': 1299680, 'page-size': 4096, 'remaining': 0, 'mbps': 474.753235, 'transferred': 4548090, 'duplicate': 133244, 'dirty-pages-rate': 0, 'skipped': 0, 'normal-bytes': 3342336, 'normal': 816}}}
2019-09-17 03:15:34,900 qmp              L0167 DEBUG| >>> {'execute': 'query-migrate'}
2019-09-17 03:15:34,900 qmp              L0087 DEBUG| <<< {'timestamp': {'seconds': 1568704534, 'microseconds': 832595}, 'event': 'RESUME'}
2019-09-17 03:15:35,545 stacktrace       L0039 ERROR|
2019-09-17 03:15:35,545 stacktrace       L0042 ERROR| Reproduced traceback from: /usr/local/lib/python3.6/site-packages/avocado/core/test.py:853
2019-09-17 03:15:35,547 stacktrace       L0045 ERROR| Traceback (most recent call last):
2019-09-17 03:15:35,547 stacktrace       L0045 ERROR|   File "/home/bala/qemu/tests/acceptance/migration.py", line 47, in test_migration_with_tcp_localhost
2019-09-17 03:15:35,547 stacktrace       L0045 ERROR|     self.assertEqual(dest_vm.command('query-migrate')['status'], 'completed')
2019-09-17 03:15:35,547 stacktrace       L0045 ERROR|   File "/home/bala/qemu/tests/acceptance/avocado_qemu/../../../python/qemu/machine.py", line 378, in command
2019-09-17 03:15:35,547 stacktrace       L0045 ERROR|     reply = self.qmp(cmd, conv_keys, **args)
2019-09-17 03:15:35,547 stacktrace       L0045 ERROR|   File "/home/bala/qemu/tests/acceptance/avocado_qemu/../../../python/qemu/machine.py", line 370, in qmp
2019-09-17 03:15:35,548 stacktrace       L0045 ERROR|     return self._qmp.cmd(cmd, args=qmp_args)
2019-09-17 03:15:35,548 stacktrace       L0045 ERROR|   File "/home/bala/qemu/tests/acceptance/avocado_qemu/../../../python/qemu/qmp.py", line 191, in cmd
2019-09-17 03:15:35,548 stacktrace       L0045 ERROR|     return self.cmd_obj(qmp_cmd)
2019-09-17 03:15:35,548 stacktrace       L0045 ERROR|   File "/home/bala/qemu/tests/acceptance/avocado_qemu/../../../python/qemu/qmp.py", line 174, in cmd_obj
2019-09-17 03:15:35,548 stacktrace       L0045 ERROR|     resp = self.__json_read()
2019-09-17 03:15:35,548 stacktrace       L0045 ERROR|   File "/home/bala/qemu/tests/acceptance/avocado_qemu/../../../python/qemu/qmp.py", line 82, in __json_read
2019-09-17 03:15:35,548 stacktrace       L0045 ERROR|     data = self.__sockfile.readline()
2019-09-17 03:15:35,548 stacktrace       L0045 ERROR|   File "/usr/lib64/python3.6/socket.py", line 586, in readinto
2019-09-17 03:15:35,548 stacktrace       L0045 ERROR|     return self._sock.recv_into(b)
2019-09-17 03:15:35,548 stacktrace       L0045 ERROR| ConnectionResetError: [Errno 104] Connection reset by peer


could you help me on what do I miss here ?

-- Bala

> 
> On the current version I see:
> 
> {"QMP": {"version": {"qemu": {"micro": 50, "minor": 1, "major": 4}, "package": "v4.1.0-852-g1a0b66e787"}, "capabilities": ["oob"]}}
> { "execute": "qmp_capabilities" }
> {"return": {}}
> {'execute': 'query-migrate'}
> {"return": {"status": "completed"}}
> 
> Dave
> > Signed-off-by: Balamuruhan S <bala24@linux.ibm.com>
> > ---
> >  tests/acceptance/migration.py | 7 ++++---
> >  1 file changed, 4 insertions(+), 3 deletions(-)
> > 
> > diff --git a/tests/acceptance/migration.py b/tests/acceptance/migration.py
> > index a44c1ae58f..0f3553c8f0 100644
> > --- a/tests/acceptance/migration.py
> > +++ b/tests/acceptance/migration.py
> > @@ -44,7 +44,8 @@ class Migration(Test):
> >              step=0.1,
> >              args=(source_vm,)
> >          )
> > -        self.assertEqual(dest_vm.command('query-migrate')['status'], 'completed')
> > -        self.assertEqual(source_vm.command('query-migrate')['status'], 'completed')
> > +        self.assertEqual(source_vm.command('query-migrate')['status'],
> > +                         'completed')
> >          self.assertEqual(dest_vm.command('query-status')['status'], 'running')
> > -        self.assertEqual(source_vm.command('query-status')['status'], 'postmigrate')
> > +        self.assertEqual(source_vm.command('query-status')['status'],
> > +                         'postmigrate')
> > -- 
> > 2.14.5
> > 
> > 
> --
> Dr. David Alan Gilbert / dgilbert@redhat.com / Manchester, UK



^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [Qemu-devel] [PATCH 1/3] tests/acceptance/migration: fix post migration check
  2019-09-17  8:51     ` Balamuruhan S
@ 2019-09-17  9:40       ` Dr. David Alan Gilbert
  0 siblings, 0 replies; 12+ messages in thread
From: Dr. David Alan Gilbert @ 2019-09-17  9:40 UTC (permalink / raw)
  To: Balamuruhan S
  Cc: ehabkost, groug, qemu-devel, sathnaga, clg, crosa, qemu-ppc, david

* Balamuruhan S (bala24@linux.ibm.com) wrote:
> On Mon, Sep 16, 2019 at 07:50:44PM +0100, Dr. David Alan Gilbert wrote:
> > * Balamuruhan S (bala24@linux.ibm.com) wrote:
> > > assert `query-migrate` in target doesn't give migration
> > > status and test errors even if migration succeeds.
> > > 
> > > In target:
> > > {'execute': 'query-migrate'}
> > > {"return": {}}
> > 
> > On which version of qemu?
> 
> sorry I worked on this earlier and I haven't notice the version,
> I re-tried the same in upstream Qemu and observed the one you have
> posted. Thanks, I will remove this change in the next version.
> 

Great; I don't think it always returns a status; but it should in most
cases after a migration.

> But I am observing the error often while executing `query-migrate` from
> test,
> 
> 2019-09-17 03:15:34,797 qmp              L0167 DEBUG| >>> {'execute': 'query-migrate'}
> 2019-09-17 03:15:34,798 qmp              L0175 DEBUG| <<< {'return': {'expected-downtime': 300, 'status': 'active', 'setup-time': 1, 'total-time': 102, 'ram': {'total': 536870912, 'postcopy-requests': 0, 'dirty-sync-count': 1, 'multifd-bytes': 0, 'pages-per-second': 0, 'page-size': 4096, 'remaining': 4521984, 'mbps': 0, 'transferred': 3372844, 'duplicate': 129430, 'dirty-pages-rate': 0, 'skipped': 0, 'normal-bytes': 2203648, 'normal': 538}}}
> 2019-09-17 03:15:34,899 qmp              L0167 DEBUG| >>> {'execute': 'query-migrate'}
> 2019-09-17 03:15:34,899 qmp              L0087 DEBUG| <<< {'timestamp': {'seconds': 1568704534, 'microseconds': 802440}, 'event': 'STOP'}
> 2019-09-17 03:15:34,900 qmp              L0175 DEBUG| <<< {'return': {'status': 'completed', 'setup-time': 1, 'downtime': 30, 'total-time': 137, 'ram': {'total': 536870912, 'postcopy-requests': 0, 'dirty-sync-count': 4, 'multifd-bytes': 0, 'pages-per-second': 1299680, 'page-size': 4096, 'remaining': 0, 'mbps': 474.753235, 'transferred': 4548090, 'duplicate': 133244, 'dirty-pages-rate': 0, 'skipped': 0, 'normal-bytes': 3342336, 'normal': 816}}}
> 2019-09-17 03:15:34,900 qmp              L0167 DEBUG| >>> {'execute': 'query-migrate'}
> 2019-09-17 03:15:34,900 qmp              L0087 DEBUG| <<< {'timestamp': {'seconds': 1568704534, 'microseconds': 832595}, 'event': 'RESUME'}
> 2019-09-17 03:15:35,545 stacktrace       L0039 ERROR|
> 2019-09-17 03:15:35,545 stacktrace       L0042 ERROR| Reproduced traceback from: /usr/local/lib/python3.6/site-packages/avocado/core/test.py:853
> 2019-09-17 03:15:35,547 stacktrace       L0045 ERROR| Traceback (most recent call last):
> 2019-09-17 03:15:35,547 stacktrace       L0045 ERROR|   File "/home/bala/qemu/tests/acceptance/migration.py", line 47, in test_migration_with_tcp_localhost
> 2019-09-17 03:15:35,547 stacktrace       L0045 ERROR|     self.assertEqual(dest_vm.command('query-migrate')['status'], 'completed')
> 2019-09-17 03:15:35,547 stacktrace       L0045 ERROR|   File "/home/bala/qemu/tests/acceptance/avocado_qemu/../../../python/qemu/machine.py", line 378, in command
> 2019-09-17 03:15:35,547 stacktrace       L0045 ERROR|     reply = self.qmp(cmd, conv_keys, **args)
> 2019-09-17 03:15:35,547 stacktrace       L0045 ERROR|   File "/home/bala/qemu/tests/acceptance/avocado_qemu/../../../python/qemu/machine.py", line 370, in qmp
> 2019-09-17 03:15:35,548 stacktrace       L0045 ERROR|     return self._qmp.cmd(cmd, args=qmp_args)
> 2019-09-17 03:15:35,548 stacktrace       L0045 ERROR|   File "/home/bala/qemu/tests/acceptance/avocado_qemu/../../../python/qemu/qmp.py", line 191, in cmd
> 2019-09-17 03:15:35,548 stacktrace       L0045 ERROR|     return self.cmd_obj(qmp_cmd)
> 2019-09-17 03:15:35,548 stacktrace       L0045 ERROR|   File "/home/bala/qemu/tests/acceptance/avocado_qemu/../../../python/qemu/qmp.py", line 174, in cmd_obj
> 2019-09-17 03:15:35,548 stacktrace       L0045 ERROR|     resp = self.__json_read()
> 2019-09-17 03:15:35,548 stacktrace       L0045 ERROR|   File "/home/bala/qemu/tests/acceptance/avocado_qemu/../../../python/qemu/qmp.py", line 82, in __json_read
> 2019-09-17 03:15:35,548 stacktrace       L0045 ERROR|     data = self.__sockfile.readline()
> 2019-09-17 03:15:35,548 stacktrace       L0045 ERROR|   File "/usr/lib64/python3.6/socket.py", line 586, in readinto
> 2019-09-17 03:15:35,548 stacktrace       L0045 ERROR|     return self._sock.recv_into(b)
> 2019-09-17 03:15:35,548 stacktrace       L0045 ERROR| ConnectionResetError: [Errno 104] Connection reset by peer
> 
> 
> could you help me on what do I miss here ?

I don't know avocado much; but that looks as though the qemu has exited
on you.

Dave


> -- Bala
> 
> > 
> > On the current version I see:
> > 
> > {"QMP": {"version": {"qemu": {"micro": 50, "minor": 1, "major": 4}, "package": "v4.1.0-852-g1a0b66e787"}, "capabilities": ["oob"]}}
> > { "execute": "qmp_capabilities" }
> > {"return": {}}
> > {'execute': 'query-migrate'}
> > {"return": {"status": "completed"}}
> > 
> > Dave
> > > Signed-off-by: Balamuruhan S <bala24@linux.ibm.com>
> > > ---
> > >  tests/acceptance/migration.py | 7 ++++---
> > >  1 file changed, 4 insertions(+), 3 deletions(-)
> > > 
> > > diff --git a/tests/acceptance/migration.py b/tests/acceptance/migration.py
> > > index a44c1ae58f..0f3553c8f0 100644
> > > --- a/tests/acceptance/migration.py
> > > +++ b/tests/acceptance/migration.py
> > > @@ -44,7 +44,8 @@ class Migration(Test):
> > >              step=0.1,
> > >              args=(source_vm,)
> > >          )
> > > -        self.assertEqual(dest_vm.command('query-migrate')['status'], 'completed')
> > > -        self.assertEqual(source_vm.command('query-migrate')['status'], 'completed')
> > > +        self.assertEqual(source_vm.command('query-migrate')['status'],
> > > +                         'completed')
> > >          self.assertEqual(dest_vm.command('query-status')['status'], 'running')
> > > -        self.assertEqual(source_vm.command('query-status')['status'], 'postmigrate')
> > > +        self.assertEqual(source_vm.command('query-status')['status'],
> > > +                         'postmigrate')
> > > -- 
> > > 2.14.5
> > > 
> > > 
> > --
> > Dr. David Alan Gilbert / dgilbert@redhat.com / Manchester, UK
> 
--
Dr. David Alan Gilbert / dgilbert@redhat.com / Manchester, UK


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [Qemu-devel] [PATCH 3/3] tests/acceptance/migration: test to migrate will all machine types
  2019-09-17  8:45     ` Balamuruhan S
@ 2019-09-17  9:44       ` Dr. David Alan Gilbert
  2019-09-18  0:46         ` David Gibson
  0 siblings, 1 reply; 12+ messages in thread
From: Dr. David Alan Gilbert @ 2019-09-17  9:44 UTC (permalink / raw)
  To: Balamuruhan S
  Cc: ehabkost, groug, qemu-devel, sathnaga, clg, crosa, qemu-ppc, david

* Balamuruhan S (bala24@linux.ibm.com) wrote:
> On Mon, Sep 16, 2019 at 03:50:06PM +0100, Dr. David Alan Gilbert wrote:
> > * Balamuruhan S (bala24@linux.ibm.com) wrote:
> > > add migration test to query machine types supported by qemu binary
> > > and migrate vm will all supported type.
> > > 
> > > Signed-off-by: Balamuruhan S <bala24@linux.ibm.com>
> > 
> > Depending on the architecture you might find that some machine types
> > aren't migratable while some are.
> 
> Thanks Dave, is there a way to query/check whether a machine type on the
> architecture is migratable or should we try migrating and handle exception
> on failure ?

I don't know a way to detect it; you can add -only-migratable to get
qemu to fai early if a device is declared as being non-migratable; but
that still doesn't say that all the devices have actually been tested
migrating.

Dave


> -- Bala
> > 
> > Dave
> > 
> > > ---
> > >  tests/acceptance/migration.py | 26 ++++++++++++++++++++++++++
> > >  1 file changed, 26 insertions(+)
> > > 
> > > diff --git a/tests/acceptance/migration.py b/tests/acceptance/migration.py
> > > index 0f3553c8f0..74416ccc21 100644
> > > --- a/tests/acceptance/migration.py
> > > +++ b/tests/acceptance/migration.py
> > > @@ -49,3 +49,29 @@ class Migration(Test):
> > >          self.assertEqual(dest_vm.command('query-status')['status'], 'running')
> > >          self.assertEqual(source_vm.command('query-status')['status'],
> > >                           'postmigrate')
> > > +
> > > +
> > > +    def test_migration_with_machine_types(self):
> > > +        migration_port = self._get_free_port()
> > > +        for machine in self.get_machine_types():
> > > +            if 'pseries' in machine:
> > > +                print("migrating with machine type - {}".format(machine))
> > > +                source_vm = self.get_vm('-M', '{},cap-htm=off'.format(machine))
> > > +                dest_uri = 'tcp:localhost:%u' % migration_port
> > > +                dest_vm = self.get_vm('-M', '{},cap-htm=off'.format(machine),
> > > +                                      '-incoming', dest_uri)
> > > +                dest_vm.launch()
> > > +                source_vm.launch()
> > > +                source_vm.qmp('migrate', uri=dest_uri)
> > > +                wait.wait_for(
> > > +                    self.migration_finished,
> > > +                    timeout=self.timeout,
> > > +                    step=0.1,
> > > +                    args=(source_vm,)
> > > +                )
> > > +                self.assertEqual(source_vm.command('query-migrate')['status'],
> > > +                                                   'completed')
> > > +                self.assertEqual(dest_vm.command('query-status')['status'],
> > > +                                                 'running')
> > > +                self.assertEqual(source_vm.command('query-status')['status'],
> > > +                                                   'postmigrate')
> > > -- 
> > > 2.14.5
> > > 
> > > 
> > --
> > Dr. David Alan Gilbert / dgilbert@redhat.com / Manchester, UK
> 
--
Dr. David Alan Gilbert / dgilbert@redhat.com / Manchester, UK


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [Qemu-devel] [PATCH 3/3] tests/acceptance/migration: test to migrate will all machine types
  2019-09-17  9:44       ` Dr. David Alan Gilbert
@ 2019-09-18  0:46         ` David Gibson
  0 siblings, 0 replies; 12+ messages in thread
From: David Gibson @ 2019-09-18  0:46 UTC (permalink / raw)
  To: Dr. David Alan Gilbert
  Cc: ehabkost, groug, qemu-devel, sathnaga, clg, crosa, qemu-ppc,
	Balamuruhan S

[-- Attachment #1: Type: text/plain, Size: 1616 bytes --]

On Tue, Sep 17, 2019 at 10:44:25AM +0100, Dr. David Alan Gilbert wrote:
> * Balamuruhan S (bala24@linux.ibm.com) wrote:
> > On Mon, Sep 16, 2019 at 03:50:06PM +0100, Dr. David Alan Gilbert wrote:
> > > * Balamuruhan S (bala24@linux.ibm.com) wrote:
> > > > add migration test to query machine types supported by qemu binary
> > > > and migrate vm will all supported type.
> > > > 
> > > > Signed-off-by: Balamuruhan S <bala24@linux.ibm.com>
> > > 
> > > Depending on the architecture you might find that some machine types
> > > aren't migratable while some are.
> > 
> > Thanks Dave, is there a way to query/check whether a machine type on the
> > architecture is migratable or should we try migrating and handle exception
> > on failure ?
> 
> I don't know a way to detect it; you can add -only-migratable to get
> qemu to fai early if a device is declared as being non-migratable; but
> that still doesn't say that all the devices have actually been tested
> migrating.

At present we kind of have an informal distinction between those
machine types that are mature and maintained enough to support
migration (which I think is just pc, q35, pseries and arm virt) and
those which aren't.

There isn't, as far as I know, a way to detect this.

I know we've mentioned at least briefly the idea of formalizing this
distinction at qemu summit, but I don't think the discussion went
anywhere.

-- 
David Gibson			| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you.  NOT _the_ _other_
				| _way_ _around_!
http://www.ozlabs.org/~dgibson

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [Qemu-devel] [PATCH 3/3] tests/acceptance/migration: test to migrate will all machine types
  2019-08-05 18:20 [Qemu-devel] [PATCH 0/3] Add acceptance test for migration Balamuruhan S
@ 2019-08-05 18:20 ` Balamuruhan S
  0 siblings, 0 replies; 12+ messages in thread
From: Balamuruhan S @ 2019-08-05 18:20 UTC (permalink / raw)
  To: qemu-devel; +Cc: Balamuruhan S, clg, david

add migration test to query machine types supported by qemu binary
and migrate vm will all supported type.

Signed-off-by: Balamuruhan S <bala24@linux.ibm.com>
---
 tests/acceptance/migration.py | 26 ++++++++++++++++++++++++++
 1 file changed, 26 insertions(+)

diff --git a/tests/acceptance/migration.py b/tests/acceptance/migration.py
index 66941db3b3..a598b54718 100644
--- a/tests/acceptance/migration.py
+++ b/tests/acceptance/migration.py
@@ -50,3 +50,29 @@ class Migration(Test):
         self.assertEqual(source_vm.command('query-migrate')['status'], 'completed')
         self.assertEqual(dest_vm.command('query-status')['status'], 'running')
         self.assertEqual(source_vm.command('query-status')['status'], 'postmigrate')
+
+
+    def test_migration_with_machine_types(self):
+        migration_port = self._get_free_port()
+        for machine in self.get_machine_types():
+            if 'pseries' in machine:
+                print("migrating with machine type - {}".format(machine))
+                source_vm = self.get_vm('-M', '{},cap-htm=off'.format(machine))
+                dest_uri = 'tcp:localhost:%u' % migration_port
+                dest_vm = self.get_vm('-M', '{},cap-htm=off'.format(machine),
+                                      '-incoming', dest_uri)
+                dest_vm.launch()
+                source_vm.launch()
+                source_vm.qmp('migrate', uri=dest_uri)
+                wait.wait_for(
+                    self.migration_finished,
+                    timeout=self.timeout,
+                    step=0.1,
+                    args=(source_vm,)
+                )
+                self.assertEqual(source_vm.command('query-migrate')['status'],
+                                                   'completed')
+                self.assertEqual(dest_vm.command('query-status')['status'],
+                                                 'running')
+                self.assertEqual(source_vm.command('query-status')['status'],
+                                                   'postmigrate')
-- 
2.14.5



^ permalink raw reply related	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2019-09-18  3:57 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-09-16  9:34 [Qemu-devel] [PATCH 0/3] Add acceptance test for migration Balamuruhan S
2019-09-16  9:34 ` [Qemu-devel] [PATCH 1/3] tests/acceptance/migration: fix post migration check Balamuruhan S
2019-09-16 18:50   ` Dr. David Alan Gilbert
2019-09-17  8:51     ` Balamuruhan S
2019-09-17  9:40       ` Dr. David Alan Gilbert
2019-09-16  9:34 ` [Qemu-devel] [PATCH 2/3] tests/acceptance/avocado_qemu: add method to get supported machine types Balamuruhan S
2019-09-16  9:34 ` [Qemu-devel] [PATCH 3/3] tests/acceptance/migration: test to migrate will all " Balamuruhan S
2019-09-16 14:50   ` Dr. David Alan Gilbert
2019-09-17  8:45     ` Balamuruhan S
2019-09-17  9:44       ` Dr. David Alan Gilbert
2019-09-18  0:46         ` David Gibson
  -- strict thread matches above, loose matches on Subject: below --
2019-08-05 18:20 [Qemu-devel] [PATCH 0/3] Add acceptance test for migration Balamuruhan S
2019-08-05 18:20 ` [Qemu-devel] [PATCH 3/3] tests/acceptance/migration: test to migrate will all machine types Balamuruhan S

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).