From nobody Sat May 4 14:01:14 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 205.139.110.61 as permitted sender) client-ip=205.139.110.61; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.61 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1576677811; cv=none; d=zohomail.com; s=zohoarc; b=iRV4NLsbXhZKJsiAq0fZKBoAC/3MW7kfFNxCXg14lYrXux9qpnnDmbsTQnoEoymnxHVQK/pec1kHnmVfiRlx6jcWw5GLP5ib3CqtWGUDJUrxOs7XYQje0oJp3co9/hcSev7KO/JFIqPtRwD2Q3f2DZKfU3zwvOrJO6Ikhe2gylg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1576677811; h=Content-Type:Content-Transfer-Encoding:Date:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To; bh=8aqMXyKeNvYTKeJ+I7g+XYWAuiqrZMan9/zV/PFHrcM=; b=aVvu8tFxDL6zjsADibDuGki+bJVfNQHxroKgS9p1SpXcFgZQB05tBLTZS7wai/xky7YAnnWoyUq5kYGSRE+tvUSijWPNQVLrKX39ISg8TLfzLCrsKt6y5eNKmViVbISuirpuyr+m9txMTCm+AUoE0ba+WCac1Ph6M99gt57/14E= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.61 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-1.mimecast.com (us-smtp-2.mimecast.com [205.139.110.61]) by mx.zohomail.com with SMTPS id 1576677811657965.25183561774; Wed, 18 Dec 2019 06:03:31 -0800 (PST) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-358-we2HTMbkMFWmruFp8Euljg-1; Wed, 18 Dec 2019 09:03:28 -0500 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id A466418CB77E; Wed, 18 Dec 2019 14:03:22 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id ABB1160C18; Wed, 18 Dec 2019 14:03:21 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 1B8DD18089CF; Wed, 18 Dec 2019 14:03:20 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id xBIE3CmB007429 for ; Wed, 18 Dec 2019 09:03:12 -0500 Received: by smtp.corp.redhat.com (Postfix) id DF96368890; Wed, 18 Dec 2019 14:03:12 +0000 (UTC) Received: from wlan-5-103.fab.redhat.com (wlan-5-103.fab.redhat.com [10.33.5.103]) by smtp.corp.redhat.com (Postfix) with ESMTP id C819E675B8; Wed, 18 Dec 2019 14:03:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1576677810; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=8aqMXyKeNvYTKeJ+I7g+XYWAuiqrZMan9/zV/PFHrcM=; b=VNgMJyyQeyfa2lAL0B5Oizm/4Ib4/RFgnxbzLAT/q8/B4c8WayTcWke4loPgsvqgGuh8kD 8Ve0tYT8uY8CdHF1jEXTTtxrtbLILS3c5QFePemxvITcNb1/EvRV8y8lQE2+fATJqYvB6Y t0Fp6s4VivBLsf8rs7TOLmenP241YYg= From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: libvir-list@redhat.com Date: Wed, 18 Dec 2019 14:03:01 +0000 Message-Id: <20191218140301.764782-1-berrange@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH] qemu: store the emulator name in the capabilities XML X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-MC-Unique: we2HTMbkMFWmruFp8Euljg-1 X-Mimecast-Spam-Score: 0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) We don't need this for any functional purpose, but when debugging hosts it is useful to know what binary a given capabilities XML document is associated with. Signed-off-by: Daniel P. Berrang=C3=A9 --- src/qemu/qemu_capabilities.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c index 2223589058..7d47fa4d02 100644 --- a/src/qemu/qemu_capabilities.c +++ b/src/qemu/qemu_capabilities.c @@ -3852,6 +3852,7 @@ virQEMUCapsParseSEVInfo(virQEMUCapsPtr qemuCaps, xmlX= PathContextPtr ctxt) * Parsing a doc that looks like * * + * /some/path * 234235253 * 234235253 * 1002016 @@ -3895,6 +3896,18 @@ virQEMUCapsLoadCache(virArch hostArch, goto cleanup; } =20 + if (!(str =3D virXPathString("string(./emulator)", ctxt))) { + virReportError(VIR_ERR_INTERNAL_ERROR, "%s", + _("missing emulator in QEMU capabilities cache")); + goto cleanup; + } + if (!STREQ(str, qemuCaps->binary)) { + virReportError(VIR_ERR_INTERNAL_ERROR, + _("Expected caps for '%s' but saw '%s'"), + qemuCaps->binary, str); + goto cleanup; + } + VIR_FREE(str); if (virXPathLongLong("string(./qemuctime)", ctxt, &l) < 0) { virReportError(VIR_ERR_XML_ERROR, "%s", _("missing qemuctime in QEMU capabilities XML")); @@ -4232,6 +4245,8 @@ virQEMUCapsFormatCache(virQEMUCapsPtr qemuCaps) virBufferAddLit(&buf, "\n"); virBufferAdjustIndent(&buf, 2); =20 + virBufferEscapeString(&buf, "%s\n", + qemuCaps->binary); virBufferAsprintf(&buf, "%llu\n", (long long)qemuCaps->ctime); virBufferAsprintf(&buf, "%llu\n", --=20 2.23.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list