[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [RFC PATCH v2 04/11] qemu-iotests: delay QMP socket timers

From: Emanuele Giuseppe Esposito
Subject: Re: [RFC PATCH v2 04/11] qemu-iotests: delay QMP socket timers
Date: Fri, 9 Apr 2021 18:13:19 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.8.1

On 08/04/2021 21:03, Paolo Bonzini wrote:

Il gio 8 apr 2021, 18:06 Emanuele Giuseppe Esposito <eesposit@redhat.com <mailto:eesposit@redhat.com>> ha scritto:

    On 08/04/2021 17:40, Paolo Bonzini wrote:
     > On 07/04/21 15:50, Emanuele Giuseppe Esposito wrote:
     >>       def get_qmp_events_filtered(self, wait=60.0):
     >>           result = []
     >> -        for ev in self.get_qmp_events(wait=wait):
     >> +        qmp_wait = wait
     >> +        if qemu_gdb:
     >> +            qmp_wait = 0.0
     >> +        for ev in self.get_qmp_events(wait=qmp_wait):
     >>               result.append(filter_qmp_event(ev))
     >>           return result
     > Should this be handled in get_qmp_events instead, since you're
     > changing all the callers?

    get_qmp_events is in python/machine.py, which as I understand might be
    used also by some other scripts, so I want to keep the changes there to
    the minimum. Also, machine.py has no access to qemu_gdb or
    qemu_valgrind, so passing a boolean or something to delay the timer
    would still require to add a similar check in all sections.

    Or do you have a cleaner way to do this?

Maybe a subclass IotestsMachine?

I actually figured that I could override get_qmp_events and put the check there. Something like (simplified):

class VM(qtest.QEMUQtestMachine):


        def get_qmp_events(self, wait)
                if qemu_gdb or qemu_valgrind:
                        wait = 0.0
                return super().get_qmp_events(wait)


reply via email to

[Prev in Thread] Current Thread [Next in Thread]