[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: [libvirt] [RFC PATCH 1/4] libvirt: add VIR_DOMAIN_START_PERSISTENT flag



On Fri, Feb 22, 2013 at 11:48 AM, Daniel P. Berrange
<berrange redhat com> wrote:
> On Fri, Feb 22, 2013 at 11:40:32AM -0600, Doug Goldstein wrote:
>> Added a VIR_DOMAIN_START_PERSISTENT flag for virDomainCreateXML() so
>> that the guest remains defined after it is destroyed. The result of
>> using this flag is equivilent to calling virDomainDefineXML() followed
>> by virDomainCreate() or virDomainCreateWithFlags().
>> ---
>>
>> Not sure if this is the correct place to add "Since 1.0.3 (likely 1.0.4)"
>>
>> ---
>>  include/libvirt/libvirt.h.in | 1 +
>>  src/libvirt.c                | 4 ++++
>>  2 files changed, 5 insertions(+)
>>
>> diff --git a/include/libvirt/libvirt.h.in b/include/libvirt/libvirt.h.in
>> index ad30cd0..e119215 100644
>> --- a/include/libvirt/libvirt.h.in
>> +++ b/include/libvirt/libvirt.h.in
>> @@ -336,6 +336,7 @@ typedef enum {
>>      VIR_DOMAIN_START_AUTODESTROY  = 1 << 1, /* Automatically kill guest when virConnectPtr is closed */
>>      VIR_DOMAIN_START_BYPASS_CACHE = 1 << 2, /* Avoid file system cache pollution */
>>      VIR_DOMAIN_START_FORCE_BOOT   = 1 << 3, /* Boot, discarding any managed save */
>> +    VIR_DOMAIN_START_PERSISTENT   = 1 << 4, /* Define guest to exist after it is destroyed */
>>  } virDomainCreateFlags;
>
> As previously discussed, I'm against including this in the API
> because it doesn't offer anything that can't already be done
> with the existing APIs. Indeed this is worse than the existing
> APIs because this has only been wired up for the QEMU driver
> and none others. It also increases the size of the code and
> thus maintenance work for each driver for no feature gain.
>
> By all means add the flags to virsh, but they can be done
> using the existing APIs IMHO.
>
> Daniel
> --
> |: http://berrange.com      -o-    http://www.flickr.com/photos/dberrange/ :|
> |: http://libvirt.org              -o-             http://virt-manager.org :|
> |: http://autobuild.org       -o-         http://search.cpan.org/~danberr/ :|
> |: http://entangle-photo.org       -o-       http://live.gnome.org/gtk-vnc :|


So I'm happy with any way that's accepted. I implemented it this way
based on Eric's feedback in
https://www.redhat.com/archives/libvir-list/2013-January/msg00554.html

I was really just looking for a friendly way to do:
$ virsh define --start domain.xml

I can stick with my current solution if that's preferred, which is to
have a bash function:
function virshdefstart() {
  virsh define $1 && virsh start $1
}

-- 
Doug Goldstein


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]