From nobody Mon Feb 9 11:32:20 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass(p=reject dis=none) header.from=citrix.com ARC-Seal: i=1; a=rsa-sha256; t=1619194595; cv=none; d=zohomail.com; s=zohoarc; b=UdM2scUTRX14ZQb5Kz5uKW2nDnMGONfPh53xKaz1BKp8c6Ysxc276BzIJhM5x1Ug3BZ7NeOrV/qSp5wr5JgbO6m2QXTH9OXJHlt4Jatbybu6sUq2OdlKxkyl6O8y0ZjLYnzk+YnruycakUeju1mqo2uBlQ1MWYY/ZvkW3EPBr5Y= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1619194595; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=XoFUs8s+H+Qcxf28lZQMchjI52raoVQUInSjHF71Rh4=; b=Pkt+vTiEe5SKdi7AQhlIdPfnsf5lnNCQNKmnZBuUFMciZIWTGFrdY/s/HaqGK9jWnsRi3eLzWgkH1/337zoG7+pUlUb5N6pGWePc5Q/BBtZ06dXYmoUQZX+DUiR73qXg0cIdpVJ4Xim0AaZRPP064SxOB7URrdwkvMZJ+89KkzY= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass header.from= (p=reject dis=none) header.from= Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1619194594998717.0696415931654; Fri, 23 Apr 2021 09:16:34 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.116488.222367 (Exim 4.92) (envelope-from ) id 1lZyTa-0008Hn-8d; Fri, 23 Apr 2021 16:16:18 +0000 Received: by outflank-mailman (output) from mailman id 116488.222367; Fri, 23 Apr 2021 16:16:18 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1lZyTa-0008Hc-4V; Fri, 23 Apr 2021 16:16:18 +0000 Received: by outflank-mailman (input) for mailman id 116488; Fri, 23 Apr 2021 16:16:16 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1lZyTY-0008Fb-Be for xen-devel@lists.xenproject.org; Fri, 23 Apr 2021 16:16:16 +0000 Received: from esa6.hc3370-68.iphmx.com (unknown [216.71.155.175]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id 611e6a7d-8878-4bc2-86a4-10aa49b0445f; Fri, 23 Apr 2021 16:16:15 +0000 (UTC) X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 611e6a7d-8878-4bc2-86a4-10aa49b0445f DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=citrix.com; s=securemail; t=1619194575; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=gTP2NPKwMvvcEW6tAfQV5J2/0JC2fRKLgq5+MXRr9rA=; b=gY/5BTvcH+20FyBiAhIUwNChGkhn6AlvQsGSwa93BmeZO3DXrOa+hqVM uxzJb95PnIE3anpgp1EcKNR1LeyXN/QhixCWBeDk1PqviaRntUJrVbEJa Yf7HbuBMnxwJxpNFYu8EQZSK21xEd4LDRpLWNbfbSWx/j27rKn3yIimt1 A=; Authentication-Results: esa6.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none IronPort-SDR: o6XDtXjQNm2tlxCbQW/75Utq2npQ+oWMTBUrnheQn/YfNJENnS7atFefdkM18jkhZAv9YjglQ6 3NXdJ+C7IGJlWDZJJ/7aKVp/polQs+h/19wM5Xy6udvSYdUuCClzdnbcl7Sf/l8JAQGFCdz3Rb lCze5mVW7alNxhh2KK+Iusge+84RNuwA+5ybYMPMTsB73j3FU48AcDzhj1x6iqiV5RrX3dUoLU F5MERxXXvBIgkkjtb6yMAVo7Q7tyti8wsi7XFEdfGF7tR+JAbtDli/o3ucbBN0bTgujSTQqKma l5c= X-SBRS: 5.1 X-MesageID: 42410027 X-Ironport-Server: esa6.hc3370-68.iphmx.com X-Remote-IP: 162.221.158.21 X-Policy: $RELAYED IronPort-HdrOrdr: A9a23:iO0EZqut0LjoOZQ9DII56uer7skD9dV00zAX/kB9WHVpW+az/v rAoN0w0xjohDENHEw6kdebN6WaBV/a/5h54Y4eVI3SOzXOkm2uMY1k8M/e0yTtcheOj9J1+K 98f8FFaeHYIkN9ia/BjTWQM9Fl+9Wf9bDtuOG29QYOcShPS4VNqzh0ERyaFEoefngjObMcGI CH7sRK4xqMEE52Uu2BCnMIX/fOqrTw/fqMCyIuPBIp5BKDijml8tfBYn2l9ywTTi9VxvMa+X XF+jaJgJmLie2xyRPXygbogah+pd2J8Ld+Lf3JrsAULzn24zzYB7hcZw== X-IronPort-AV: E=Sophos;i="5.82,246,1613451600"; d="scan'208";a="42410027" From: Anthony PERARD To: CC: Anthony PERARD , Ian Jackson , Wei Liu Subject: [XEN PATCH 5/8] libxl: Assert qmp_ev's state in qmp_ev_qemu_compare_version Date: Fri, 23 Apr 2021 17:15:55 +0100 Message-ID: <20210423161558.224367-6-anthony.perard@citrix.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210423161558.224367-1-anthony.perard@citrix.com> References: <20210423161558.224367-1-anthony.perard@citrix.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @citrix.com) Content-Type: text/plain; charset="utf-8" We are supposed to read the version information only when qmp_ev is in state "Connected" (that correspond to state=3D=3Dqmp_state_connected), assert it so that the function isn't used too early. Signed-off-by: Anthony PERARD --- tools/libs/light/libxl_qmp.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tools/libs/light/libxl_qmp.c b/tools/libs/light/libxl_qmp.c index 9b638e6f5442..d0967c9f029f 100644 --- a/tools/libs/light/libxl_qmp.c +++ b/tools/libs/light/libxl_qmp.c @@ -292,6 +292,8 @@ static int qmp_handle_response(libxl__gc *gc, libxl__qm= p_handler *qmp, static int qmp_ev_qemu_compare_version(libxl__ev_qmp *ev, int major, int minor, int micro) { + assert(ev->state =3D=3D qmp_state_connected); + #define CHECK_VERSION(level) do { \ if (ev->qemu_version.level > (level)) return +1; \ if (ev->qemu_version.level < (level)) return -1; \ --=20 Anthony PERARD