> On Jan 25, 2022, at 11:25 PM, Philippe Mathieu-Daudé <f4...@amsat.org> wrote: > > Hi Jagannathan, > > On 19/1/22 22:42, Jagannathan Raman wrote: >> Avocado tests for libvfio-user in QEMU - tests startup, >> hotplug and migration of the server object >> Signed-off-by: Elena Ufimtseva <elena.ufimts...@oracle.com> >> Signed-off-by: John G Johnson <john.g.john...@oracle.com> >> Signed-off-by: Jagannathan Raman <jag.ra...@oracle.com> >> --- >> MAINTAINERS | 1 + >> tests/avocado/vfio-user.py | 225 +++++++++++++++++++++++++++++++++++++ >> 2 files changed, 226 insertions(+) >> create mode 100644 tests/avocado/vfio-user.py > >> +class VfioUser(QemuSystemTest): >> + """ >> + :avocado: tags=vfiouser >> + """ >> + KERNEL_COMMON_COMMAND_LINE = 'printk.time=0 ' >> + timeout = 20 >> + >> + @staticmethod >> + def migration_finished(vm): >> + res = vm.command('query-migrate') >> + if 'status' in res: >> + return res['status'] in ('completed', 'failed') > > Do we need to check for failed migration in do_test_migrate()?
OK, will do. > >> + else: >> + return False > > [...] > >> + def launch_server_hotplug(self, socket): >> + server_vm = self.get_vm() >> + server_vm.add_args('-machine', 'x-remote') >> + server_vm.add_args('-nodefaults') >> + server_vm.add_args('-device', 'lsi53c895a,id=lsi1') >> + server_vm.launch() >> + server_vm.command('human-monitor-command', >> + command_line='object_add x-vfio-user-server,' > > Why not use qmp('object-add', ...) directly? OK, will use qmp directly. Thank you! -- Jag > >> + 'id=vfioobj,socket.type=unix,' >> + 'socket.path='+socket+',device=lsi1') >> + return server_vm > > Otherwise LGTM.