[virt-tools-list] [virt-manager PATCH] virt-install: add "-c" as short option of "--connect"
Martin Kletzander
mkletzan at redhat.com
Tue Feb 11 15:51:34 UTC 2014
On Tue, Feb 11, 2014 at 10:22:13PM +0800, Chen Hanxiao wrote:
>
>
> On 02/11/2014 09:04 PM, Cole Robinson wrote:
> > On 02/11/2014 01:58 AM, Chen Hanxiao wrote:
> >> From: Chen Hanxiao <chenhanxiao at cn.fujitsu.com>
> >>
> >> Add "-c" as short option of "--connect".
> >> Replace original "-c" as "-cd" for "--cdrom"
> >>
> >> This will be much convenient if we operate
> >> non-default hypervisor.
> >>
> >> Signed-off-by: Chen Hanxiao <chenhanxiao at cn.fujitsu.com>
> >> ---
> >> man/virt-install.pod | 2 +-
> >> man/virt-xml.pod | 2 +-
> >> virt-install | 7 ++-----
> >> virtinst/cli.py | 2 +-
> >> 4 files changed, 5 insertions(+), 8 deletions(-)
> >>
> >
> > This will break any pre-existing users of virt-install -c <cdrom>, so it's not
> > acceptable. We could make the -c shortcut available for the other tools, but
> > then things would be inconsistent. So I'd rather just leave it the way it is.
> >
>
> How about give --connect a shortcut?
> It's not so convenient if using virt-xml editing LXC domain.
>
I use the following approach, maybe it'll help you:
in '~/.config/libvirt/libvirt.conf' I have the address I use the most
from my user set as default:
uri_default = "qemu:///system"
and some aliases for other connections:
uri_aliases = [
'mg1=qemu+ssh://mg-host1/system',
'mg2=qemu+ssh://mg-host1/system',
...
Well, you get the idea. And for example instead of using 'virsh -c
lxc:///' all the time for lxc containers, I have an alias in
'~/.bashrc' or '~/.zshrc':
vlxc='virsh -c lxc:///'
This makes your life way easier and that sort of thing can be used for
virt-xml too ;-)
Hope this helps,
Martin
P.S.: In order to satisfy one friend of mine I have to mention that
creating a function instead of an alias should be way faster to use in
bash (the following example is not tested and typed by hand only):
vlxc() { virsh -c lxc:/// "$@"; }
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://listman.redhat.com/archives/virt-tools-list/attachments/20140211/7e7777d7/attachment.sig>
More information about the virt-tools-list
mailing list