Bug 1679025 - [RFE]Add parameter to specify guest's id, name and uuid in virt-xml
Summary: [RFE]Add parameter to specify guest's id, name and uuid in virt-xml
Keywords:
Status: CLOSED UPSTREAM
Alias: None
Product: Virtualization Tools
Classification: Community
Component: virt-manager
Version: unspecified
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: ---
Assignee: Pavel Hrdina
QA Contact: Virtualization Bugs
URL:
Whiteboard:
: 1679026 (view as bug list)
Depends On:
Blocks: 1679026
TreeView+ depends on / blocked
 
Reported: 2019-02-20 07:08 UTC by zonglin jiang
Modified: 2019-03-21 17:53 UTC (History)
10 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
: 1679026 (view as bug list)
Environment:
Last Closed: 2019-03-21 17:51:09 UTC
Embargoed:


Attachments (Terms of Use)

Description zonglin jiang 2019-02-20 07:08:55 UTC
Description of problem:
[RFE]Add parameter to specify guest's id, name and uuid in virt-xml

Otherwise guest with pure number as its name will not be found since its name will only be viewed as guest id


Version-Release number of selected component (if applicable):
For rhel 7
kernel-3.10.0-957.el7.x86_64
qemu-kvm-rhev-2.12.0-19.el7_6.2.x86_64
libvirt-python-4.5.0-1.el7.x86_64
libvirt-4.5.0-10.el7_6.4.x86_64
virt-install-1.5.0-1.el7.noarch
virt-manager-1.5.0-1.el7.noarch

For rhel8
kernel-4.18.0-60.el8.x86_64
python3-libvirt-4.5.0-1.module+el8+2529+a9686a4d.x86_64
virt-install-2.0.0-2.el8.noarch
libvirt-4.5.0-18.module+el8+2691+dc742e5d.x86_64
qemu-kvm-2.12.0-57.module+el8+2683+02b3b955.x86_64
virt-manager-2.0.0-2.el8.noarch

How reproducible
100%

Steps to Reproduce
1. Create a guest with name 123
2. virt-xml 123 --edit name=usb_2_1_8 --hostdev rom_bar=off

Actual results:
ERROR    Could not find domain '123': Domain not found: no domain with matching id 123

Expected results:
the guest called 123 can be edited

Additionally info:
some libvirt components can specify parameter's character like
--id, --uuid, --domain-name
In virt-xml, the pure number parameter will only be treated as guest id

Comment 1 Cole Robinson 2019-02-20 18:52:24 UTC
Thanks for the report. I'd rather not have to add and test explicit options unless there's a really compelling reason. We can probably tweak the lookup logic a bit to check if the string is a VM name first before assuming it's an ID just because it's an integer

Comment 2 Cole Robinson 2019-03-21 17:51:09 UTC
I fixed this upstream:

commit 7afbb90b4ddfa449e4efc2d57e726d477f96637b (HEAD -> master)
Author: Cole Robinson <crobinso>
Date:   Thu Mar 21 13:34:52 2019 -0400

    virt-xml: Handle VM names that look like id/uuid (bz 1679025)


However this is a very much a corner case. I don't think we need to explicitly track it through the RHEL process. It will be fixed in 8.1 when we rebase. So I'm moving this to the upstream tracker and closing it UPSTREAM

Comment 3 Cole Robinson 2019-03-21 17:53:44 UTC
*** Bug 1679026 has been marked as a duplicate of this bug. ***


Note You need to log in before you can comment on or make changes to this bug.