[libvirt] RFC: virsh: add support for redirecting output to files in virsh shell

Eric Blake eblake at redhat.com
Mon Dec 2 17:01:58 UTC 2013


On 11/30/2013 12:00 PM, Nehal J Wani wrote:
> Currently, for redirecting output (most of the times its the output of
> --dumpxml) we use:
> virsh $command > $file
> But such redirection is not possible in virsh shell. It would be great
> if libvirt supported this feature for those who love working in the
> 'virsh shell' (instead of typing 'virsh' before every command).
> 
> A simple approach would be to either add the redirection feature using
> '>' or having some option like -o or --outfile (it would be nice if it
> is available for each command, and not just restricted to --dumpxml
> ones)

Sure - sounds like a welcome addition.  Also useful would be supporting
'-' as a synonym for reading from stdin instead of a file name (as in
'virsh dumpxml | some modification script | virsh define -'; but also
usable from 'virsh' batch mode so that you can do 'define -' and then
just type your definition inline).

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 621 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20131202/5c6fdde7/attachment-0001.sig>


More information about the libvir-list mailing list