search for: virconnectptr

Displaying 20 results from an estimated 88 matches for "virconnectptr".

2017 Oct 17
2
virConnectIsAlive
Hi In my program , When libvirtd restart , the old libvirtd connection(virConnectPtr) has to reconnect, Before usr old virConnectPtr , I call virConnectIsAlive. but when I restart libvirtd , virConnectIsAlive return 1, and I continue other operate use the old virConnectPtr, program will receive signal pipe. I use libvirt event. before any api use, I call virEventRegisterDefault...
2016 Sep 20
1
[PATCH] libvirt: read disk paths from pools (RHBZ#1366049)
...<source pool='pool_name' volume='volume_name'/> and its real location is inside the 'volume_name', as 'pool_name': in this case, query libvirt for the actual path of the specified volume in the specified pool. Adjust the code so that: - for_each_disk gets the virConnectPtr, needed to do operations with libvirt - when extracting the disk filename depending on the type, the code snippet doing it can directly set 'filename', without setting an XPath result variable Only file-based volumes are supported for now; more types can be added (with proper testing...
2015 Apr 27
2
[Libvirt Users]how to provide password authentication for qemu driver
Dell Customer Communication Hi All, I am using Compiled against library: libvirt 1.2.9 Using library: libvirt 1.2.9 Using API: QEMU 1.2.9 Running hypervisor: QEMU 2.1.2 I want user to provide username and password authentication to virConnectPtr virConnectOpenAuth(const char *name, virConnectAuthPtr auth, unsigned int flags) to login remotely for the qemu hypervisor. But it is not taking user provided username and driver. Because internally it is calling below qemu driver function, static virDrvOpen...
2011 Sep 23
1
The Format Of URI when Migrating
Hi, when I try to use such API: virDomainPtr <http://www.libvirt.org/html/libvirt-libvirt.html#virDomainPtr> virDomainMigrate (virDomainPtr <http://www.libvirt.org/html/libvirt-libvirt.html#virDomainPtr> domain, virConnectPtr <http://www.libvirt.org/html/libvirt-libvirt.html#virConnectPtr> dconn, unsigned long flags, const char * dname, const char * uri, unsigned long bandwidth) to achieve the domain to the remote host. I set the "const char * uri" as "qemu+ssh://root at 116....
2016 Sep 22
1
[PATCH v2] libvirt: read disk paths from pools (RHBZ#1366049)
...<source pool='pool_name' volume='volume_name'/> and its real location is inside the 'volume_name', as 'pool_name': in this case, query libvirt for the actual path of the specified volume in the specified pool. Adjust the code so that: - for_each_disk gets the virConnectPtr, needed to do operations with libvirt - when extracting the disk filename depending on the type, the code snippet doing it can directly set 'filename', without setting an XPath result variable Only file-based volumes are supported for now; more types can be added (with proper testing...
2016 Nov 16
3
[PATCH 1/2] libvirt: un-duplicate XPath code
...sertions(+), 72 deletions(-) diff --git a/src/libvirt-domain.c b/src/libvirt-domain.c index 4d4142d..baab307 100644 --- a/src/libvirt-domain.c +++ b/src/libvirt-domain.c @@ -43,6 +43,8 @@ static xmlDocPtr get_domain_xml (guestfs_h *g, virDomainPtr dom); static ssize_t for_each_disk (guestfs_h *g, virConnectPtr conn, xmlDocPtr doc, int (*f) (guestfs_h *g, const char *filename, const char *format, int readonly, const char *protocol, char *const *server, const char *username, void *data), void *data); static int libvirt_selinux_label (guestfs_h *g, xmlDocPtr doc, char **label_rtn, char **imagelabel_rtn);...
2010 Aug 20
0
libvirt support spice protocol
...; break; + + case VIR_DOMAIN_GRAPHICS_TYPE_SPICE: + VIR_FREE(def->data.spice.listenAddr); + VIR_FREE(def->data.spice.keymap); + VIR_FREE(def->data.spice.passwd); + break; } VIR_FREE(def); @@ -1692,6 +1699,38 @@ virDomainGraphicsDefParseXML(virConnectPtr conn, def->data.desktop.fullscreen = 0; def->data.desktop.display = virXMLPropString(node, "display"); + } else if (def->type == VIR_DOMAIN_GRAPHICS_TYPE_SPICE) { + char *port = virXMLPropString(node, "port"); + char *tlsPort; + +...
2017 Sep 08
2
[PATCH] RFC: v2v: add and use libvirt connection objects
.../libvirt_utils-c.c @@ -31,6 +31,7 @@ #include <libintl.h> #include <caml/alloc.h> +#include <caml/custom.h> #include <caml/fail.h> #include <caml/memory.h> #include <caml/mlvalues.h> @@ -49,6 +50,39 @@ #define ERROR_MESSAGE_LEN 512 +/* Wrap and unwrap virConnectPtr, with a finalizer. */ +#define Libvirtconn_val(rv) (*(virConnectPtr *)Data_custom_val(rv)) + +static void +libvirtconn_finalize (value rev) +{ + virConnectPtr conn = Libvirtconn_val (rev); + if (conn) + virConnectClose (conn); +} + +static struct custom_operations custom_operations = { + (cha...
2013 Aug 20
2
virConnectDomainEventRegisterAny problem
...PGP SIGNED MESSAGE----- Hash: SHA1 good day. i trying to make callback function for VIR_DOMAIN_EVENT_ID_LIFECYCLE, i have successfully registering callback, but it never called, i need to know when domain started, stopped or crashed, i have write following code static int domain_event_handler(virConnectPtr conn, virDomainPtr dom, int event, int detail, void * opaque) { switch(event) { } return 0; } ..... int callback = virConnectDomainEventRegisterAny(libvirt_connection, NULL, VIR_DOMAIN_EVENT_ID_LIFECYCLE, VIR_DOMAIN_EVENT_CALLBACK(domain_event_handler), NULL, NULL);...
2013 Jun 24
3
deadlock on connection loosing
libvirtd will lock if for example kill programm which established connection, only sigkill + restart helps., to reproduce: virConnectPtr libvirt_connection = virConnectOpen("qemu:///system"); if(libvirt_connection == NULL) { std::cout<<"failed to connect to qemu:///system\n"; exit(-1); } exit(0);
2013 Aug 22
1
Re: virConnectDomainEventRegisterAny problem
...ccessfully >>>>>> registering callback, but it never called, i need to >>>>>> know when domain started, stopped or crashed, i have >>>>>> write following code >>>>>> >>>>>> static int domain_event_handler(virConnectPtr conn, >>>>>> virDomainPtr dom, int event, int detail, void * opaque) { >>>>>> switch(event) { } return 0; } >>>>>> >>>>>> ..... int callback = >>>>>> virConnectDomainEventRegisterAny(libvirt_connection, &g...
2013 Aug 21
2
Re: virConnectDomainEventRegisterAny problem
...gt;>> VIR_DOMAIN_EVENT_ID_LIFECYCLE, i have successfully registering > >>> callback, but it never called, i need to know when domain > >>> started, stopped or crashed, i have write following code > >>> > >>> static int domain_event_handler(virConnectPtr conn, > >>> virDomainPtr dom, int event, int detail, void * opaque) { > >>> switch(event) { } return 0; } > >>> > >>> ..... int callback = > >>> virConnectDomainEventRegisterAny(libvirt_connection, NULL, > >>> VIR_DOMAIN_E...
2019 Apr 08
0
[PATCH v4 2/7] common: Bundle the libvirt-ocaml library for use by virt-v2v
...$name =~ s/([A-Z][a-z]+|XML|URI|OS|UUID)/$1,/g; + my @subs = split (/,/, $name); + @subs = map { lc($_) } @subs; + join "_", @subs +} + +# Helper functions dealing with signatures. + +sub short_name_to_c_type +{ + local $_ = shift; + + if ($_ eq "conn") { "virConnectPtr" } + elsif ($_ eq "dom") { "virDomainPtr" } + elsif ($_ eq "net") { "virNetworkPtr" } + elsif ($_ eq "pool") { "virStoragePoolPtr" } + elsif ($_ eq "vol") { "virStorageVolPtr" } + elsif ($_ eq "...
2013 Aug 21
2
Re: virConnectDomainEventRegisterAny problem
...i trying to make callback function for >> VIR_DOMAIN_EVENT_ID_LIFECYCLE, i have successfully registering >> callback, but it never called, i need to know when domain >> started, stopped or crashed, i have write following code >> >> static int domain_event_handler(virConnectPtr conn, >> virDomainPtr dom, int event, int detail, void * opaque) { >> switch(event) { } return 0; } >> >> ..... int callback = >> virConnectDomainEventRegisterAny(libvirt_connection, NULL, >> VIR_DOMAIN_EVENT_ID_LIFECYCLE, >> VIR_DOMAIN_EVENT_CALLBACK(...
2019 Dec 16
3
[v2v PATCH 0/2] Move libvirt-ocaml copy to v2v repo
libvirt-ocaml is used only by virt-v2v, so move it to this repository, instead of having it around in the common submodule. The removal from common will happen later. Pino Toscano (2): common: Bundle the libvirt-ocaml library for use by virt-v2v build: switch embedded copy of libvirt-ocaml .gitignore | 2 + 3rdparty/libvirt-ocaml/Makefile.am |
2016 Nov 16
0
[PATCH 2/2] libvirt: read secrets of disks (RHBZ#1392798)
...t;base64.h" + #include "guestfs.h" #include "guestfs-internal.h" #include "guestfs-internal-actions.h" @@ -40,7 +42,7 @@ #if defined(HAVE_LIBVIRT) static xmlDocPtr get_domain_xml (guestfs_h *g, virDomainPtr dom); -static ssize_t for_each_disk (guestfs_h *g, virConnectPtr conn, xmlDocPtr doc, int (*f) (guestfs_h *g, const char *filename, const char *format, int readonly, const char *protocol, char *const *server, const char *username, void *data), void *data); +static ssize_t for_each_disk (guestfs_h *g, virConnectPtr conn, xmlDocPtr doc, int (*f) (guestfs_h *g, con...
2015 Apr 27
0
Re: [Libvirt Users]how to provide password authentication for qemu driver
...om wrote: > Dell Customer Communication > Hi All, > > I am using > > Compiled against library: libvirt 1.2.9 > Using library: libvirt 1.2.9 > Using API: QEMU 1.2.9 > Running hypervisor: QEMU 2.1.2 > > I want user to provide username and password authentication to virConnectPtr > virConnectOpenAuth(const char *name, > virConnectAuthPtr auth, > unsigned int flags) to login remotely for the qemu hypervisor. > > But it is not taking user provided username and driver. Because > internally it is calling below qemu drive...
2016 Aug 03
0
Crash after connection close when callback is in progress
...source code: #+begin_src c #include <stdio.h> #include <unistd.h> #include <assert.h> #include <pthread.h> #include <libvirt/libvirt.h> void* loop(void *arg) { while (1) { assert (virEventRunDefaultImpl() >= 0); } return NULL; } void callback(virConnectPtr conn, virDomainPtr dom, void *opaque) { // Do nothing. } void freecb(void *opaque) { // Do nothing. } int main() { assert(virInitialize() >= 0); assert(virEventRegisterDefaultImpl() >= 0); pthread_t event_loop; assert(pthread_create(&event_loop, NULL, loop, NULL...
2010 Jun 09
1
about virDomainSave and virDomainRestore
Hi there, There is some special reason to require a virConnectPtr param in virDomainRestore ? Regards, Camilo -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://listman.redhat.com/archives/libvirt-users/attachments/20100609/69932c54/attachment.htm>
2011 Nov 04
1
Event&Callback in QEMU
Hi buddy, I wanna to monitor a domain's life cycle event, so i register a event an a virConnectDomainEventCallback, the code segment is as below: ------------------------ int DomainEventCallback(virConnectPtr conn, virDomainPtr dom, int event, int detail, void * opaque){ /*My code */ ....... } int main(){ /* .....*/ virDomainPtr dom = domain.getDomains("xp"); virFreeCallback freecb = NULL; void *opaque =NULL; virConnectDomainEventCallback cb =Domai...