[libvirt] [PATCH] virsh: Improve editing

Eric Blake eblake at redhat.com
Fri May 13 23:27:14 UTC 2011


On 05/13/2011 06:57 AM, Jiri Denemark wrote:
> On Fri, May 13, 2011 at 12:34:25 +0200, Michal Privoznik wrote:
>> When users (pool-/net-)edit and they make a mistake, temporary file
>> and thus all changes are gone. Better way is to let them decide if
>> they want to get back to edit and correct what's wrong.
>> However, this is suitable only in interactive mode.
>> ---
>>  tools/virsh.c |   42 ++++++++++++++++++++++++++++++++++++++++--
>>  1 files changed, 40 insertions(+), 2 deletions(-)
> 
> I like the idea (not sure if that's because I suggested it :-P) but, I have a
> few comments. The patch doesn't touch iface-edit, which is not generated from
> cmdEdit, though the right fix might turn out to be generating cmdIfaceEdit
> together with cmdPoolEdit and cmdNetworkEdit.
> 
> And IMHO *edit commands are always interactive even when not called in virsh
> interactive mode so I'd prefer this behaviour to be unconditional.

I don't know - I could see a semi-reasonable chance of scripting
'EDITOR=sed virsh edit < some_sed_script'.

> I can't
> imagine anyone sane to call virsh edit from a script, it's much easier to just
> call virsh dumpxml, change the xml and virsh define it back.

But you have a point here.

-- 
Eric Blake   eblake at redhat.com    +1-801-349-2682
Libvirt virtualization library http://libvirt.org

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


More information about the libvir-list mailing list