[libvirt] [PATCH] virsh: Report name from edited object

There is a little easter egg in virsh: one can easily clone an object (domain, network, ...). Just 'virsh edit' change the name and remove <uuid>. And then, in the end when reporting success the new name was printed out. However, with recent edit rewrite we lost the final part and are still printing the original name out. --- Or even better - if name changes, we can choose better message, something like "New domain %s defined". But I am not sure we want to expose this easter egg to users. tools/virsh.c | 10 +++++----- 1 files changed, 5 insertions(+), 5 deletions(-) diff --git a/tools/virsh.c b/tools/virsh.c index 938f8c8..0b42f1a 100644 --- a/tools/virsh.c +++ b/tools/virsh.c @@ -8612,7 +8612,7 @@ cmdInterfaceEdit(vshControl *ctl, const vshCmd *cmd) #include "virsh-edit.c" vshPrint(ctl, _("Interface %s XML configuration edited.\n"), - virInterfaceGetName(iface)); + virInterfaceGetName(iface_edited)); ret = true; @@ -10006,7 +10006,7 @@ cmdNWFilterEdit(vshControl *ctl, const vshCmd *cmd) #include "virsh-edit.c" vshPrint(ctl, _("Network filter %s XML configuration edited.\n"), - virNWFilterGetName(nwfilter)); + virNWFilterGetName(nwfilter_edited)); ret = true; @@ -15811,7 +15811,7 @@ cmdEdit(vshControl *ctl, const vshCmd *cmd) #include "virsh-edit.c" vshPrint(ctl, _("Domain %s XML configuration edited.\n"), - virDomainGetName(dom)); + virDomainGetName(dom_edited)); ret = true; @@ -15883,7 +15883,7 @@ cmdNetworkEdit(vshControl *ctl, const vshCmd *cmd) #include "virsh-edit.c" vshPrint(ctl, _("Network %s XML configuration edited.\n"), - virNetworkGetName(network)); + virNetworkGetName(network_edited)); ret = true; @@ -15938,7 +15938,7 @@ cmdPoolEdit(vshControl *ctl, const vshCmd *cmd) #include "virsh-edit.c" vshPrint(ctl, _("Pool %s XML configuration edited.\n"), - virStoragePoolGetName(pool)); + virStoragePoolGetName(pool_edited)); ret = true; -- 1.7.8.5

On 06/14/2012 06:50 AM, Michal Privoznik wrote:
There is a little easter egg in virsh: one can easily clone an object (domain, network, ...). Just 'virsh edit' change the name and remove <uuid>. And then, in the end when reporting success the new name was printed out. However, with recent edit rewrite we lost the final part and are still printing the original name out. --- Or even better - if name changes, we can choose better message, something like "New domain %s defined". But I am not sure we want to expose this easter egg to users.
Yeah, I ran into some of that fun when implementing snapshot-edit. I think your patch goes far enough; printing the final name is good enough, without having to try and produce a smarter output message. ACK. -- Eric Blake eblake@redhat.com +1-919-301-3266 Libvirt virtualization library http://libvirt.org

On 14.06.2012 14:57, Eric Blake wrote:
On 06/14/2012 06:50 AM, Michal Privoznik wrote:
There is a little easter egg in virsh: one can easily clone an object (domain, network, ...). Just 'virsh edit' change the name and remove <uuid>. And then, in the end when reporting success the new name was printed out. However, with recent edit rewrite we lost the final part and are still printing the original name out. --- Or even better - if name changes, we can choose better message, something like "New domain %s defined". But I am not sure we want to expose this easter egg to users.
Yeah, I ran into some of that fun when implementing snapshot-edit.
I think your patch goes far enough; printing the final name is good enough, without having to try and produce a smarter output message.
ACK.
Thanks, pushed. Michal
participants (2)
-
Eric Blake
-
Michal Privoznik