Bug 835476
Summary: | RFE: virsh: add domxml-to-native --domain option (for existing VM) | ||
---|---|---|---|
Product: | [Community] Virtualization Tools | Reporter: | David Jaša <djasa> |
Component: | libvirt | Assignee: | Libvirt Maintainers <libvirt-maint> |
Status: | CLOSED CURRENTRELEASE | QA Contact: | |
Severity: | unspecified | Docs Contact: | |
Priority: | unspecified | ||
Version: | unspecified | CC: | crobinso, jtomko, kkoukiou, rbalakri, srwx4096 |
Target Milestone: | --- | ||
Target Release: | --- | ||
Hardware: | Unspecified | ||
OS: | Unspecified | ||
Whiteboard: | LibvirtFirstBug | ||
Fixed In Version: | Doc Type: | Bug Fix | |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | 2018-06-07 08:17:41 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: | |
Embargoed: |
Description
David Jaša
2012-06-26 09:53:50 UTC
(In reply to comment #0) > Description of problem: > The only way to get e.g. qemu command line directly from existing domain is > this ugly command: > virsh dumpxml winxp | virsh domxml-to-native qemu-argv /dev/stdin That's not the right way to get the qemu command line. The qemu commandline that was executed for a running domain is logged into /var/log/libvirt/qemu/<domainname>.log (In reply to comment #2) > That's not the right way to get the qemu command line. The qemu commandline > that was executed for a running domain is logged into > /var/log/libvirt/qemu/<domainname>.log That's not good approach when you need to fine-tune domain xml to get desired resulting command line. I think adding an explicit option like 'virsh domxml-to-native --domain id|name|uuid' is a good idea. The command handling is in tools/virsh-domain.c cmdDomXMLToNative function. You'll want to add the common --domain option via VIRSH_COMMON_OPT_DOMAIN_FULL. If the explicit XML isn't passed, you'll need to fetch the XML via virDomainGetXMLDesc first. There were two different suggestions in this thread on how we would want to change the DOMAIN COMMAND "domxml-to-native". I need some guidance to help me make the decision. After looking through man page of "virsh", I think there could be two or three possible solutions with different flavor. 1. domxml-to-native <format> { --xml FILE | --domain DOMAIN }, where the usage of "--xml" is consistent with existing appearance in man-page of "virsh"; while introducing "--domain" is incoherent in that existing "virsh" man-page directly references <domain> wherever necessary without specifically mentioning with "--domain" prefix, which leading the second solution: 2. domxml-to-native <format> {FILE|DOMAIN}, which is compatible with existing command from user perspective, where we need to detect the input argument being either an XML file or a DOMAIN (domain id, uuid, or name). Just for the sake of practice, we could also have the following solution: 3. domxml-to-native <format> { [--xml] FILE | [--domain] DOMAIN }, in case someone really prefer to specify the input while also being compatible with existing style. Dan We cannot change the current command semantics, so mandating an explicit --xml option isn't an option. So the options are to make one of these two work: virsh domxml-to-native qemu-argv $domname virsh domxml-to-native qemu-argv --domain $domname I can't think of any commands that will take either a file path or domain name for a single field, seems kind of ambiguous. I suggest making the second example work. To make it work you may need to drop VSH_OPT_REQ flag for --xml, but fail in the code if xml or domain isn't specified Fixed upstream by: commit 41eb92783e831b9362c321bd563c6c4ec592eb3d Author: Daniel Liu <srwx4096> Date: Fri Jun 2 11:04:52 2017 -0400 virsh: add [--domain DOMAIN] option to domxml-to-native DOMAIN COMMAND git describe: v3.4.0-169-g41eb92783e |