From nobody Sun May 19 03:38:07 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 207.211.31.120 as permitted sender) client-ip=207.211.31.120; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.120 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=1595240576; cv=none; d=zohomail.com; s=zohoarc; b=cW4evxQVVBd4RIQImz1PYCHysOWU7uFFDUgE/pDus+/M22gSciN+ce1RWbZCyoV687jyq5lb6/e5NEhQyUK6Q6+6Rn1vnyaxjyQNmyIk6/bh4ZIQOq1z6g9qzFy3Y9Q4IIP0Fr3Fd58baNgpKdxJ4hECKz5IKuNY83cLDKMJIfc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1595240576; h=Content-Type:Cc:Date:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:Message-ID:Sender:Subject:To; bh=ldtkgVdAS0PW08NO8cfBhIL/2BVGzfmJXgxTny3rsoQ=; b=IhIg2EydtJ74fYhzYj2z24SwxtQa2xOaYV30bymetw484fTy3eaTeqKKnT9WU1nphoKRGVoPI9i5z4C9+K91YZa6nKprRLHkFnTiJsox5xz20bFTc0Uu0+qwMGZd1EhZg5ktZjjmCxt6xHQWvSxTCUhczWT7OqtJhaN6hcMez9I= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.120 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-1.mimecast.com (us-smtp-delivery-1.mimecast.com [207.211.31.120]) by mx.zohomail.com with SMTPS id 1595240576834334.20086301568824; Mon, 20 Jul 2020 03:22:56 -0700 (PDT) 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-25-sVqPWHAtM_m9DGk9xcDb1A-1; Mon, 20 Jul 2020 06:22:53 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 4794B1932480; Mon, 20 Jul 2020 10:22:47 +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 3DB835BAD5; Mon, 20 Jul 2020 10:22:45 +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 39E319A13F; Mon, 20 Jul 2020 10:22:41 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 06KAMdWv028026 for ; Mon, 20 Jul 2020 06:22:39 -0400 Received: by smtp.corp.redhat.com (Postfix) id 8CFD12B6DC; Mon, 20 Jul 2020 10:22:39 +0000 (UTC) Received: from thuth.com (ovpn-112-34.ams2.redhat.com [10.36.112.34]) by smtp.corp.redhat.com (Postfix) with ESMTP id 5801119C58; Mon, 20 Jul 2020 10:22:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1595240575; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:content-type:content-type:list-id: list-help:list-unsubscribe:list-subscribe:list-post; bh=ldtkgVdAS0PW08NO8cfBhIL/2BVGzfmJXgxTny3rsoQ=; b=cPi93JvVMypW0YLtrtpR087WhAS/x0WnU1Bowz3zTZYuczZ6NGaVgiBj5vyfKwQ5tPNVKG /Y9Du8r5DIHN8NDruowlJFpCOHGGh8leLJKtoeDcVaZWStolrx5rd1Lzo+eesCaAYxxmgf lTwQg4OO/QTwF98gs4/eHwVt1e3j8/k= X-MC-Unique: sVqPWHAtM_m9DGk9xcDb1A-1 From: Thomas Huth To: libvir-list@redhat.com Subject: [PATCH] qemu_driver.c: Fix domfsinfo for non-PCI device information from guest agent Date: Mon, 20 Jul 2020 12:22:33 +0200 Message-Id: <20200720102233.28768-1-thuth@redhat.com> X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-loop: libvir-list@redhat.com Cc: Collin Walling , Boris Fiuczynski , Jonathon Jongsma , =?UTF-8?q?Tom=C3=A1=C5=A1=20Golembiovsk=C3=BD?= 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.15 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 X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" qemuAgentFSInfoToPublic() currently only sets the devAlias for PCI devices. However, the QEMU guest agent could also provide the device name in the "dev" field of the response for other devices instead (well, at least after fixing another problem in the current QEMU guest agent...). So if creating the devAlias from the PCI information failed, let's fall back to the name provided by the guest agent. This helps to fix the empty "Target" fields that occur when running "virsh domfsinfo" on s390x where CCW devices are used for the guest instead of PCI devices. Also add a proper debug message here in case we completely failed to set the device alias, since this problem here was very hard to debug: The only two error messages that I've seen were "Unable to get filesystem information" and "Unable to encode message payload" - which only indicates that something went wrong in the RPC call. No debug message indicated the real problem, so I had to learn the hard way why the RPC call failed (it apparently does not like devAlias left to be NULL) and where the real problem comes from. Buglink: https://bugzilla.redhat.com/show_bug.cgi?id=3D1755075 Signed-off-by: Thomas Huth Reviewed-by: Daniel P. Berrang=C3=A9 --- src/qemu/qemu_driver.c | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index d185666ed8..e45c61ee20 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -21935,14 +21935,17 @@ qemuAgentFSInfoToPublic(qemuAgentFSInfoPtr agent, qemuAgentDiskInfoPtr agentdisk =3D agent->disks[i]; virDomainDiskDefPtr diskDef; =20 - if (!(diskDef =3D virDomainDiskByAddress(vmdef, - &agentdisk->pci_controller, - agentdisk->bus, - agentdisk->target, - agentdisk->unit))) - continue; - - ret->devAlias[i] =3D g_strdup(diskDef->dst); + diskDef =3D virDomainDiskByAddress(vmdef, + &agentdisk->pci_controller, + agentdisk->bus, + agentdisk->target, + agentdisk->unit); + if (diskDef !=3D NULL) + ret->devAlias[i] =3D g_strdup(diskDef->dst); + else if (agentdisk->devnode !=3D NULL) + ret->devAlias[i] =3D g_strdup(agentdisk->devnode); + else + VIR_DEBUG("Missing devnode name for '%s'.", ret->mountpoint); } =20 return ret; --=20 2.18.1