Displaying 20 results from an estimated 61 matches for "virerrorptr".
2013 Oct 14
2
event handler
good day to all.
i still have not solved my problem with event handling.
currently i have following code
void libvirt_eventloop_thr_func()
{
while(true) //TODO: stop somehow on exit
{
if(virEventRunDefaultImpl() < 0)
{
virErrorPtr err = virGetLastError();
fprintf(stderr, "Failed to run event loop: %s\n", err && err->message
? err->message : "Unknown error");
}
}
}
...
virSetErrorFunc(NULL, libvirt_error_handler);
libvirt_connection = virConnectOpen("qemu:///system");...
2013 Oct 14
2
Re: event handler
...m with event handling.
>> currently i have following code
>>
>>
>> void libvirt_eventloop_thr_func()
>> {
>> while(true) //TODO: stop somehow on exit
>> {
>> if(virEventRunDefaultImpl() < 0)
>> {
>> virErrorPtr err = virGetLastError();
>> fprintf(stderr, "Failed to run event loop: %s\n", err &&
>> err->message ? err->message : "Unknown error");
>> }
>> }
>> }
>>
>>
>>
>> ...
>>
>>...
2020 Apr 02
1
can libvirt.so use jemalloc to manage mem ?
...virEventPollUpdateHandle,
virEventPollRemoveHandle,
virEventPollAddTimeout,
virEventPollUpdateTimeout,
virEventPollRemoveTimeout);
return 0;
}
void
virResetLastError(void)
{
virErrorPtr err = virLastErrorObject();
if (err)
virResetError(err);
}
static virErrorPtr
virLastErrorObject(void)
{
virErrorPtr err;
err = virThreadLocalGet(&virLastErr);
if (!err) {
if (VIR_ALLOC_QUIET(err) < 0)
return NULL;
if (virThreadLocalSet...
2013 Oct 14
2
Re: event handler
...>>
>>>>
>>>> void libvirt_eventloop_thr_func()
>>>> {
>>>> while(true) //TODO: stop somehow on exit
>>>> {
>>>> if(virEventRunDefaultImpl() < 0)
>>>> {
>>>> virErrorPtr err = virGetLastError();
>>>> fprintf(stderr, "Failed to run event loop: %s\n", err &&
>>>> err->message ? err->message : "Unknown error");
>>>> }
>>>> }
>>>> }
>>>>
&g...
2016 Jan 19
2
[PATCH libguestfs v3] lib: Handle slow USB devices more gracefully.
...unch-libvirt.c
+++ b/src/launch-libvirt.c
@@ -25,6 +25,7 @@
#include <unistd.h>
#include <fcntl.h>
#include <grp.h>
+#include <errno.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <assert.h>
@@ -2015,6 +2016,8 @@ ignore_errors (void *ignore, virErrorPtr ignore2)
/* empty */
}
+static int destroy_domain (guestfs_h *g, virDomainPtr dom, int check_for_errors);
+
static int
shutdown_libvirt (guestfs_h *g, void *datav, int check_for_errors)
{
@@ -2023,23 +2026,14 @@ shutdown_libvirt (guestfs_h *g, void *datav, int check_for_errors)
virDomai...
2013 Feb 28
7
[PATCH 0/7] Fix SELinux security contexts so we can access shared disks (RHBZ#912499).
https://bugzilla.redhat.com/show_bug.cgi?id=912499
(especially comments 7 & 10)
This patch set is the final fix so that we can access disks in use by
other guests when SELinux and sVirt are enabled.
Previously such disks were inaccessible because sVirt labels the disks
with a random SELinux label to prevent other instances of qemu from
being able to read them. So naturally the libguestfs
2013 Aug 22
1
Re: virConnectDomainEventRegisterAny problem
...static int domain_event_handler(virConnectPtr conn, virDomainPtr dom,
int event, int detail, void * opaque)
{
std::cout<<"domain event handler called\n";
}
void libvirt_eventloop_thr_func()
{
while(true) //TODO: stop somehow on exit
{
if(virEventRunDefaultImpl() < 0)
{
virErrorPtr err = virGetLastError();
fprintf(stderr, "Failed to run event loop: %s\n", err &&
err->message ? err->message : "Unknown error");
}
}
}
....
virSetErrorFunc(NULL, libvirt_error_handler);
libvirt_connection = virConnectOpen("qemu:///system");
i...
2015 Sep 10
1
[PATCH] launch: libvirt: Better error when bridge / virbr0 doesn't exist (RHBZ#1262127).
...+++++++++++++++++++++++
1 file changed, 47 insertions(+)
diff --git a/src/launch-libvirt.c b/src/launch-libvirt.c
index 1c0bfac..d4c4c47 100644
--- a/src/launch-libvirt.c
+++ b/src/launch-libvirt.c
@@ -181,6 +181,7 @@ static int is_blk (const char *path);
static void ignore_errors (void *ignore, virErrorPtr ignore2);
static void set_socket_create_context (guestfs_h *g);
static void clear_socket_create_context (guestfs_h *g);
+static int check_bridge_exists (guestfs_h *g, const char *brname);
#if HAVE_LIBSELINUX
static void selinux_warning (guestfs_h *g, const char *func, const char *selinux_op,...
2013 Oct 14
0
Re: event handler
....
> i still have not solved my problem with event handling.
> currently i have following code
>
>
> void libvirt_eventloop_thr_func()
> {
> while(true) //TODO: stop somehow on exit
> {
> if(virEventRunDefaultImpl() < 0)
> {
> virErrorPtr err = virGetLastError();
> fprintf(stderr, "Failed to run event loop: %s\n", err &&
> err->message ? err->message : "Unknown error");
> }
> }
> }
>
>
>
> ...
>
> virSetErrorFunc(NULL, libvirt_error_ha...
2013 Oct 14
0
Re: event handler
...rrently i have following code
>>>
>>>
>>> void libvirt_eventloop_thr_func()
>>> {
>>> while(true) //TODO: stop somehow on exit
>>> {
>>> if(virEventRunDefaultImpl() < 0)
>>> {
>>> virErrorPtr err = virGetLastError();
>>> fprintf(stderr, "Failed to run event loop: %s\n", err &&
>>> err->message ? err->message : "Unknown error");
>>> }
>>> }
>>> }
>>>
>>>
>>>
&...
2013 Oct 14
0
Re: event handler
...>>>>> void libvirt_eventloop_thr_func()
>>>>> {
>>>>> while(true) //TODO: stop somehow on exit
>>>>> {
>>>>> if(virEventRunDefaultImpl() < 0)
>>>>> {
>>>>> virErrorPtr err = virGetLastError();
>>>>> fprintf(stderr, "Failed to run event loop: %s\n", err &&
>>>>> err->message ? err->message : "Unknown error");
>>>>> }
>>>>> }
>>>>> }...
2019 Apr 08
0
[PATCH v4 3/7] v2v: switch to ocaml-libvirt
....h>
-
-#include <libvirt/libvirt.h>
-#include <libvirt/virterror.h>
-
-#include "guestfs.h"
-#include "guestfs-utils.h"
-
-#pragma GCC diagnostic ignored "-Wmissing-prototypes"
-
-#define ERROR_MESSAGE_LEN 512
-
-static void
-ignore_errors (void *ignore, virErrorPtr ignore2)
-{
- /* empty */
-}
-
-/* Get the remote domain state (running, etc.). Use virDomainGetState
- * which is most efficient, but if it's not implemented, fall back to
- * virDomainGetInfo. See equivalent code in virsh.
- */
-static int
-get_dom_state (virDomainPtr dom)
-{
- int state,...
2016 Sep 20
1
[PATCH] libvirt: read disk paths from pools (RHBZ#1366049)
...name, void *data), void *data);
static int libvirt_selinux_label (guestfs_h *g, xmlDocPtr doc, char **label_rtn, char **imagelabel_rtn);
+static char *filename_from_pool (guestfs_h *g, virConnectPtr conn, const char *pool_nane, const char *volume_name);
static void
ignore_errors (void *ignore, virErrorPtr ignore2)
@@ -311,7 +312,7 @@ guestfs_impl_add_libvirt_dom (guestfs_h *g, void *domvp,
* all disks are added or none are added.
*/
ckp = guestfs_int_checkpoint_drives (g);
- r = for_each_disk (g, doc, add_disk, &data);
+ r = for_each_disk (g, virDomainGetConnect (dom), doc, add_disk...
2016 Jan 19
0
Re: [PATCH libguestfs v3] lib: Handle slow USB devices more gracefully.
...; @@ -25,6 +25,7 @@
> #include <unistd.h>
> #include <fcntl.h>
> #include <grp.h>
> +#include <errno.h>
> #include <sys/types.h>
> #include <sys/stat.h>
> #include <assert.h>
> @@ -2015,6 +2016,8 @@ ignore_errors (void *ignore, virErrorPtr ignore2)
> /* empty */
> }
>
> +static int destroy_domain (guestfs_h *g, virDomainPtr dom, int check_for_errors);
> +
> static int
> shutdown_libvirt (guestfs_h *g, void *datav, int check_for_errors)
> {
> @@ -2023,23 +2026,14 @@ shutdown_libvirt (guestfs_h *g, v...
2013 Jul 08
2
Re: deadlock on connection loosing
On 07.07.2013 01:53, Александр wrote:
> В письме от Воскресенье, 30-июн-2013 03:41:37 пользователь Александр написал:
>> В письме от Вторник, 25-июн-2013 11:47:10 пользователь Michal Privoznik
....
>
> i have found source of problem, my code looks like this:
>
> int count = virConnectListAllDomains(connection, NULL, 0);
> ....
> domain = virDomainDefineXML(connection,
2017 Sep 08
2
[PATCH] RFC: v2v: add and use libvirt connection objects
...lize_default
+};
+
+static value
+Val_libvirtconn (virConnectPtr conn)
+{
+ CAMLparam0 ();
+ CAMLlocal1 (rv);
+
+ rv = caml_alloc_custom (&custom_operations, sizeof (virConnectPtr), 0, 1);
+ Libvirtconn_val (rv) = conn;
+
+ CAMLreturn (rv);
+}
+
+
static void
ignore_errors (void *ignore, virErrorPtr ignore2)
{
@@ -111,11 +145,10 @@ libvirt_auth_default_wrapper (virConnectCredentialPtr cred,
}
}
-virStoragePoolPtr
+static virStoragePoolPtr
connect_and_load_pool (value connv, value poolnamev)
{
CAMLparam2 (connv, poolnamev);
- const char *conn_uri = NULL;
const char *poolname;...
2016 Jan 19
1
Re: [PATCH libguestfs v3] lib: Handle slow USB devices more gracefully.
...<unistd.h>
> > #include <fcntl.h>
> > #include <grp.h>
> > +#include <errno.h>
> > #include <sys/types.h>
> > #include <sys/stat.h>
> > #include <assert.h>
> > @@ -2015,6 +2016,8 @@ ignore_errors (void *ignore, virErrorPtr ignore2)
> > /* empty */
> > }
> >
> > +static int destroy_domain (guestfs_h *g, virDomainPtr dom, int check_for_errors);
> > +
> > static int
> > shutdown_libvirt (guestfs_h *g, void *datav, int check_for_errors)
> > {
> > @@ -2023,23...
2016 Sep 22
1
[PATCH v2] libvirt: read disk paths from pools (RHBZ#1366049)
...name, void *data), void *data);
static int libvirt_selinux_label (guestfs_h *g, xmlDocPtr doc, char **label_rtn, char **imagelabel_rtn);
+static char *filename_from_pool (guestfs_h *g, virConnectPtr conn, const char *pool_nane, const char *volume_name);
static void
ignore_errors (void *ignore, virErrorPtr ignore2)
@@ -311,7 +312,7 @@ guestfs_impl_add_libvirt_dom (guestfs_h *g, void *domvp,
* all disks are added or none are added.
*/
ckp = guestfs_int_checkpoint_drives (g);
- r = for_each_disk (g, doc, add_disk, &data);
+ r = for_each_disk (g, virDomainGetConnect (dom), doc, add_disk...
2018 Dec 06
0
[PATCH v2] Revert "launch: libvirt: Use qemu-bridge-helper to implement a full network (RHBZ#1148012)."
..._bridge;
char name[DOMAIN_NAME_LEN]; /* random name */
bool is_kvm; /* false = qemu, true = kvm (from capabilities)*/
struct version libvirt_version; /* libvirt version */
@@ -167,7 +166,6 @@ static int is_blk (const char *path);
static void ignore_errors (void *ignore, virErrorPtr ignore2);
static void set_socket_create_context (guestfs_h *g);
static void clear_socket_create_context (guestfs_h *g);
-static int check_bridge_exists (guestfs_h *g, const char *brname);
#if HAVE_LIBSELINUX
static void selinux_warning (guestfs_h *g, const char *func, const char *selinux_op,...
2018 Dec 06
2
[PATCH v2] Revert "launch: libvirt: Use qemu-bridge-helper to implement a full network (RHBZ#1148012)."
Let's actually compile and test the patch this time, rather than
trusting the RHEL 7.6 patch to apply directly to head ...
Rich.