RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1633077 - domxml-to-native should treat --xml as the default option
Summary: domxml-to-native should treat --xml as the default option
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: libvirt
Version: 7.6
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: rc
: ---
Assignee: Jiri Denemark
QA Contact: Lili Zhu
URL:
Whiteboard:
Depends On:
Blocks: 1634769 1651787
TreeView+ depends on / blocked
 
Reported: 2018-09-26 07:08 UTC by Lili Zhu
Modified: 2019-08-06 13:14 UTC (History)
7 users (show)

Fixed In Version: libvirt-4.5.0-12.el7
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
: 1634769 (view as bug list)
Environment:
Last Closed: 2019-08-06 13:14:02 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2019:2294 0 None None None 2019-08-06 13:14:45 UTC

Description Lili Zhu 2018-09-26 07:08:48 UTC
Description of problem:
improve the doc about domxml-to-native

Version-Release number of selected component (if applicable):
libvirt-4.5.0-10.el7.x86_64

How reproducible:
100%

Steps to Reproduce:
1. check the manual of domxml-to-native
# man virsh
 domxml-to-native format { [--xml] xml | --domain domain-name-or-id-or-uuid }

2. check the help info 
# virsh domxml-to-native --help
  NAME
    domxml-to-native - Convert domain XML to native config

3. convert the file xml into domain XML format
# virsh domxml-to-native qemu-argv avocado-vt-vm1.xml
error: failed to get domain 'avocado-vt-vm1.xml'
error: Domain not found: no domain with matching name 'avocado-vt-vm1.xml'


Actual results:
Now without flag "--xml", virsh will parse the argument as domain-name-or-id-or-uuid by default.

Expected results:
If it is designed like this, please improve the doc. Since it is just opposite to the case in RHEL7.5, refer to the Additional info.


Additional info:
In rhel7.5, it can work well without flag "--xml"
# virsh domxml-to-native qemu-argv /root/avocado-vt-vm1.xml
LC_ALL=C PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin QEMU_AUD....

# virsh domxml-to-native qemu-argv avocado-vt-vm1
error: Failed to open file 'avocado-vt-vm1': No such file or directory

Comment 3 Jiri Denemark 2018-09-26 07:44:58 UTC
Broken by the completer code:

commit d86531daf2747acba21556ab0aa6a3d6861b600e
Refs: v4.3.0-127-gd86531daf2
Author:     Lin Ma <lma>
AuthorDate: Tue May 8 22:20:33 2018 +0800
Commit:     Michal Privoznik <mprivozn>
CommitDate: Thu May 10 09:21:13 2018 +0200

	virsh: Apply macro for current VSH_OT_STRING "domain" options

    These VSH_OT_STRING "domain" options support domain name completion now.

    Signed-off-by: Lin Ma <lma>

Comment 5 Jiri Denemark 2018-09-26 08:03:51 UTC
Patch sent upstream for review: https://www.redhat.com/archives/libvir-list/2018-September/msg01334.html

Comment 6 Jiri Denemark 2018-09-26 16:14:49 UTC
Fixed upstream by

commit b7ccd0757de73344a4b973ede946dad40de846c7
Refs: v4.8.0-rc1-3-gb7ccd0757d
Author:     Jiri Denemark <jdenemar>
AuthorDate: Wed Sep 26 09:59:08 2018 +0200
Commit:     Jiri Denemark <jdenemar>
CommitDate: Wed Sep 26 17:22:38 2018 +0200

    virsh: Require explicit --domain for domxml-to-native

    The domxml-to-native virsh command accepts either --xml or --domain
    option followed by a file or domain name respectively. The --domain
    option is documented as required, which means an argument with no option
    is treated as --xml. Commit v4.3.0-127-gd86531daf2 broke this by making
    --domain optional and thus an argument with no option was treated as
    --domain.

    https://bugzilla.redhat.com/show_bug.cgi?id=1633077

    Signed-off-by: Jiri Denemark <jdenemar>

Comment 11 Lili Zhu 2019-04-09 03:42:44 UTC
Verify this bug with:
libvirt-4.5.0-12.el7.x86_64

verification steps:
1. convert the file xml into domain XML format
# virsh domxml-to-native qemu-argv avocado-vt-vm1.xml
LC_ALL=C PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin QEMU_AUDIO_DRV=spice /usr/libexec/qemu-kvm -name guest=avocado-vt-vm1,debug-threads=on ....

2. convert the file xml into domain XML format with --xml flag
# virsh domxml-to-native qemu-argv --xml avocado-vt-vm1.xml
LC_ALL=C PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin QEMU_AUDIO_DRV=spice /usr/libexec/qemu-kvm -name guest=avocado-vt-vm1,debug-threads=on...

3. covert the domain to native config without the --domian flag
# virsh domxml-to-native qemu-argv avocado-vt-vm1
error: Failed to open file 'avocado-vt-vm1': No such file or directory

4. covert the domain to native config with the --domain flag
# virsh domxml-to-native qemu-argv --domain avocado-vt-vm1 
LC_ALL=C PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin QEMU_AUDIO_DRV=spice /usr/libexec/qemu-kvm -name guest=avocado-vt-vm1,...

As the results match with the expected results, mark the bug as verified.

Comment 13 errata-xmlrpc 2019-08-06 13:14:02 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHSA-2019:2294


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