Displaying 20 results from an estimated 51 matches for "virconnectclose".
2011 Aug 16
1
Detecting the last user of a connection has closed.
The documentation says something that concerns me:
http://libvirt.org/html/libvirt-libvirt.html#virConnectClose
"It is possible for the last
virConnectClose<http://libvirt.org/html/libvirt-libvirt.html#virConnectClose>to
return a positive value if some
other object still has a temporary reference to the connection, but
the
application should not try to further use a connecti...
2017 Aug 22
0
virConnectClose
libvirt
version: 3.4.0
When invoke virConnectDomainEventRegisteAny register event on a hypervisor connection, before virConnecClose, should I invoke virConnectDomainEventDeregisterAny. If a hypervisor connection close unexpected, call virConnectDomainEventDeregisterAny will return error? Can tell me more detail about event? This libvirt doc not more description.
Thanks
2013 Apr 09
2
fail to convert qemu xml to args with libvirt-1.0.4: An error occurred, but the cause is unknown
...47.297+0000: 2669: debug : virNetMessageFree:73 : msg=0x10087500 nfds=0 cb=(nil)
2013-04-09 03:23:47.297+0000: 2670: debug : virEventPollDispatchHandles:470 : Dispatch 1
2013-04-09 03:23:47.297+0000: 2670: debug : virEventPollDispatchHandles:484 : i=0 w=1
2013-04-09 03:23:47.297+0000: 2669: debug : virConnectClose:1483 : conn=0x100878b8
<cut>
2) libvirt-1.0.4
<cut>
2013-04-09 03:07:58.012+0000: 2834: debug : virEventPollInterruptLocked:716 : Interrupting
2013-04-09 03:07:58.012+0000: 2834: debug : virNetClientIO:1810 : All done with our call head=(nil) call=0x10089db8 rv=0
2013-04-09 03:07:58.01...
2017 Sep 08
2
[PATCH] RFC: v2v: add and use libvirt connection objects
...gt;
@@ -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 = {
+ (char *) "libvirtconn_custom_operations",
+ libvirtconn_finalize,
+ custom_compare_default,
+ custom_hash_default,
+ custom_serialize_default,
+ custom_deserialize_default
+};
+
+static value
+Val_libvirtconn (vir...
2019 Apr 08
0
[PATCH v4 3/7] v2v: switch to ocaml-libvirt
...find libvirt pool ‘%s’: %s\n\nUse ‘virsh pool-list --all’ to list all available pools, and ‘virsh pool-dumpxml <pool>’ to display details about a particular pool.\n\nTo set the pool which virt-v2v uses, add the ‘-os <pool>’ option."),
- poolname, err->message);
- virConnectClose (conn);
- caml_invalid_argument (errmsg);
- }
-
- CAMLreturnT (virStoragePoolPtr, pool);
-}
-
-value
-v2v_dumpxml (value passwordv, value connv, value domnamev)
-{
- CAMLparam3 (passwordv, connv, domnamev);
- CAMLlocal1 (retv);
- const char *password = NULL;
- const char *conn_uri = NULL;...
2017 Mar 23
2
[PATCH] p2v: Use lscpu instead of libvirt to get CPU information.
...gnore errors; setting it to NULL
- * restores the default error handler ...
- */
- virConnSetErrorFunc (conn, NULL, ignore_errors);
-
- capabilities_xml = virConnectGetCapabilities (conn);
- if (!capabilities_xml) {
- libvirt_error (_("could not get libvirt capabilities"));
- virConnectClose (conn);
- return;
- }
-
- /* Parse the capabilities XML with libxml2. */
- doc = xmlReadMemory (capabilities_xml, strlen (capabilities_xml),
- NULL, NULL, XML_PARSE_NONET);
- if (doc == NULL) {
- fprintf (stderr,
- _("%s: unable to parse capabilities...
2011 Aug 17
0
segfault while unloading libvirt provider.
I have a CIM provider that just calls virConnectOpen("qemu:///system"); and
virConnectClose(). When cimom unloads this provider segfaults -
#0 0x000000305b420cd0 in ?? ()
(gdb) bt
#0 0x000000305b420cd0 in ?? ()
#1 0x00000031a3e05ad9 in __nptl_deallocate_tsd ()
from /lib64/libpthread.so.0
#2 0x00000031a3e0674b in start_thread () from /lib64/libpthread.so.0
#3 0x00000031a32d3d1d in cl...
2012 Jun 14
0
can not connect hypervisor using libvirt-0.9.11 on windows
...#include "libvirt/libvirt.h"
int main(int argc,char **argv)
{
virConnectPtr conn;
conn = virConnectOpen("qemu+tcp://192.168.1.6/system");
if (conn = NULL)
{
fprintf(stderr,"Failed to open connection to qemu+tcp://192.168.1.6/system");
return 1;
}
virConnectClose(conn);
return 0;
}
When linked to the dll just compiled , it came out with error :
NOTE: you should run 'diskperf -y' to enable the disk statistics
libvir: RPC error : Unable to set close-on-exec flag: No such file or directory
libvir: error : invalid connection pointer in virConnectC...
2016 Jul 24
2
Lifecycle of a connection to libvirtd
...to reliably maintain a connection to
libvirtd. From the documentation, I would expect something like that:
- virConnectOpen()
- virConnectRegisterCloseCallback()
- virConnectSetKeepAlive()
- Application logic
And in the registered callback, I would:
- virConnectUnregisterCloseCallback()
- virConnectClose()
- virConnectOpen()
- virConnectRegisterCloseCallback()
- virConnectSetKeepAlive()
However, looking at the source code of virsh, I see that it additional
stuff, notably:
- virConnectIsAlive()
- checking error codes of all calls to check if they are the result of
a disconnect
Are those s...
2015 May 05
2
[PATCH 0/2] v2v: -o libvirt: Check if the domain exists on the target (RHBZ#889082).
https://bugzilla.redhat.com/show_bug.cgi?id=889082
2016 Jan 19
2
[PATCH libguestfs v3] lib: Handle slow USB devices more gracefully.
...Y_GRACEFUL" : "0");
- if (virDomainDestroyFlags (dom, flags) == -1) {
- libvirt_error (g, _("could not destroy libvirt domain"));
- ret = -1;
- }
+ ret = destroy_domain (g, dom, check_for_errors);
virDomainFree (dom);
}
-
if (conn != NULL)
virConnectClose (conn);
@@ -2068,6 +2062,37 @@ shutdown_libvirt (guestfs_h *g, void *datav, int check_for_errors)
return ret;
}
+/* Wrapper around virDomainDestroy which handles errors and retries.. */
+static int
+destroy_domain (guestfs_h *g, virDomainPtr dom, int check_for_errors)
+{
+ const int flags...
2011 Dec 13
1
Thread-safety issues with vbox driver ?
...&attr, PTHREAD_CREATE_JOINABLE);
for (i = 0 ; i < count ; ++i) {
pthread_create(&threads[i], &attr, create_and_destroy, (void *)doms[i]);
}
pthread_attr_destroy(&attr);
for (i = 0 ; i < count ; ++i) {
pthread_join(threads[i], NULL);
}
virConnectClose(conn);
pthread_exit(NULL);
}
/************************************************/
Here is the output of the program with 2 defined domains:
> libvir: VBOX error : operation failed: OpenRemoteSession/LaunchVMProcess failed, domain can't be started
> failed to start c538c89a-70da-42ab-a...
2017 Mar 17
7
[PATCH v2 0/6] v2v: Pass CPU vendor, model and topology from source to target.
v1 -> v2:
- Support for passing topology through -o glance.
- Support for passing topology through -o rhv.
- Use bool for acpi/apic/pae struct fields in virt-p2v.
- Write the xpath expression in error messages instead of file/line.
- Fix more memory leaks in virt-p2v cpuid.c.
- Passes make check & check-valgrind.
There may be some other minor changes. I believe that everything
2010 Apr 15
1
[PATCH matahari] Refactored the Host agent.
...GetType(connection);
+ if (hv != NULL)
+ management_object->set_hypervisor(hv);
+ ret = virNodeGetInfo(connection, &info);
+ if (ret == 0) {
+ management_object->set_arch(info.model);
+ management_object->set_memory(info.memory);
+ }
}
+ virConnectClose(connection);
- output << "End Node" << endl;
- return output;
-}
+ management_object->set_beeping(false);
-void HostWrapper::doLoop(void)
-{
- // Someday we might update statistics too!
- while(1)
+ // setup the nic objects
+ for(vector<NICWrappe...
2016 Jan 29
0
[PATCH 5/6] launch: libvirt: cleanup sockets on shutdown
..."%s/console.sock", g->tmpdir);
- unlink (data->console_path);
console_sock = socket (AF_UNIX, SOCK_STREAM|SOCK_CLOEXEC, 0);
if (console_sock == -1) {
@@ -2027,6 +2025,16 @@ shutdown_libvirt (guestfs_h *g, void *datav, int check_for_errors)
if (conn != NULL)
virConnectClose (conn);
+ if (data->guestfsd_path[0] != '\0') {
+ unlink (data->guestfsd_path);
+ data->guestfsd_path[0] = '\0';
+ }
+
+ if (data->console_path[0] != '\0') {
+ unlink (data->console_path);
+ data->console_path[0] = '\0';
+ }
+
d...
2016 Jul 25
0
Re: Lifecycle of a connection to libvirtd
...bvirtd. From the documentation, I would expect something like that:
>
> - virConnectOpen()
> - virConnectRegisterCloseCallback()
> - virConnectSetKeepAlive()
> - Application logic
>
>And in the registered callback, I would:
>
> - virConnectUnregisterCloseCallback()
> - virConnectClose()
> - virConnectOpen()
> - virConnectRegisterCloseCallback()
> - virConnectSetKeepAlive()
>
>However, looking at the source code of virsh, I see that it additional
>stuff, notably:
>
> - virConnectIsAlive()
> - checking error codes of all calls to check if they are the re...
2016 Aug 03
0
Crash after connection close when callback is in progress
..."<os><type>hvm</type> </os>"
"</domain>");
assert(dom != NULL);
assert(virDomainCreate(dom) != -1);
virDomainFree(dom);
assert(virConnectDomainEventDeregisterAny(conn, cbid) != -1);
if (virConnectClose(conn) > 0 ) {
printf("leak...\n");
}
usleep(100000);
return 0;
}
#+end_src
Running this program in an infinite loop triggers the bug in less than 1
second (most of the time, just after displaying "leak...").
I am using libvirt 2.0.0 (in Debian). I have a...
2010 Dec 31
1
livemigrate problems
...rk delete 8 14
17:07:55.893: debug : virEventInterruptLocked:635 : Skip interrupt, 1 -793020736
17:07:55.893: debug : qemudDispatchClientFailure:1407 : Deregistering to relay remote events
17:07:55.893: debug : virConnectDomainEventDeregister:7760 : conn=0xe60c3a0, cb=0x4143d0
17:07:55.893: debug : virConnectClose:1171 : conn=0xe60c3a0
17:07:55.893: debug : virUnrefConnect:210 : unref connection 0xe60c3a0 1
17:07:55.893: debug : virReleaseConnect:171 : release connection 0xe60c3a0
17:07:55.893: debug : virEventMakePollFDs:364 : Prepare n=0 w=1, f=5 e=1
17:07:55.893: debug : virEventMakePollFDs:364 : Prepare...
2016 Jan 19
0
Re: [PATCH libguestfs v3] lib: Handle slow USB devices more gracefully.
...irDomainDestroyFlags (dom, flags) == -1) {
> - libvirt_error (g, _("could not destroy libvirt domain"));
> - ret = -1;
> - }
> + ret = destroy_domain (g, dom, check_for_errors);
> virDomainFree (dom);
> }
> -
> if (conn != NULL)
> virConnectClose (conn);
>
> @@ -2068,6 +2062,37 @@ shutdown_libvirt (guestfs_h *g, void *datav, int check_for_errors)
> return ret;
> }
>
> +/* Wrapper around virDomainDestroy which handles errors and retries.. */
> +static int
> +destroy_domain (guestfs_h *g, virDomainPtr dom, int...
2010 Nov 14
2
java binding and virtualbox-ose
...37:18.673: debug : virDomainFree:2062 : domain=0x95dad48
11:37:18.673: debug : virUnrefDomain:422 : unref domain 0x95dad48 tty 1
11:37:18.673: debug : virReleaseDomain:376 : release domain 0x95dad48 tty
11:37:18.673: debug : virReleaseDomain:392 : unref connection 0x95a1910 2
11:37:18.673: debug : virConnectClose:1355 : conn=0x95a1910
11:37:18.673: debug : virUnrefConnect:259 : unref connection 0x95a1910 1
11:37:18.673: debug : vboxNetworkClose:5448 : network uninitialized
11:37:18.673: debug : vboxStorageClose:6200 : vbox storage uninitialized
11:37:18.673: debug : vboxClose:843 : VBOX: in vboxClose
11:37:...