From nobody Sun Apr 28 22:04:07 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zoho.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1492696597562397.6958567335903; Thu, 20 Apr 2017 06:56:37 -0700 (PDT) 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 mx1.redhat.com (Postfix) with ESMTPS id 35C7775EBA; Thu, 20 Apr 2017 13:56:35 +0000 (UTC) Received: from colo-mx.corp.redhat.com (unknown [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id BD9D48FF8D; Thu, 20 Apr 2017 13:56:34 +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 81DFEB3180; Thu, 20 Apr 2017 13:56:16 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id v3KDnCu3001494 for ; Thu, 20 Apr 2017 09:49:12 -0400 Received: by smtp.corp.redhat.com (Postfix) id 551F080B0D; Thu, 20 Apr 2017 13:49:12 +0000 (UTC) Received: from andariel.redhat.com (ovpn-204-112.brq.redhat.com [10.40.204.112]) by smtp.corp.redhat.com (Postfix) with ESMTP id 58D5180B01; Thu, 20 Apr 2017 13:49:08 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 35C7775EBA Authentication-Results: ext-mx04.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx04.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=libvir-list-bounces@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 35C7775EBA From: Peter Krempa To: libvir-list@redhat.com Date: Thu, 20 Apr 2017 15:50:00 +0200 Message-Id: <5ec182fb58d39249dfa2fd0439c9475f35cff85e.1492696186.git.pkrempa@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-loop: libvir-list@redhat.com Cc: Peter Krempa Subject: [libvirt] [PATCH] qemu: Don't fail if physical size can't be updated in qemuDomainGetBlockInfo 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: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Thu, 20 Apr 2017 13:56:36 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Since commit c5f6151390 qemuDomainBlockInfo tries to update the "physical" storage size for all network storage and not only block devices. Since the storage driver APIs to do this are not implemented for certain storage types (RBD, iSCSI, ...) the code would fail to retrieve any data since the failure of qemuDomainStorageUpdatePhysical is fatal. Since it's desired to return data even if the total size can't be updated we need to ignore errors from that fucntion and return plausible data. Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=3D1442344 --- Notes: This function will require more fixing though. This is just a bandaid to remove the regression. I'll post other patches as follow up later. src/qemu/qemu_driver.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index e39de625d..8ff242597 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -11553,10 +11553,12 @@ qemuDomainGetBlockInfo(virDomainPtr dom, if (info->allocation =3D=3D 0) info->allocation =3D entry->physical; - if (qemuDomainStorageUpdatePhysical(driver, cfg, vm, disk->src) < = 0) - goto endjob; - - info->physical =3D disk->src->physical; + if (qemuDomainStorageUpdatePhysical(driver, cfg, vm, disk->src) = =3D=3D 0) { + info->physical =3D disk->src->physical; + } else { + virResetLastError(); + info->physical =3D entry->physical; + } } else { info->physical =3D entry->physical; } --=20 2.12.2 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list