[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v3 5/9] tests/qtest: switch to using event callbacks for STOP
From: |
Juan Quintela |
Subject: |
Re: [PATCH v3 5/9] tests/qtest: switch to using event callbacks for STOP event |
Date: |
Thu, 01 Jun 2023 14:23:11 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux) |
Daniel P. Berrangé <berrange@redhat.com> wrote:
> Change the migration test to use the new qtest event callback to watch
> for the stop event. This ensures that we only watch for the STOP event
> on the source QEMU. The previous code would set the single 'got_stop'
> flag when either source or dest QEMU got the STOP event.
>
> Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
Reviewed-by: Juan Quintela <quintela@redhat.com>
If you agreed with my proposed change to patch 1
> -bool got_stop;
> -
> -static void check_stop_event(QTestState *who)
> +bool migrate_watch_for_stop(QTestState *who, const char *name,
> + QDict *event, void *opaque)
> {
> - QDict *event = qtest_qmp_event_ref(who, "STOP");
> - if (event) {
> - got_stop = true;
> - qobject_unref(event);
> + bool *seen = opaque;
> +
> + if (g_str_equal(name, "STOP")) {
> + *seen = true;
You should
return true;
here.
Later, Juan.