From nobody Thu Apr 25 04:06:55 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) client-ip=216.205.24.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 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=1610473679; cv=none; d=zohomail.com; s=zohoarc; b=Ll6ZTDbPlzUpPozPmQeQWd/DtPpD4VYIWTTvkq/EhXpGJxHVirPd0bukS74mg5G0IzsUxZSiLFC3JUksK4MyeKNE4WzbzQT4psHBHhBH228nJsulEVq6g03udDc3iKlbbtFyNjWyFw7dDkZL95lEHNr24XzyGco959Ow6uMgzec= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1610473679; 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=zZFhVzDG1UDQgTtyUBirlZt6TlzL4UjRuIKzNON+sTk=; b=dxDKHRmT6I6Zy43GhKxq62MjWpEFq2EtzypZ0yH0HAMGgd3Qy+9OfeEJvSoJqrYejPL9KXxFcRrS43Fo0ufkF1hmgGLeQbsZ3yKb6Z+2tGh43TQuxLUAL0Akov+EWffRRKPP4gFvjwhCh+hRxLBylHMnYRZVSV+BXXNQA3sg9kI= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 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-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by mx.zohomail.com with SMTPS id 1610473679404703.6376364176813; Tue, 12 Jan 2021 09:47:59 -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-441-WtpKG17eMcCdBjnfnB6uDw-1; Tue, 12 Jan 2021 12:47:54 -0500 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 36AAE107ACF7; Tue, 12 Jan 2021 17:47:48 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id A64035D9DB; Tue, 12 Jan 2021 17:47:47 +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 C1ECE4A7C6; Tue, 12 Jan 2021 17:47:45 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 10CHliBm025323 for ; Tue, 12 Jan 2021 12:47:44 -0500 Received: by smtp.corp.redhat.com (Postfix) id A669D10023B4; Tue, 12 Jan 2021 17:47:44 +0000 (UTC) Received: from harajuku.usersys.redhat.com (unknown [10.40.195.51]) by smtp.corp.redhat.com (Postfix) with ESMTPS id D003310023B5 for ; Tue, 12 Jan 2021 17:47:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1610473678; 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=zZFhVzDG1UDQgTtyUBirlZt6TlzL4UjRuIKzNON+sTk=; b=iqbiUBVClUTu8G/8yHGZgdeYEhWz0H3LjGFQXxw4RYS73I882/x0dsGTtf7d8pphTkY+ss os5ID+OUQrQSTnCvFySEzQ6QG14oxMNm6Jwbb85gcFZJo2Ao+2maGP1cWBog62xi7jBqoP Vcs+13Npgg6ZQrGwgl7qBmFlXjSUuKg= X-MC-Unique: WtpKG17eMcCdBjnfnB6uDw-1 From: Andrea Bolognani To: libvir-list@redhat.com Subject: [libvirt PATCH] qemu: Fix memstat for (non-)transitional memballoon Date: Tue, 12 Jan 2021 18:47:36 +0100 Message-Id: <20210112174736.120308-1-abologna@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-loop: libvir-list@redhat.com 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.14 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" Depending on the memballoon model, the corresponding QOM node will have a different type and we need to account for this when searching for it in the QOM tree. https://bugzilla.redhat.com/show_bug.cgi?id=3D1911786 Signed-off-by: Andrea Bolognani Reviewed-by: Daniel Henrique Barboza Reviewed-by: Michal Privoznik --- src/qemu/qemu_monitor.c | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/src/qemu/qemu_monitor.c b/src/qemu/qemu_monitor.c index b5c0364652..c97dadd11e 100644 --- a/src/qemu/qemu_monitor.c +++ b/src/qemu/qemu_monitor.c @@ -1017,7 +1017,27 @@ qemuMonitorInitBalloonObjectPath(qemuMonitorPtr mon, =20 switch (balloon->info.type) { case VIR_DOMAIN_DEVICE_ADDRESS_TYPE_PCI: - name =3D "virtio-balloon-pci"; + switch (balloon->model) { + case VIR_DOMAIN_MEMBALLOON_MODEL_VIRTIO: + name =3D "virtio-balloon-pci"; + break; + case VIR_DOMAIN_MEMBALLOON_MODEL_VIRTIO_TRANSITIONAL: + name =3D "virtio-balloon-pci-transitional"; + break; + case VIR_DOMAIN_MEMBALLOON_MODEL_VIRTIO_NON_TRANSITIONAL: + name =3D "virtio-balloon-pci-non-transitional"; + break; + case VIR_DOMAIN_MEMBALLOON_MODEL_XEN: + case VIR_DOMAIN_MEMBALLOON_MODEL_NONE: + virReportError(VIR_ERR_INTERNAL_ERROR, "%s", + _("invalid model for virtio-balloon-pci")); + return; + case VIR_DOMAIN_MEMBALLOON_MODEL_LAST: + default: + virReportEnumRangeError(virDomainMemballoonModel, + balloon->model); + return; + } break; case VIR_DOMAIN_DEVICE_ADDRESS_TYPE_CCW: name =3D "virtio-balloon-ccw"; --=20 2.26.2