File libxl-0ff26a3225d69ffec76fe5aca8296852fa951204.patch of Package xen.24552

From: Anthony PERARD <anthony.perard@citrix.com>
Date: Tue, 11 May 2021 10:28:07 +0100
Subject: libxl 0ff26a3225d69ffec76fe5aca8296852fa951204
References: bsc#1180350

libxl: Assert qmp_ev's state in qmp_ev_qemu_compare_version

We are supposed to read the version information only when qmp_ev is in
state "Connected" (that correspond to state==qmp_state_connected),
assert it so that the function isn't used too early.

Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
Reviewed-by: Jason Andryuk <jandryuk@gmail.com>
---
 tools/libxl/libxl_qmp.c | 2 ++
 1 file changed, 2 insertions(+)

--- a/tools/libxl/libxl_qmp.c
+++ b/tools/libxl/libxl_qmp.c
@@ -292,6 +292,8 @@ static int qmp_handle_response(libxl__gc
 static int qmp_ev_qemu_compare_version(libxl__ev_qmp *ev, int major,
                                        int minor, int micro)
 {
+    assert(ev->state == qmp_state_connected);
+
 #define CHECK_VERSION(level) do { \
     if (ev->qemu_version.level > (level)) return +1; \
     if (ev->qemu_version.level < (level)) return -1; \
openSUSE Build Service is sponsored by