[libvirt] [PATCH] virsh: add aliases 'boot', 'stop', and 'restart'

Jiri Denemark jdenemar at redhat.com
Fri Nov 16 10:51:13 UTC 2012


On Thu, Nov 08, 2012 at 12:39:45 -0500, Laine Stump wrote:
> >> On Thu, Nov 08, 2012 at 03:24:07PM +0100, Daniel P. Berrange wrote:
> >>>
> >>> NACK to this patch. I think the current command names are good.
> >>> Creating duplicates will make life worse. First, it creates
> >>> divergance from the similarly named commands for networks,
> >>> storage and other objects. It also means scripts written again
> >>> the new commands will not work with existing libvirt.
> 
> I'm putting my vote with Dan on this (Just to be clear, my original
> message in this thread was written in the spirit of "well, if you're
> going to do this, then at least make sure what you're doing is
> explicitly documented").

Well, I'm with Dan and Laine on this. I think adding the alias for mistyped
commands was good since it made life easier for those who know what command
they want to use keep forgetting to mistype it in the same way. However, I
don't like the idea of adding synonyms for commands just because it seems
easier for someone to remember the synonyms. It may lead to confusion when
people are talking about the same thing but are used to different synonyms.
It also destroys consistency which we have now. And we are not going to
translate various commands into different languages either, are we?

However, if we wanted to still be nice to end users, we could implement
user-defined aliases for virsh. It would give users more power since commonly
used options could be aliased as well, e.g., someone always doing p2p live
migrations could setup an alias "lm" to be "migrate --p2p --live". And anyone
could make aliases to fit their needs. And I'm suggesting just a simple text
substitution that would just replace a recognized aliase at the beginning of a
command with the definition of the alias and just parse the result as if that
was what the user typed.

Jirka




More information about the libvir-list mailing list