Re: [libvirt-php] libvirt_domain_create_xml allow passing flags

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

 



On 11.01.2016 13:31, Vasiliy Tolstov wrote:
> libvirt_domain_create_xml miss ability to pass flags when create domain,
> fixing it.
> 
> Signed-off-by: Vasiliy Tolstov <v.tolstov@xxxxxxxxx>
> ---
>  src/libvirt-php.c | 13 +++++++++++--
>  1 file changed, 11 insertions(+), 2 deletions(-)
> 
> diff --git a/src/libvirt-php.c b/src/libvirt-php.c
> index f3b3f9f..39199da 100644
> --- a/src/libvirt-php.c
> +++ b/src/libvirt-php.c
> @@ -1274,6 +1274,14 @@ PHP_MINIT_FUNCTION(libvirt)
>      REGISTER_LONG_CONSTANT("VIR_SNAPSHOT_REVERT_PAUSED",    VIR_DOMAIN_SNAPSHOT_REVERT_PAUSED,      CONST_CS | CONST_PERSISTENT);
>      REGISTER_LONG_CONSTANT("VIR_SNAPSHOT_REVERT_FORCE",     VIR_DOMAIN_SNAPSHOT_REVERT_FORCE,       CONST_CS | CONST_PERSISTENT);
>  
> +    /* Create flags */
> +    REGISTER_LONG_CONSTANT("VIR_DOMAIN_NONE", VIR_DOMAIN_NONE, CONST_CS | CONST_PERSISTENT);
> +    REGISTER_LONG_CONSTANT("VIR_DOMAIN_START_PAUSED", VIR_DOMAIN_START_PAUSED, CONST_CS | CONST_PERSISTENT);
> +    REGISTER_LONG_CONSTANT("VIR_DOMAIN_START_AUTODESTROY", VIR_DOMAIN_START_AUTODESTROY, CONST_CS | CONST_PERSISTENT);
> +    REGISTER_LONG_CONSTANT("VIR_DOMAIN_START_BYPASS_CACHE", VIR_DOMAIN_START_BYPASS_CACHE, CONST_CS | CONST_PERSISTENT);
> +    REGISTER_LONG_CONSTANT("VIR_DOMAIN_START_FORCE_BOOT", VIR_DOMAIN_START_FORCE_BOOT, CONST_CS | CONST_PERSISTENT);
> +    REGISTER_LONG_CONSTANT("VIR_DOMAIN_START_VALIDATE", VIR_DOMAIN_START_VALIDATE, CONST_CS | CONST_PERSISTENT);
> +
>      /* Memory constants */
>      REGISTER_LONG_CONSTANT("VIR_MEMORY_VIRTUAL",        1, CONST_CS | CONST_PERSISTENT);
>      REGISTER_LONG_CONSTANT("VIR_MEMORY_PHYSICAL",       2, CONST_CS | CONST_PERSISTENT);
> @@ -5911,10 +5919,11 @@ PHP_FUNCTION(libvirt_domain_create_xml)
>      virDomainPtr domain=NULL;
>      char *xml;
>      int xml_len;
> +    long flags=0;
>  
> -    GET_CONNECTION_FROM_ARGS("rs",&zconn,&xml,&xml_len);
> +    GET_CONNECTION_FROM_ARGS("rs|l",&zconn,&xml,&xml_len,&flags);

I prefer space after comma.

>  
> -    domain=virDomainCreateXML(conn->conn,xml,0);
> +    domain=virDomainCreateXML(conn->conn,xml,flags);
>      DPRINTF("%s: virDomainCreateXML(%p, <xml>, 0) returned %p\n", PHPFUNC, conn->conn, domain);
>      if (domain==NULL) RETURN_FALSE;
>  
> 

ACKed and pushed.

Michal

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list



[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]