[libvirt] [libvirt-glib] Correct gvir_storage_pool_get_volumes' return annotation
by Zeeshan Ali (Khattak)
From: "Zeeshan Ali (Khattak)" <zeeshanak(a)gnome.org>
---
libvirt-gobject/libvirt-gobject-storage-pool.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/libvirt-gobject/libvirt-gobject-storage-pool.c b/libvirt-gobject/libvirt-gobject-storage-pool.c
index 76970db..f46dc32 100644
--- a/libvirt-gobject/libvirt-gobject-storage-pool.c
+++ b/libvirt-gobject/libvirt-gobject-storage-pool.c
@@ -477,7 +477,7 @@ static void gvir_storage_vol_ref(gpointer obj, gpointer ignore G_GNUC_UNUSED)
* gvir_storage_pool_get_volumes:
* @pool: the storage pool
*
- * Return value: (element-type LibvirtGObject.StoragePool) (transfer full): List
+ * Return value: (element-type LibvirtGObject.StorageVol) (transfer full): List
* of #GVirStorageVol
*/
GList *gvir_storage_pool_get_volumes(GVirStoragePool *pool)
--
1.7.7.5
12 years, 11 months
[libvirt] Libvirt java from Windows
by Sergey Sudakovich (ssudakov)
I am writing a java based client that would be executed from windows
that will use libvirt.
1. Got libvirt-java (
http://libvirt.org/sources/java/libvirt-java-0.4.7.tar.gz) and build a
jar out it (ant with no params)
2. Then, according to http://libvirt.org/windows.html, built a dll
using the "MSYS build script"
3. Got 2 files libvirt-0.dll and libqemu-0.dll
When I run the sample example(from Eclipse) from
http://libvirt.org/java.html I get the following error:
Exception in thread "main" java.lang.UnsatisfiedLinkError: Unable to
load library 'virt': %1 is not a valid Win32 application.
at com.sun.jna.NativeLibrary.loadLibrary(NativeLibrary.java:169)
at com.sun.jna.NativeLibrary.getInstance(NativeLibrary.java:242)
at com.sun.jna.Library$Handler.<init>(Library.java:140)
at com.sun.jna.Native.loadLibrary(Native.java:368)
at com.sun.jna.Native.loadLibrary(Native.java:353)
at org.libvirt.jna.Libvirt.<clinit>(Unknown Source)
at org.libvirt.Connect.<clinit>(Unknown Source)
at Main.main(Main.java:26)
Also tried instead of step 2 cross compile in Fedora - same error
message when I use new dll's.
Does anybody have any idea where do I start fixing the issue??
--
Thank you,
Sergey Sudakovich
12 years, 11 months
[libvirt] [PATCH 0/2] helper functions for virTypedParameters
by Eric Blake
As hinted at here:
https://www.redhat.com/archives/libvir-list/2012-January/msg00019.html
Eric Blake (2):
util: add new file for virTypedParameter utils
util: use new virTypedParameter helpers
daemon/remote.c | 1 +
po/POTFILES.in | 1 +
src/Makefile.am | 3 +-
src/esx/esx_driver.c | 83 +++----
src/libvirt_private.syms | 20 +-
src/libxl/libxl_driver.c | 48 +---
src/lxc/lxc_driver.c | 218 +++++-----------
src/qemu/qemu_driver.c | 656 ++++++++++++++--------------------------------
src/test/test_driver.c | 29 +--
src/util/util.c | 16 +-
src/util/util.h | 4 +-
src/util/virtypedparam.c | 187 +++++++++++++
src/util/virtypedparam.h | 37 +++
src/xen/xen_hypervisor.c | 51 ++--
tools/virsh.c | 3 +-
15 files changed, 600 insertions(+), 757 deletions(-)
create mode 100644 src/util/virtypedparam.c
create mode 100644 src/util/virtypedparam.h
--
1.7.7.5
12 years, 11 months
[libvirt] [PATCH] virCPUDefCopy forgot to copy NUMA topology
by Jiri Denemark
As a result of it, guest NUMA topology would be lost during migration.
---
src/conf/cpu_conf.c | 21 +++++++++++++++++++++
1 files changed, 21 insertions(+), 0 deletions(-)
diff --git a/src/conf/cpu_conf.c b/src/conf/cpu_conf.c
index 2882389..348299b 100644
--- a/src/conf/cpu_conf.c
+++ b/src/conf/cpu_conf.c
@@ -108,6 +108,27 @@ virCPUDefCopy(const virCPUDefPtr cpu)
goto no_memory;
}
+ if (cpu->ncells) {
+ if (VIR_ALLOC_N(copy->cells, cpu->ncells) < 0)
+ goto no_memory;
+ copy->ncells_max = copy->ncells = cpu->ncells;
+
+ for (i = 0; i < cpu->ncells; i++) {
+ copy->cells[i].cellid = cpu->cells[i].cellid;
+ copy->cells[i].mem = cpu->cells[i].mem;
+
+ if (VIR_ALLOC_N(copy->cells[i].cpumask,
+ VIR_DOMAIN_CPUMASK_LEN) < 0)
+ goto no_memory;
+ memcpy(copy->cells[i].cpumask, cpu->cells[i].cpumask,
+ VIR_DOMAIN_CPUMASK_LEN);
+
+ if (!(copy->cells[i].cpustr = strdup(cpu->cells[i].cpustr)))
+ goto no_memory;
+ }
+ copy->cells_cpus = cpu->cells_cpus;
+ }
+
return copy;
no_memory:
--
1.7.8.2
12 years, 11 months
[libvirt] [libvirt-glib] API to save and suspend
by Zeeshan Ali (Khattak)
From: "Zeeshan Ali (Khattak)" <zeeshanak(a)gnome.org>
Its just a set of synchronous and asynchronous wrappers around
virDomainManagedSave.
---
libvirt-gobject/libvirt-gobject-domain.c | 122 ++++++++++++++++++++++++++++++
libvirt-gobject/libvirt-gobject-domain.h | 11 +++
libvirt-gobject/libvirt-gobject.sym | 3 +
3 files changed, 136 insertions(+), 0 deletions(-)
diff --git a/libvirt-gobject/libvirt-gobject-domain.c b/libvirt-gobject/libvirt-gobject-domain.c
index e4963ed..42765fd 100644
--- a/libvirt-gobject/libvirt-gobject-domain.c
+++ b/libvirt-gobject/libvirt-gobject-domain.c
@@ -708,3 +708,125 @@ gboolean gvir_domain_suspend (GVirDomain *dom,
cleanup:
return ret;
}
+
+/**
+ * gvir_domain_saved_suspend:
+ * @dom: the domain to save and suspend
+ * @flags: extra flags, currently unused
+ * @err: Place-holder for possible errors
+ *
+ * Just like #gvir_domain_suspend but also saves the state of the domain on disk
+ * and therefore makes it possible to restore the domain to its previous state
+ * even after shutdown/reboot of host machine.
+ *
+ * Returns: TRUE if domain was saved and suspended successfully, FALSE otherwise.
+ */
+gboolean gvir_domain_saved_suspend (GVirDomain *dom,
+ unsigned int flags,
+ GError **err)
+{
+ gboolean ret = FALSE;
+
+ g_return_val_if_fail(GVIR_IS_DOMAIN(dom), FALSE);
+
+ if (virDomainManagedSave(dom->priv->handle, flags) < 0) {
+ gvir_set_error_literal(err, GVIR_DOMAIN_ERROR,
+ 0,
+ "Unable to saved and suspend domain");
+ goto cleanup;
+ }
+
+ ret = TRUE;
+cleanup:
+ return ret;
+}
+
+typedef struct {
+ guint flags;
+} DomainSavedSuspendData;
+
+static void domain_saved_suspend_data_free(DomainSavedSuspendData *data)
+{
+ g_slice_free (DomainSavedSuspendData, data);
+}
+
+static void
+gvir_domain_saved_suspend_helper(GSimpleAsyncResult *res,
+ GObject *object,
+ GCancellable *cancellable G_GNUC_UNUSED)
+{
+ GVirDomain *dom = GVIR_DOMAIN(object);
+ DomainSavedSuspendData *data;
+ GError *err = NULL;
+
+ data = g_simple_async_result_get_op_res_gpointer (res);
+
+ if (!gvir_domain_saved_suspend(dom, data->flags, &err)) {
+ g_simple_async_result_set_from_error(res, err);
+ g_error_free(err);
+ }
+}
+
+/**
+ * gir_domain_saved_suspend_async:
+ * @dom: the domain to save and suspend
+ * @flags: extra flags, currently unused
+ * @cancellable: (allow-none)(transfer none): cancellation object
+ * @callback: (scope async): completion callback
+ * @user_data: (closure): opaque data for callback
+ *
+ * Asynchronous variant of #gvir_domain_saved_suspend.
+ */
+void gvir_domain_saved_suspend_async (GVirDomain *dom,
+ unsigned int flags,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data)
+{
+ GSimpleAsyncResult *res;
+ DomainSavedSuspendData *data;
+
+ g_return_if_fail(GVIR_IS_DOMAIN(dom));
+
+ data = g_slice_new0(DomainSavedSuspendData);
+ data->flags = flags;
+
+ res = g_simple_async_result_new(G_OBJECT(dom),
+ callback,
+ user_data,
+ gvir_domain_saved_suspend);
+ g_simple_async_result_set_op_res_gpointer (res, data, (GDestroyNotify) domain_saved_suspend_data_free);
+ g_simple_async_result_run_in_thread(res,
+ gvir_domain_saved_suspend_helper,
+ G_PRIORITY_DEFAULT,
+ cancellable);
+ g_object_unref(res);
+}
+
+/**
+ * gir_domain_saved_suspend_finish:
+ * @dom: the domain to save and suspend
+ * @result: (transfer none): async method result
+ * @err: Place-holder for possible errors
+ *
+ * Finishes the operation started by #gvir_domain_saved_suspend_async.
+ *
+ * Returns: TRUE if domain was saved and suspended successfully, FALSE otherwise.
+ */
+gboolean gvir_domain_saved_suspend_finish (GVirDomain *dom,
+ GAsyncResult *result,
+ GError **err)
+{
+ g_return_val_if_fail(GVIR_IS_DOMAIN(dom), FALSE);
+ g_return_val_if_fail(G_IS_ASYNC_RESULT(result), FALSE);
+
+ if (G_IS_SIMPLE_ASYNC_RESULT(result)) {
+ GSimpleAsyncResult *simple = G_SIMPLE_ASYNC_RESULT(result);
+ g_warn_if_fail (g_simple_async_result_get_source_tag(simple) ==
+ gvir_domain_saved_suspend);
+ if (g_simple_async_result_propagate_error(simple, err))
+ return FALSE;
+ }
+
+ return TRUE;
+}
diff --git a/libvirt-gobject/libvirt-gobject-domain.h b/libvirt-gobject/libvirt-gobject-domain.h
index a5923f4..96a1560 100644
--- a/libvirt-gobject/libvirt-gobject-domain.h
+++ b/libvirt-gobject/libvirt-gobject-domain.h
@@ -155,6 +155,17 @@ gboolean gvir_domain_open_graphics(GVirDomain *dom,
gboolean gvir_domain_suspend (GVirDomain *dom,
GError **err);
+gboolean gvir_domain_saved_suspend (GVirDomain *dom,
+ unsigned int flags,
+ GError **err);
+void gvir_domain_saved_suspend_async (GVirDomain *dom,
+ unsigned int flags,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data);
+gboolean gvir_domain_saved_suspend_finish (GVirDomain *dom,
+ GAsyncResult *result,
+ GError **err);
G_END_DECLS
diff --git a/libvirt-gobject/libvirt-gobject.sym b/libvirt-gobject/libvirt-gobject.sym
index 526098d..c04d67a 100644
--- a/libvirt-gobject/libvirt-gobject.sym
+++ b/libvirt-gobject/libvirt-gobject.sym
@@ -52,6 +52,9 @@ LIBVIRT_GOBJECT_0.0.3 {
gvir_domain_resume;
gvir_domain_stop;
gvir_domain_suspend;
+ gvir_domain_saved_suspend;
+ gvir_domain_saved_suspend_async;
+ gvir_domain_saved_suspend_finish;
gvir_domain_delete;
gvir_domain_open_console;
gvir_domain_open_graphics;
--
1.7.7.5
12 years, 11 months
[libvirt] virtio-scsi support proposal, v2
by Paolo Bonzini
Here is a revised version of the virtio-scsi proposal. There's actually
not too much left intact from v1. :)
The main simplification is in how SCSI hosts can be addressed in a stable
manner.
SCSI controller models
======================
Existing controller models are "auto", "buslogic", "lsilogic", "lsias1068",
or "vmpvscsi". The new controller model "virtio-scsi" is added. The model
"lsilogic" is mapped to the existing "lsi" device in QEMU.
When PPC64 support will be added, another controller model "spapr-vscsi"
will be added.
Stable addressing for SCSI devices
==================================
The existing <address type='drive' ...> element will be extended as follows:
<address type='drive' controller='...'
bus='...' target='...' unit='...'/>
where controller selects the qdev parent device, while bus/target/unit
are passed as qdev properties (the QEMU names are respectively channel,
scsi-id, lun).
Libvirt should check for the QEMU "scsi-disk.channel" property. If it
is unavailable, QEMU will only support channel=lun=0 and 0<=target<=7.
LUN passthrough: block devices
==============================
A SCSI block device from the host can be attached to a domain in two
ways: as an emulated LUN with SCSI commands implemented within QEMU,
or by passing SCSI commands down to the block device. The former is
handled by the existing <disk type='file'>, <disk type='block'> and
<disk type='network'> XML syntax. The latter is not yet supported.
On the QEMU side, LUN passthrough is implemented by one of the
scsi-generic and scsi-block devices. Scsi-generic requires a /dev/sg
device name, and can be applied to any device. scsi-block is only
available in QEMU 1.0 or newer, requires a block device, can be applied
only to block devices (sd/sr) and has better performance.
To implement LUN passthrough for block device, libvirt will add a new
<disk device='lun'> attribute. When, device='lun' is passed, the device
attribute is ignored.
Example:
<disk type='block' device='lun'>
<disk name='qemu' type='raw'/>
<source dev='/dev/sda'/>
<target dev='sda' bus='scsi'>
<address type='drive' controller='...'
bus='...' target='...' unit='...'/>
</disk>
Also, virtio-blk handling will be enhanced to disable SG_IO passthrough
when <disk device='disk'>, and only enable it when <disk device='lun'>.
(I am not sure whether the 'lun' value should be for the type or device
attribute. Laine has a patch to implement it for virtio disks which
uses "type").
This syntax makes it clear what is the passed-through device, and at
the same time it makes it very easy to switch a disk between emulated
and passthrough modes. Also, a stable addressing for the source device
is provided by /dev/disk/by-id and /dev/disk/by-path.
Stable SCSI host addressing
===========================
SCSI host number in Linux is not stable. An alternative stable
addressing is required to pass a whole host or target to a guest.
One place in which this could be supported is the SCSI volume pool
syntax:
<pool type='scsi'>
<name>virtimages</name>
<source>
<adapter name='host0'/>
</source>
<target>
<path>/dev/disk/by-id</path>
</target>
</pool>
libvirt will deprecate the above form for the adapter element and
provide the following forms:
<adapter name='scsi_host0'/>
<adapter parent='pci_0000_00_1f_2' unique_id='1'/>
The existing form changes from host0 to scsi_host0, for
consistency with the naming that is used in nodedev. The new
parent/unique_id addressing uses a parent PCI device and a unique
id that Linux provides in sysfs. In order to determine the SCSI
host number, libvirt would scan all files matched by the glob pattern
/sys/bus/pci/devices/0000:00:1f.2/*/scsi_host/*/unique_id, looking for
the one that contains "1".
The unique_id can be omitted. In this case, the pool will refer
to the host with the smallest unique_id under the given device.
Furthermore, a SCSI pool can be restricted to one target using an
additional element:
<source>
<adapter name='scsi_host0'/>
<address type='scsi' bus='0' target='0'/>
</source>
(bus defaults to 0, target is mandatory).
Generic passthrough
===================
Generic device passthrough at the LUN, target or host level builds
on the extensions to SCSI addressing from the previous section.
Passing a single LUN extends the <hostdev> tag as follows:
<hostdev type='scsi'>
<source>
<adapter name='scsi_host0'/>
<address type='scsi' bus='0' target='0' unit='0'/>
</source>
<target>
<address type='scsi' controller='...'
bus='...' target='...' unit='...'/>
</target>
</hostdev>
This will map to a -drive QEMU option referring to a scsi-generic
device, and a "-device scsi-generic" option referring to the drive.
libvirt can determine the /dev/sg file to use by reading the directory
/sys/bus/scsi/devices/target*/*/scsi_generic. These devices might also
be shown in the nodedev tree, similar to block devices.
Whenever a domain should receive all devices belonging to a SCSI host,
a similar <source> item should be included within the <controller
type='scsi'> element:
<controller type='scsi' model='virtio-scsi'>
<source>
<adapter name='scsi_host0'/>
</source>
</controller>
In this case, libvirt should use scsi-block rather than scsi-generic
for block devices.
NPIV-based SCSI host passthrough
================================
In NPIV, a virtual HBA is created using "virsh nodedev-create" and passed
to the guest. Passing through a whole SCSI host is quite common when
using NPIV. As a result, it is desirable to easily address virtual HBAs
both in SCSI storage pools and in <controller type='scsi'> elements.
Here are two proposals for how to refer to NPIV adapters:
1) add persistent nodedevs via commands nodedev-define, nodedev-undefine,
nodedev-start. The persistent nodedevs have a name, and this can be
used simply with <adapter name='NAME'>.
2) Virtual adapters do have a stable address, namely its WWN. This
can be used in a third <adapter> syntax:
<source>
<adapter type='fc_host' wwpn='...' wwnn='...'/>
</source>
12 years, 11 months
[libvirt] [libvirt-glib] API to save and suspend
by Zeeshan Ali (Khattak)
From: "Zeeshan Ali (Khattak)" <zeeshanak(a)gnome.org>
Its just a set of synchronous and asynchronous wrappers around
virDomainManagedSave.
---
libvirt-gobject/libvirt-gobject-domain.c | 119 ++++++++++++++++++++++++++++++
libvirt-gobject/libvirt-gobject-domain.h | 11 +++
libvirt-gobject/libvirt-gobject.sym | 3 +
3 files changed, 133 insertions(+), 0 deletions(-)
diff --git a/libvirt-gobject/libvirt-gobject-domain.c b/libvirt-gobject/libvirt-gobject-domain.c
index e4963ed..616273b 100644
--- a/libvirt-gobject/libvirt-gobject-domain.c
+++ b/libvirt-gobject/libvirt-gobject-domain.c
@@ -708,3 +708,122 @@ gboolean gvir_domain_suspend (GVirDomain *dom,
cleanup:
return ret;
}
+
+/**
+ * gvir_domain_saved_suspend:
+ * @dom: the domain to save and suspend
+ * @flags: extra flags, currently unused
+ * @err: Place-holder for possible errors
+ *
+ * Just like #gvir_domain_suspend but also saves the state of the domain on disk
+ * and therefore makes it possible to restore the domain to its previous state
+ * even after shutdown/reboot of host machine.
+ *
+ * Returns: TRUE if domain was saved and suspended successfully, FALSE otherwise.
+ */
+gboolean gvir_domain_saved_suspend (GVirDomain *dom,
+ unsigned int flags,
+ GError **err)
+{
+ gboolean ret = FALSE;
+
+ g_return_val_if_fail(GVIR_IS_DOMAIN(dom), FALSE);
+
+ if (virDomainManagedSave(dom->priv->handle, flags) < 0) {
+ gvir_set_error_literal(err, GVIR_DOMAIN_ERROR,
+ 0,
+ "Unable to saved and suspend domain");
+ goto cleanup;
+ }
+
+ ret = TRUE;
+cleanup:
+ return ret;
+}
+
+typedef struct {
+ guint flags;
+} DomainSavedSuspendData;
+
+static void
+gvir_domain_saved_suspend_helper(GSimpleAsyncResult *res,
+ GObject *object,
+ GCancellable *cancellable G_GNUC_UNUSED)
+{
+ GVirDomain *dom = GVIR_DOMAIN(object);
+ DomainSavedSuspendData *data;
+ GError *err = NULL;
+
+ data = g_simple_async_result_get_op_res_gpointer (res);
+
+ if (!gvir_domain_saved_suspend(dom, data->flags, &err)) {
+ g_simple_async_result_set_from_error(res, err);
+ g_error_free(err);
+ }
+
+ g_slice_free (DomainSavedSuspendData, data);
+}
+
+/**
+ * gir_domain_saved_suspend_async:
+ * @dom: the domain to save and suspend
+ * @flags: extra flags, currently unused
+ * @cancellable: (allow-none)(transfer none): cancellation object
+ * @callback: (scope async): completion callback
+ * @user_data: (closure): opaque data for callback
+ *
+ * Asynchronous variant of #gvir_domain_saved_suspend.
+ */
+void gvir_domain_saved_suspend_async (GVirDomain *dom,
+ unsigned int flags,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data)
+{
+ GSimpleAsyncResult *res;
+ DomainSavedSuspendData *data;
+
+ g_return_if_fail(GVIR_IS_DOMAIN(dom));
+
+ data = g_slice_new0(DomainSavedSuspendData);
+ data->flags = flags;
+
+ res = g_simple_async_result_new(G_OBJECT(dom),
+ callback,
+ user_data,
+ gvir_domain_saved_suspend);
+ g_simple_async_result_set_op_res_gpointer (res, data, NULL);
+ g_simple_async_result_run_in_thread(res,
+ gvir_domain_saved_suspend_helper,
+ G_PRIORITY_DEFAULT,
+ cancellable);
+ g_object_unref(res);
+}
+
+/**
+ * gir_domain_saved_suspend_finish:
+ * @dom: the domain to save and suspend
+ * @result: (transfer none): async method result
+ * @err: Place-holder for possible errors
+ *
+ * Finishes the operation started by #gvir_domain_saved_suspend_async.
+ *
+ * Returns: TRUE if domain was saved and suspended successfully, FALSE otherwise.
+ */
+gboolean gvir_domain_saved_suspend_finish (GVirDomain *dom,
+ GAsyncResult *result,
+ GError **err)
+{
+ g_return_val_if_fail(GVIR_IS_DOMAIN(dom), FALSE);
+ g_return_val_if_fail(G_IS_ASYNC_RESULT(result), FALSE);
+
+ if (G_IS_SIMPLE_ASYNC_RESULT(result)) {
+ GSimpleAsyncResult *simple = G_SIMPLE_ASYNC_RESULT(result);
+ g_warn_if_fail (g_simple_async_result_get_source_tag(simple) ==
+ gvir_domain_saved_suspend);
+ if (g_simple_async_result_propagate_error(simple, err))
+ return FALSE;
+ }
+
+ return TRUE;
+}
diff --git a/libvirt-gobject/libvirt-gobject-domain.h b/libvirt-gobject/libvirt-gobject-domain.h
index a5923f4..96a1560 100644
--- a/libvirt-gobject/libvirt-gobject-domain.h
+++ b/libvirt-gobject/libvirt-gobject-domain.h
@@ -155,6 +155,17 @@ gboolean gvir_domain_open_graphics(GVirDomain *dom,
gboolean gvir_domain_suspend (GVirDomain *dom,
GError **err);
+gboolean gvir_domain_saved_suspend (GVirDomain *dom,
+ unsigned int flags,
+ GError **err);
+void gvir_domain_saved_suspend_async (GVirDomain *dom,
+ unsigned int flags,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data);
+gboolean gvir_domain_saved_suspend_finish (GVirDomain *dom,
+ GAsyncResult *result,
+ GError **err);
G_END_DECLS
diff --git a/libvirt-gobject/libvirt-gobject.sym b/libvirt-gobject/libvirt-gobject.sym
index 526098d..c04d67a 100644
--- a/libvirt-gobject/libvirt-gobject.sym
+++ b/libvirt-gobject/libvirt-gobject.sym
@@ -52,6 +52,9 @@ LIBVIRT_GOBJECT_0.0.3 {
gvir_domain_resume;
gvir_domain_stop;
gvir_domain_suspend;
+ gvir_domain_saved_suspend;
+ gvir_domain_saved_suspend_async;
+ gvir_domain_saved_suspend_finish;
gvir_domain_delete;
gvir_domain_open_console;
gvir_domain_open_graphics;
--
1.7.7.5
12 years, 11 months
[libvirt] [PATCH 0/3] python: Fix memory leaks
by ajia@redhat.com
From: Alex Jia <ajia(a)redhat.com>
This series patches fix memory leaks issues. Detected by valgrind.
Alex Jia (3):
* python/libvirt-override.c: fix memory leaks on libvirt_virDomainBlockStatsFlags.
* python/libvirt-override.c: fix memory leaks on libvirt_virDomainGetSchedulerParameters
and libvirt_virDomainGetSchedulerParametersFlags.
* python/libvirt-override.c: fix memory leaks on libvirt_virDomainGetMemoryParameters.
Signed-off-by: Alex Jia <ajia(a)redhat.com>
12 years, 11 months
[libvirt] Access to the secretDriver in a storage backend?
by Wido den Hollander
Hi,
I'm working on a storage backend for libvirt which needs credentials to
access the storage pool. I want to use the build in secret manager from
libvirt, but it seems I do not have access to the secretDriver in a
storage backend?
static int virStorageBackendRBDRefreshPool(virConnectPtr conn
ATTRIBUTE_UNUSED, virStoragePoolObjPtr pool) {
if (pool->def->source.auth.cephx.secret != NULL) {
virSecretPtr secret;
secret = conn->secretDriver->lookupByUUID(conn,
pool->def->source.auth.cephx.secret);
virSecretFree(secret);
}
return 0;
}
It goes wrong at this point:
conn->secretDriver->lookupByUUID(conn,pool->def->source.auth.cephx.secret);
"error: dereferencing pointer to incomplete type"
Is the secretDriver available in a storage backend? In storage_backend.c
I see that it should be available, correct?
I might be missing something here, so that's why I'm asking it here.
Thank you,
Wido
12 years, 11 months