From nobody Thu May 16 16:47:57 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=1621331151; cv=none; d=zohomail.com; s=zohoarc; b=Qq4fRiwMeaoBdMJwQCQ7PqXeFDIeAJxDbh8x/uarzVtLTGN6BsLNEp8j4chFDqrHMqFyw3VjgFo/vGx3ICBOfNr3HzkJickM9s7e0mtU5zebxgRSPYqYvGwaVuZjPWdEJm2HpqHZL9qceOp48nq140oND0syvM6axsEI6+RZTuc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1621331151; 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=GiuStS4hHfI0ILhSVqVAKTGPJeuJjW5jndUYZqYcMOM=; b=W8CKvHkI/7HYn4Cpf/+/Wd3ex6Cg6u5/gFb07lBNY4sPHliCq1maov61Tu+yyaIJRCv7l+JzB3zHR6gOQeaYb+2FxdEEzSCh8ijgHl+Lbak/QiiXzDXF4eS7CFKAGCkWJNKO5jTo1Fk35Yhm88p7ScN9R0sz8BaODqFPRBJ7jMc= 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 1621331151372432.2997303840823; Tue, 18 May 2021 02:45:51 -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-563-Dv7MDlg_NOy1IxSGZWtTRw-1; Tue, 18 May 2021 05:45:48 -0400 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 mimecast-mx01.redhat.com (Postfix) with ESMTPS id 5505EEC1B9; Tue, 18 May 2021 09:45:27 +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 69D11705A7; Tue, 18 May 2021 09:45:25 +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 6444F5534C; Tue, 18 May 2021 09:45:20 +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 14I9jJCl024719 for ; Tue, 18 May 2021 05:45:19 -0400 Received: by smtp.corp.redhat.com (Postfix) id D1EAF756C0; Tue, 18 May 2021 09:45:18 +0000 (UTC) Received: from localhost.localdomain.com (unknown [10.40.193.164]) by smtp.corp.redhat.com (Postfix) with ESMTP id E6082756EE for ; Tue, 18 May 2021 09:44:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1621331150; 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=GiuStS4hHfI0ILhSVqVAKTGPJeuJjW5jndUYZqYcMOM=; b=d1Gflx8OqcIUXhXj/rIk8NgBy3AeN2GLEElC9rwhAP2w08QMgJFzxirbxY3z8g2XLDblyT XG5uyruNdZh2cl6+Z7nPsDH25EQnmeOm9JviLjwVnwG4kqj0rlFOw2kh3P6b98IECFkBpo 9WBi5OkjvbXez2YzR6066rRHxM35DJk= X-MC-Unique: Dv7MDlg_NOy1IxSGZWtTRw-1 From: Kristina Hanicova To: libvir-list@redhat.com Subject: [PATCH] conf: Report alias name of the detached device in error Date: Tue, 18 May 2021 11:44:39 +0200 Message-Id: <1e8342dd403744172c8d84cad80700d0eab4fb53.1621330999.git.khanicov@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 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.12 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" Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=3D1942367 Signed-off-by: Kristina Hanicova --- src/conf/domain_conf.c | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 7044701fac..e21b9fb946 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -15781,38 +15781,45 @@ virDomainNetFindIdx(virDomainDef *def, virDomainN= etDef *net) if (matchidx < 0) { if (MACAddrSpecified && PCIAddrSpecified) { virReportError(VIR_ERR_DEVICE_MISSING, - _("no device matching MAC address %s found on " + _("no device matching MAC address %s and alias = %s found on " VIR_PCI_DEVICE_ADDRESS_FMT), virMacAddrFormat(&net->mac, mac), + NULLSTR(net->info.alias), net->info.addr.pci.domain, net->info.addr.pci.bus, net->info.addr.pci.slot, net->info.addr.pci.function); } else if (MACAddrSpecified && CCWAddrSpecified) { virReportError(VIR_ERR_DEVICE_MISSING, - _("no device matching MAC address %s found on " + _("no device matching MAC address %s and alias = %s found on " VIR_CCW_DEVICE_ADDRESS_FMT), virMacAddrFormat(&net->mac, mac), + NULLSTR(net->info.alias), net->info.addr.ccw.cssid, net->info.addr.ccw.ssid, net->info.addr.ccw.devno); } else if (PCIAddrSpecified) { virReportError(VIR_ERR_DEVICE_MISSING, - _("no device found on " VIR_PCI_DEVICE_ADDRESS_= FMT), + _("no device matching alias %s found on " + VIR_PCI_DEVICE_ADDRESS_FMT), + NULLSTR(net->info.alias), net->info.addr.pci.domain, net->info.addr.pci.bus, net->info.addr.pci.slot, net->info.addr.pci.function); } else if (CCWAddrSpecified) { virReportError(VIR_ERR_DEVICE_MISSING, - _("no device found on " VIR_CCW_DEVICE_ADDRESS_= FMT), + _("no device matching alias %s found on " + VIR_CCW_DEVICE_ADDRESS_FMT), + NULLSTR(net->info.alias), net->info.addr.ccw.cssid, net->info.addr.ccw.ssid, net->info.addr.ccw.devno); } else if (MACAddrSpecified) { virReportError(VIR_ERR_DEVICE_MISSING, - _("no device matching MAC address %s found"), - virMacAddrFormat(&net->mac, mac)); + _("no device matching MAC address %s and alias = %s found"), + virMacAddrFormat(&net->mac, mac), + NULLSTR(net->info.alias)); } else { virReportError(VIR_ERR_DEVICE_MISSING, "%s", _("no matching device found")); --=20 2.31.1