[libvirt] [PATCH] virsh: add --start option to the define command

Doug Goldstein cardoe at gentoo.org
Mon Feb 18 05:11:37 UTC 2013


On Fri, Jan 11, 2013 at 2:51 PM, Guido Günther <agx at sigxcpu.org> wrote:
> On Tue, Jan 08, 2013 at 04:41:58PM -0700, Eric Blake wrote:
>> On 01/08/2013 02:36 PM, Doug Goldstein wrote:
>> > I often find myself doing virsh "define blah.xml; start blah". I figured
>> > adding this would be a easier^Hlazier way to do it.
>> > ---
>> >  tools/virsh-domain.c |   20 ++++++++++++++++++--
>> >  1 files changed, 18 insertions(+), 2 deletions(-)
>>
>> Offhand, I like it.  However,
>>
>> We have virDomainDefineXML with no flags, but we have virDomainCreateXML
>> with flags; maybe the better approach is to add a new creation flag that
>> says that in addition to starting the domain, we also make it persistent
>> at the same time.
>
>>
>> But if we do that, it would argue that 'virsh create --persistent
>> blah.xml' is nicer than 'virsh define --start blah.xml', at least in
>> that the former needs only 1 API call for new libvirt (but falls back to
>> 2 API calls when talking to older libvirt), while the latter always
>> needs 2 API calls.
>
> I like that since it would also remove some confusion about the
> diffference between create and define from an end user perspective.
> Cheers,
>  -- Guido

I'd like to still add "virsh define --start" in the end. Possibly when
--start is passed, virsh would actually call virDomainCreateXML(). My
feeling is that virsh started out really demoing the API but its
really a fundamental user tool now and we should strive to make it
friendly to use.

-- 
Doug Goldstein




More information about the libvir-list mailing list