From nobody Sun May 5 06:08:34 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 1491332179546611.7736270895559; Tue, 4 Apr 2017 11:56:19 -0700 (PDT) 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 mx1.redhat.com (Postfix) with ESMTPS id 6CCA17AEA1; Tue, 4 Apr 2017 18:56:17 +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 319A918106; Tue, 4 Apr 2017 18:56:15 +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 AE9C318523CC; Tue, 4 Apr 2017 18:56:11 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id v34IuA22028097 for ; Tue, 4 Apr 2017 14:56:10 -0400 Received: by smtp.corp.redhat.com (Postfix) id 1D40418106; Tue, 4 Apr 2017 18:56:10 +0000 (UTC) Received: from localhost.localdomain.com (ovpn-116-19.phx2.redhat.com [10.3.116.19]) by smtp.corp.redhat.com (Postfix) with ESMTP id CE9AD784A9 for ; Tue, 4 Apr 2017 18:56:08 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 6CCA17AEA1 Authentication-Results: ext-mx01.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx01.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 6CCA17AEA1 From: John Ferlan To: libvir-list@redhat.com Date: Tue, 4 Apr 2017 14:56:05 -0400 Message-Id: <20170404185605.7634-1-jferlan@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH] conf: Add check for non scsi_host parent during vport delete 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.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.25]); Tue, 04 Apr 2017 18:56:18 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" https://bugzilla.redhat.com/show_bug.cgi?id=3D1420740 If the parent is not a scsi_host, then we can just happily return since we won't be removing a vport. Fixes a bug with the following output: $ virsh pool-destroy host4_hba_pool error: Failed to destroy pool host4_hba_pool error: internal error: Invalid adapter name 'pci_0000_10_00_1' for SCSI pool $ Signed-off-by: John Ferlan --- src/conf/node_device_conf.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/conf/node_device_conf.c b/src/conf/node_device_conf.c index 7d0baa9..cc3fad8 100644 --- a/src/conf/node_device_conf.c +++ b/src/conf/node_device_conf.c @@ -2074,6 +2074,13 @@ virNodeDeviceDeleteVport(virConnectPtr conn, if (!(vhba_parent =3D virNodeDeviceGetParentName(conn, scsi_host_n= ame))) goto cleanup; =20 + /* If the parent is not a scsi_host, then this is a pool backed + * directly to an HBA and there's no vHBA to remove - so we're don= e */ + if (!STRPREFIX(vhba_parent, "scsi_host")) { + ret =3D 0; + goto cleanup; + } + if (virSCSIHostGetNumber(vhba_parent, &parent_host) < 0) goto cleanup; } --=20 2.9.3 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list