Bug 529817 - RFE: virsh: add options for machine readable output
Summary: RFE: virsh: add options for machine readable output
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Virtualization Tools
Classification: Community
Component: libvirt
Version: unspecified
Hardware: All
OS: Linux
low
medium
Target Milestone: ---
Assignee: Libvirt Maintainers
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks: libvirtTodoTools
TreeView+ depends on / blocked
 
Reported: 2009-10-20 08:49 UTC by Alexander Todorov
Modified: 2016-03-21 06:48 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-03-21 06:48:08 UTC
Embargoed:


Attachments (Terms of Use)

Description Alexander Todorov 2009-10-20 08:49:04 UTC
Description of problem:
Virsh does not produce machine readable output for other tools/applications to consume. A --colon or --csv switch will solve the issue. For example some lvm tools(lvdisplay) separate output by colon while other tools use the csv option. 

IRC quote:
(11,41,45) rjones: atodorov, definitely I agree with you ... in the virt tools I write, I'm using the --csv option to generate CSV output (eg. see virt-df)

Looks like --csv is preferred to make it consistent across all tools. 

Version-Release number of selected component (if applicable):
libvirt-0.6.3-20.el5 (but the RFE is valid for all later vesions)

How reproducible:
Always

Additional info:
I'm personally interested in the virsh list command because I'm using bash but this RFE should be implemented for all commands if possible.

Comment 1 Daniel Veillard 2009-10-20 14:14:59 UTC
just a note that "for all commands if possible" won't be possible for XML dump
commands. --csv patches welcome they should just be sent upstream to 
  libvir-list

Daniel

Comment 2 Pavel Hrdina 2016-03-21 06:48:08 UTC
I don't think that virsh is a correct tool to do that.  Virsh is a CLI for users, not for programs and if someone wants to use libvirt in his program, he should use one of our API.  For scripting probably the best one is libvirt-python.


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