[Libvir] virsh list

John Levon levon at movementarian.org
Mon Mar 3 22:31:56 UTC 2008

On Mon, Mar 03, 2008 at 09:44:31PM +0000, Richard W.M. Jones wrote:

> > Am I the only one who finds the default behaviour of virsh list really
> > confusing and annoying? That is, I would like --all to be the default.
> Me too, but can we change it without breaking scripts or similar?

Well, you've hit upon a good question here. Is virsh interactive, or
scriptable? Within Sun we generally attempt to clearly delineate these
things, precisely for reasons like the above.

'virsh list' would have grown a '-p' option, that printed a
machine-parsable output. That way, you can change the human output as
needed (for example, you can translate 'blocked' into $LANG).

Anyway, in this case, I think fixing up virsh list would be less pain
than leaving it. Anything that's trying to parse human-readable output
needs to be written carefully. For example, I don't think you'd have the
same objection to adding a field to 'vcpuinfo', but that's just as
likely to break scripts. I'm happy to hear contradictory opinions :)

In the longer term it would be good to make sure all new commands have
the above considerations when reviewing the visible CLI. Perhaps we can
go back and add -p options to things as appropriate too.


More information about the libvir-list mailing list