Bug 1370418

Summary: Improve Error information when doesn't find node device or multiple devices are found
Product: [Community] Virtualization Tools Reporter: Xiaodai Wang <xiaodwan>
Component: virt-managerAssignee: Cole Robinson <crobinso>
Status: CLOSED UPSTREAM QA Contact:
Severity: low Docs Contact:
Priority: low    
Version: unspecifiedCC: berrange, crobinso, gscrivan, juzhou, mxie, mzhan, rbalakri, tzheng
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-03-29 18:22:15 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description Xiaodai Wang 2016-08-26 09:28:10 UTC
Description of problem:
Improve Error information when doesn't find node device or multiple devices are found.

Version-Release number of selected component (if applicable):
virt-install-1.4.0-1.el7.noarch

How reproducible:
100%

Steps to Reproduce:
# virt-install --name test --memory 2048 --disk path=/var/lib/libvirt/images/test.img,size=5 --location http://download.eng.pek2.redhat.com//pub/rhel/released/RHEL-7/7.2/Server/x86_64/os/ --hostdev 15e1:2007
ERROR    Error: --hostdev 15e1:2007: Did not find node device matching '15e1:2007': 15e1:2007 corresponds to multiple node devices
[root@xiaodwan-test-7 images]# virt-install --name test --memory 2048 --disk path=/var/lib/libvirt/images/test.img,size=5 --location http://download.eng.pek2.redhat.com//pub/rhel/released/RHEL-7/7.2/Server/x86_64/os/ --hostdev 15e1:2008
ERROR    Error: --hostdev 15e1:2008: Did not find node device matching '15e1:2008': Did not find a matching node device for '15e1:2008'

Actual results:
"Did not find node device matching '15e1:2008" is redundant when did not find a matching node and is error when multiple node dicevices are found.

Expected results:
It's better to remove the "Did not find node device matching '15e1:200'" and only keep the last part is enough.

For example:
Error: --hostdev 15e1:2008: Did not find a matching node device for '15e1:2008'
Error: --hostdev 15e1:2007: 15e1:2007 corresponds to multiple node device

Additional info

Comment 2 Cole Robinson 2017-03-29 18:22:15 UTC
Thanks for the report, fixed upstream now

commit f341352cdadeadedab1579d1759ed1387aa28c75
Author: Cole Robinson <crobinso>
Date:   Wed Mar 29 14:09:35 2017 -0400

    nodedev: Remove redundant error string (bz #1370418)