From nobody Fri Apr 26 03:57:42 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.25 as permitted sender) client-ip=209.132.183.25; envelope-from=libvir-list-bounces@redhat.com; helo=mx4-phx2.redhat.com; Authentication-Results: mx.zoho.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.25 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; Return-Path: Received: from mx4-phx2.redhat.com (mx4-phx2.redhat.com [209.132.183.25]) by mx.zohomail.com with SMTPS id 1487841872481282.32013227111224; Thu, 23 Feb 2017 01:24:32 -0800 (PST) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by mx4-phx2.redhat.com (8.13.8/8.13.8) with ESMTP id v1N9LBbE003358; Thu, 23 Feb 2017 04:21:12 -0500 Received: from smtp.corp.redhat.com (int-mx16.intmail.prod.int.phx2.redhat.com [10.5.11.28]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id v1N9LAbI012575 for ; Thu, 23 Feb 2017 04:21:10 -0500 Received: by smtp.corp.redhat.com (Postfix) id 6ABEEB3114; Thu, 23 Feb 2017 09:21:10 +0000 (UTC) Received: from angien.brq.redhat.com (dhcp129-47.brq.redhat.com [10.34.129.47]) by smtp.corp.redhat.com (Postfix) with ESMTP id BFCC8306BE; Thu, 23 Feb 2017 09:21:09 +0000 (UTC) From: Peter Krempa To: libvir-list@redhat.com Date: Thu, 23 Feb 2017 10:22:05 +0100 Message-Id: <3ab614d50d28b13abb71c8bb910c8a845f410cd8.1487841725.git.pkrempa@redhat.com> X-Scanned-By: MIMEDefang 2.74 on 10.5.11.28 X-loop: libvir-list@redhat.com Cc: Peter Krempa Subject: [libvirt] [PATCH] qemu: Don't update physical storage size of empty drives 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-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Previously the code called virStorageSourceUpdateBlockPhysicalSize which did not do anything on empty drives since it worked only on block devices. After the refactor in c5f6151390 it's called for all devices and thus attempts to deref the NULL path of empty drives. Add a check that skips the update of the physical size if the storage source is empty. Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=3D1420718 --- src/qemu/qemu_driver.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index 6e1e3d408..77d81755a 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -11336,6 +11336,9 @@ qemuDomainStorageUpdatePhysical(virQEMUDriverPtr dr= iver, int fd =3D -1; struct stat sb; + if (virStorageSourceIsEmpty(src)) + return 0; + if (qemuDomainStorageOpenStat(driver, cfg, vm, src, &fd, &sb) < 0) return -1; --=20 2.11.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list