[libvirt] [PATCH] Set to NULL members that have been freed to prevent crashes
by Marc-André Lureau
Do not crash if virStreamFinish is called after error.
==11000== Invalid read of size 4
==11000== at 0x373A8099A0: pthread_mutex_lock (pthread_mutex_lock.c:51)
==11000== by 0x4C7CADE: virMutexLock (threads-pthread.c:85)
==11000== by 0x4D57C31: virNetClientStreamRaiseError (virnetclientstream.c:203)
==11000== by 0x4D385E4: remoteStreamFinish (remote_driver.c:3541)
==11000== by 0x4D182F9: virStreamFinish (libvirt.c:14157)
==11000== by 0x40FDC4: cmdScreenshot (virsh.c:3075)
==11000== by 0x42BA40: vshCommandRun (virsh.c:14922)
==11000== by 0x42ECCA: main (virsh.c:16381)
==11000== Address 0x59b86c0 is 16 bytes inside a block of size 216 free'd
==11000== at 0x4A06928: free (vg_replace_malloc.c:427)
==11000== by 0x4C69E2B: virFree (memory.c:310)
==11000== by 0x4D57B56: virNetClientStreamFree (virnetclientstream.c:184)
==11000== by 0x4D3DB7A: remoteDomainScreenshot (remote_client_bodies.h:1812)
==11000== by 0x4CFD245: virDomainScreenshot (libvirt.c:2903)
==11000== by 0x40FB73: cmdScreenshot (virsh.c:3029)
==11000== by 0x42BA40: vshCommandRun (virsh.c:14922)
==11000== by 0x42ECCA: main (virsh.c:16381)
---
src/rpc/gendispatch.pl | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/src/rpc/gendispatch.pl b/src/rpc/gendispatch.pl
index 039d785..b7ac3c8 100755
--- a/src/rpc/gendispatch.pl
+++ b/src/rpc/gendispatch.pl
@@ -1480,6 +1480,8 @@ elsif ($opt_k) {
if ($call->{streamflag} ne "none") {
print " virNetClientRemoveStream(priv->client, netst);\n";
print " virNetClientStreamFree(netst);\n";
+ print " st->driver = NULL;\n";
+ print " st->privateData = NULL;\n";
}
print " goto done;\n";
--
1.7.6.2
13 years, 2 months
[libvirt] [PATCH] Allow passing of command line args to LXC container
by Daniel P. Berrange
From: "Daniel P. Berrange" <berrange(a)redhat.com>
When booting a virtual machine with a kernel/initrd it is possible
to pass command line arguments using the <cmdline>...args...</cmdline>
element in the guest XML. These appear to the kernel / init process
in /proc/cmdline.
When booting a container we do not have a custom /proc/cmdline,
but we can easily set an environment variable for it. Ideally
we could pass individual arguments to the init process as a
regular set of 'char *argv[]' parameters, but that would involve
libvirt parsing the <cmdline> XML text. This can easily be added
later, even if we add the env variable now
* docs/drvlxc.html.in: Document env variables passed to LXC
* src/conf/domain_conf.c: Add <cmdline> to be parsed for
guests of type='exe'
* src/lxc/lxc_container.c: Set LIBVIRT_LXC_CMDLINE env var
---
docs/drvlxc.html.in | 17 +++++++++++++++++
src/conf/domain_conf.c | 1 +
src/lxc/lxc_container.c | 2 ++
3 files changed, 20 insertions(+), 0 deletions(-)
diff --git a/docs/drvlxc.html.in b/docs/drvlxc.html.in
index 5ce218d..47837d1 100644
--- a/docs/drvlxc.html.in
+++ b/docs/drvlxc.html.in
@@ -39,6 +39,23 @@ driver. On such kernels, it may be neccessary to unmount the blkio controller.
</p>
+<h2>Environment setup for the container init</h2>
+
+<p>
+When the container "init" process is started, it will be given several useful
+environment variables.
+</p>
+
+<dl>
+<dt>LIBVIRT_LXC_NAME</dt>
+<dd>The name assigned to the container by libvirt</dd>
+<dt>LIBVIRT_LXC_UUID</dt>
+<dd>The UUID assigned to the container by libvirt</dd>
+<dt>LIBVIRT_LXC_CMDLINE</dt>
+<dd>The unparsed command line arguments specified in the container configuration</dd>
+</dl>
+
+
<h3>Example config version 1</h3>
<p></p>
<pre>
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index 6fb1888..0f751ca 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -6833,6 +6833,7 @@ static virDomainDefPtr virDomainDefParseXML(virCapsPtr caps,
goto error;
}
}
+ def->os.cmdline = virXPathString("string(./os/cmdline[1])", ctxt);
}
if (STREQ(def->os.type, "xen") ||
diff --git a/src/lxc/lxc_container.c b/src/lxc/lxc_container.c
index 787df9a..69cea8e 100644
--- a/src/lxc/lxc_container.c
+++ b/src/lxc/lxc_container.c
@@ -116,6 +116,8 @@ static virCommandPtr lxcContainerBuildInitCmd(virDomainDefPtr vmDef)
virCommandAddEnvString(cmd, "TERM=linux");
virCommandAddEnvPair(cmd, "LIBVIRT_LXC_UUID", uuidstr);
virCommandAddEnvPair(cmd, "LIBVIRT_LXC_NAME", vmDef->name);
+ if (vmDef->os.cmdline)
+ virCommandAddEnvPair(cmd, "LIBVIRT_LXC_CMDLINE", vmDef->os.cmdline);
return cmd;
}
--
1.7.6.2
13 years, 2 months
[libvirt] [PATCH] Add support for bandwidth filtering on LXC guests
by Daniel P. Berrange
From: "Daniel P. Berrange" <berrange(a)redhat.com>
Call virBandwidthEnable after creating the LXC veth, so that any
bandwidth controls get applied
* src/lxc/lxc_driver.c: Enable bandwidth limiting
---
src/lxc/lxc_driver.c | 8 ++++++++
1 files changed, 8 insertions(+), 0 deletions(-)
diff --git a/src/lxc/lxc_driver.c b/src/lxc/lxc_driver.c
index 4b62600..c8e6119 100644
--- a/src/lxc/lxc_driver.c
+++ b/src/lxc/lxc_driver.c
@@ -1166,6 +1166,14 @@ static int lxcSetupInterfaces(virConnectPtr conn,
if (vethInterfaceUpOrDown(parentVeth, 1) < 0)
goto error_exit;
+ if (virBandwidthEnable(virDomainNetGetActualBandwidth(def->nets[i]),
+ def->nets[i]->ifname) < 0) {
+ lxcError(VIR_ERR_INTERNAL_ERROR,
+ _("cannot set bandwidth limits on %s"),
+ def->nets[i]->ifname);
+ goto error_exit;
+ }
+
if (def->nets[i]->filter &&
virDomainConfNWFilterInstantiate(conn, def->nets[i]) < 0)
goto error_exit;
--
1.7.6.2
13 years, 2 months
[libvirt] hugepages error: "hugetlbfs filesystem is not mounted"
by Shahar Havivi
Hi,
I am trying to run a VM (via VDSM) with hugepages and I am getting this error:
"virNetClientProgramDispatchError:170 : internal error hugetlbfs filesystem is not mounted"
hugepages is mounted with the proper permissions (36:36) in case of vdsm user,
this code use to work..., now I am at version: libvirt-0.9.4-12.el6.x86_64
output of few commands:
# tree /dev/hugepages/
/dev/hugepages/
`-- libvirt
`-- qemu
# ll -n /dev/hugepages/libvirt/
total 0
drwxr-xr-x 2 36 36 0 Oct 3 12:46 qemu/
# sysctl vm.nr_hugepages
vm.nr_hugepages = 256
Any idea whats wrong?
Thank you,
Shahar Havivi
13 years, 2 months
[libvirt] [PATCH 1/2] snapshot: implement getparent for esx
by Eric Blake
Pretty easy to paste together compared to existing functions.
* src/esx/esx_driver.c (esxDomainSnapshotGetParent): New function.
---
I can only compile-test this; I'm relying on someone with an actual
esx setup to actually test it. Also, I didn't see anything in
existing code that would efficiently implement
virDomainSnapshotNumChildren; there may an API that I'm not aware of,
but someone else will have to implement that API (Matthias?)
src/esx/esx_driver.c | 41 +++++++++++++++++++++++++++++++++++++++++
1 files changed, 41 insertions(+), 0 deletions(-)
diff --git a/src/esx/esx_driver.c b/src/esx/esx_driver.c
index c15c0d6..ab93efd 100644
--- a/src/esx/esx_driver.c
+++ b/src/esx/esx_driver.c
@@ -4484,6 +4484,46 @@ esxDomainHasCurrentSnapshot(virDomainPtr domain, unsigned int flags)
static virDomainSnapshotPtr
+esxDomainSnapshotGetParent(virDomainSnapshotPtr snapshot, unsigned int flags)
+{
+ esxPrivate *priv = snapshot->domain->conn->privateData;
+ esxVI_VirtualMachineSnapshotTree *rootSnapshotList = NULL;
+ esxVI_VirtualMachineSnapshotTree *snapshotTree = NULL;
+ esxVI_VirtualMachineSnapshotTree *snapshotTreeParent = NULL;
+ virDomainSnapshotPtr parent = NULL;
+
+ virCheckFlags(0, NULL);
+
+ if (esxVI_EnsureSession(priv->primary) < 0) {
+ return NULL;
+ }
+
+ if (esxVI_LookupRootSnapshotTreeList(priv->primary, snapshot->domain->uuid,
+ &rootSnapshotList) < 0 ||
+ esxVI_GetSnapshotTreeByName(rootSnapshotList, snapshot->name,
+ &snapshotTree, &snapshotTreeParent,
+ esxVI_Occurrence_RequiredItem) < 0) {
+ goto cleanup;
+ }
+
+ if (!snapshotTreeParent) {
+ ESX_ERROR(VIR_ERR_NO_DOMAIN_SNAPSHOT,
+ _("snapshot '%s' does not have a parent"),
+ snapshotTree->name);
+ goto cleanup;
+ }
+
+ parent = virGetDomainSnapshot(snapshot->domain, snapshotTreeParent->name);
+
+cleanup:
+ esxVI_VirtualMachineSnapshotTree_Free(&rootSnapshotList);
+
+ return parent;
+}
+
+
+
+static virDomainSnapshotPtr
esxDomainSnapshotCurrent(virDomainPtr domain, unsigned int flags)
{
esxPrivate *priv = domain->conn->privateData;
@@ -4831,6 +4871,7 @@ static virDriver esxDriver = {
.domainSnapshotListNames = esxDomainSnapshotListNames, /* 0.8.0 */
.domainSnapshotLookupByName = esxDomainSnapshotLookupByName, /* 0.8.0 */
.domainHasCurrentSnapshot = esxDomainHasCurrentSnapshot, /* 0.8.0 */
+ .domainSnapshotGetParent = esxDomainSnapshotGetParent, /* 0.9.7 */
.domainSnapshotCurrent = esxDomainSnapshotCurrent, /* 0.8.0 */
.domainRevertToSnapshot = esxDomainRevertToSnapshot, /* 0.8.0 */
.domainSnapshotDelete = esxDomainSnapshotDelete, /* 0.8.0 */
--
1.7.4.4
13 years, 2 months
[libvirt] Comment inconsistency in bridge_driver.c
by Neil Wilson
Hi,
At line 1560 in srv/network/bridge_driver.c it says:
/* All interfaces used as a gateway (which is what this is, by
* definition), must always have autoconf=0.
*/
and then promptly sets that variable to 1 with
if (virFileWriteStr(field, "1", 0) < 0) {
Is the comment or the code the correct value?
Rgs
Neil Wilson
13 years, 2 months
[libvirt] [libvirt-glib] [PATCH] Explicitly link conn-test example against libgobject
by Guido Günther
Otherwise the build fails with:
/usr/bin/ld: conn_test-conn-test.o: undefined reference to symbol 'g_type_check_instance_cast'
/usr/bin/ld: note: 'g_type_check_instance_cast' is defined in DSO /usr/lib/libgobject-2.0.so.0 so try adding it to the linker command line
/usr/lib/libgobject-2.0.so.0: could not read symbols: Invalid operation
collect2: ld returned 1 exit status
---
examples/Makefile.am | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/examples/Makefile.am b/examples/Makefile.am
index 10ce32d..0964597 100644
--- a/examples/Makefile.am
+++ b/examples/Makefile.am
@@ -25,5 +25,5 @@ conn_test_SOURCES = \
conn_test_LDADD = \
../libvirt-gobject/libvirt-gobject-1.0.la \
$(LIBVIRT_LIBS) \
- $(GLIB2_LIBS)
-
+ $(GLIB2_LIBS) \
+ $(GOBJECT2_LIBS)
--
1.7.6.3
13 years, 2 months
[libvirt] [libvirt-glib] event: remove timeout and handle from arrays
by Marc-André Lureau
Otherwise, it will crash next time it goes find().
==9856== Invalid read of size 4
==9856== at 0x84E4888: gvir_event_timeout_find (libvirt-glib-event.c:293)
==9856== by 0x84E48E4: gvir_event_timeout_update (libvirt-glib-event.c:308)
==9856== by 0x31AB04BBDB: virEventUpdateTimeout (event.c:122)
==9856== by 0x31AB148758: virNetClientStreamEventTimerUpdate (virnetclientstream.c:81)
==9856== by 0x31AB14991C: virNetClientStreamEventAddCallback (virnetclientstream.c:471)
==9856== by 0x31AB12944F: remoteStreamEventAddCallback (remote_driver.c:3484)
==9856== by 0x31AB108EAC: virStreamEventAddCallback (libvirt.c:14036)
...
==9856== Address 0x143be760 is 0 bytes inside a block of size 40 free'd
==9856== at 0x4A06928: free (vg_replace_malloc.c:427)
==9856== by 0x84E4AD6: gvir_event_timeout_remove (libvirt-glib-event.c:361)
==9856== by 0x31AB04BC2C: virEventRemoveTimeout (event.c:136)
==9856== by 0x31AB149B24: virNetClientStreamEventRemoveCallback (virnetclientstream.c:521)
==9856== by 0x31AB129566: remoteStreamEventRemoveCallback (remote_driver.c:3525)
==9856== by 0x31AB10918F: virStreamEventRemoveCallback (libvirt.c:14114)
...
---
libvirt-glib/libvirt-glib-event.c | 83 +++++++++++++++++++++++-------------
1 files changed, 53 insertions(+), 30 deletions(-)
diff --git a/libvirt-glib/libvirt-glib-event.c b/libvirt-glib/libvirt-glib-event.c
index 8b1bddf..303bec7 100644
--- a/libvirt-glib/libvirt-glib-event.c
+++ b/libvirt-glib/libvirt-glib-event.c
@@ -61,12 +61,10 @@ struct gvir_event_timeout
GMutex *eventlock = NULL;
static int nextwatch = 1;
-static unsigned int nhandles = 0;
-static struct gvir_event_handle **handles = NULL;
+static GPtrArray *handles;
static int nexttimer = 1;
-static unsigned int ntimeouts = 0;
-static struct gvir_event_timeout **timeouts = NULL;
+static GPtrArray *timeouts;
static gboolean
gvir_event_handle_dispatch(GIOChannel *source G_GNUC_UNUSED,
@@ -106,9 +104,7 @@ gvir_event_handle_add(int fd,
g_mutex_lock(eventlock);
- handles = g_realloc(handles, sizeof(*handles)*(nhandles+1));
- data = g_malloc(sizeof(*data));
- memset(data, 0, sizeof(*data));
+ data = g_new0(struct gvir_event_handle, 1);
if (events & VIR_EVENT_HANDLE_READABLE)
cond |= G_IO_IN;
@@ -130,7 +126,7 @@ gvir_event_handle_add(int fd,
gvir_event_handle_dispatch,
data);
- handles[nhandles++] = data;
+ g_ptr_array_add(handles, data);
ret = data->watch;
@@ -140,12 +136,24 @@ gvir_event_handle_add(int fd,
}
static struct gvir_event_handle *
-gvir_event_handle_find(int watch)
+gvir_event_handle_find(int watch, guint *idx)
{
- unsigned int i;
- for (i = 0 ; i < nhandles ; i++)
- if (handles[i]->watch == watch)
- return handles[i];
+ guint i;
+
+ for (i = 0 ; i < handles->len ; i++) {
+ struct gvir_event_handle *h = g_ptr_array_index(handles, i);
+
+ if (h == NULL) {
+ g_warn_if_reached ();
+ continue;
+ }
+
+ if (h->watch == watch) {
+ if (idx != NULL)
+ *idx = i;
+ return h;
+ }
+ }
return NULL;
}
@@ -158,7 +166,7 @@ gvir_event_handle_update(int watch,
g_mutex_lock(eventlock);
- data = gvir_event_handle_find(watch);
+ data = gvir_event_handle_find(watch, NULL);
if (!data) {
DEBUG("Update for missing handle watch %d", watch);
goto cleanup;
@@ -202,7 +210,8 @@ _handle_remove(gpointer data)
if (h->ff)
(h->ff)(h->opaque);
- free(h);
+
+ g_ptr_array_remove_fast(handles, h);
return FALSE;
}
@@ -212,10 +221,11 @@ gvir_event_handle_remove(int watch)
{
struct gvir_event_handle *data;
int ret = -1;
+ guint idx;
g_mutex_lock(eventlock);
- data = gvir_event_handle_find(watch);
+ data = gvir_event_handle_find(watch, &idx);
if (!data) {
DEBUG("Remove of missing watch %d", watch);
goto cleanup;
@@ -259,10 +269,7 @@ gvir_event_timeout_add(int interval,
g_mutex_lock(eventlock);
- timeouts = g_realloc(timeouts, sizeof(*timeouts)*(ntimeouts+1));
- data = g_malloc(sizeof(*data));
- memset(data, 0, sizeof(*data));
-
+ data = g_new0(struct gvir_event_timeout, 1);
data->timer = nexttimer++;
data->interval = interval;
data->cb = cb;
@@ -273,7 +280,7 @@ gvir_event_timeout_add(int interval,
gvir_event_timeout_dispatch,
data);
- timeouts[ntimeouts++] = data;
+ g_ptr_array_add(timeouts, data);
DEBUG("Add timeout %p %d %p %p %d\n", data, interval, cb, opaque, data->timer);
@@ -286,12 +293,26 @@ gvir_event_timeout_add(int interval,
static struct gvir_event_timeout *
-gvir_event_timeout_find(int timer)
+gvir_event_timeout_find(int timer, guint *idx)
{
- unsigned int i;
- for (i = 0 ; i < ntimeouts ; i++)
- if (timeouts[i]->timer == timer)
- return timeouts[i];
+ guint i;
+
+ g_return_val_if_fail(timeouts != NULL, NULL);
+
+ for (i = 0 ; i < timeouts->len ; i++) {
+ struct gvir_event_timeout *t = g_ptr_array_index(timeouts, i);
+
+ if (t == NULL) {
+ g_warn_if_reached ();
+ continue;
+ }
+
+ if (t->timer == timer) {
+ if (idx != NULL)
+ *idx = i;
+ return t;
+ }
+ }
return NULL;
}
@@ -305,7 +326,7 @@ gvir_event_timeout_update(int timer,
g_mutex_lock(eventlock);
- data = gvir_event_timeout_find(timer);
+ data = gvir_event_timeout_find(timer, NULL);
if (!data) {
DEBUG("Update of missing timer %d", timer);
goto cleanup;
@@ -337,11 +358,12 @@ static int
gvir_event_timeout_remove(int timer)
{
struct gvir_event_timeout *data;
+ guint idx;
int ret = -1;
g_mutex_lock(eventlock);
- data = gvir_event_timeout_find(timer);
+ data = gvir_event_timeout_find(timer, &idx);
if (!data) {
DEBUG("Remove of missing timer %d", timer);
goto cleanup;
@@ -358,8 +380,7 @@ gvir_event_timeout_remove(int timer)
if (data->ff)
(data->ff)(data->opaque);
- free(data);
-
+ g_ptr_array_remove_index_fast(timeouts, idx);
ret = 0;
cleanup:
@@ -371,6 +392,8 @@ cleanup:
static gpointer event_register_once(gpointer data G_GNUC_UNUSED)
{
eventlock = g_mutex_new();
+ timeouts = g_ptr_array_new_with_free_func(g_free);
+ handles = g_ptr_array_new_with_free_func(g_free);
virEventRegisterImpl(gvir_event_handle_add,
gvir_event_handle_update,
gvir_event_handle_remove,
--
1.7.6.2
13 years, 2 months
[libvirt] [libvirt-glib] enums: fix incorrect prefix strip
by Marc-André Lureau
GVIR_TYPE_VIR_FOO -> GVIR_TYPE_FOO
---
libvirt-gobject/Makefile.am | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/libvirt-gobject/Makefile.am b/libvirt-gobject/Makefile.am
index 9430d40..8147db2 100644
--- a/libvirt-gobject/Makefile.am
+++ b/libvirt-gobject/Makefile.am
@@ -88,7 +88,7 @@ libvirt-gobject-enums.h: libvirt-gobject-domain.h libvirt-gobject-connection.h
--ftail "#endif /* __LIBVIRT_GOBJECT_ENUMS_H__ */\n" \
--eprod "#define GVIR_TYPE_@ENUMSHORT@ @enum_name@_get_type()\n" \
--eprod "GType @enum_name@_get_type (void);\n" \
- $^ | sed -e 's/g_vir/gvir/g' > $@
+ $^ | sed -e 's/g_vir/gvir/g' | sed -e 's/_VIR_/_/g' > $@
BUILT_SOURCES = libvirt-gobject-enums.c libvirt-gobject-enums.h
--
1.7.6.2
13 years, 2 months
[libvirt] [libvirt-glib] gir: fix introspection of asyncs and array delegate
by Marc-André Lureau
---
libvirt-gobject/libvirt-gobject-connection.c | 24 ++++++++++++------------
libvirt-gobject/libvirt-gobject-connection.h | 6 +++---
libvirt-gobject/libvirt-gobject-storage-pool.c | 8 ++++----
libvirt-gobject/libvirt-gobject-storage-pool.h | 2 +-
libvirt-gobject/libvirt-gobject-stream.h | 2 +-
5 files changed, 21 insertions(+), 21 deletions(-)
diff --git a/libvirt-gobject/libvirt-gobject-connection.c b/libvirt-gobject/libvirt-gobject-connection.c
index 90d1566..5fc0a9e 100644
--- a/libvirt-gobject/libvirt-gobject-connection.c
+++ b/libvirt-gobject/libvirt-gobject-connection.c
@@ -431,19 +431,19 @@ gvir_connection_open_helper(GSimpleAsyncResult *res,
* gvir_connection_open_async:
* @conn: the connection
* @cancellable: (allow-none)(transfer none): cancellation object
- * @callback: (transfer none): completion callback
- * @opaque: (transfer none)(allow-none): opaque data for callback
+ * @callback: (scope async): completion callback
+ * @user_data: (closure): opaque data for callback
*/
void gvir_connection_open_async(GVirConnection *conn,
GCancellable *cancellable,
GAsyncReadyCallback callback,
- gpointer opaque)
+ gpointer user_data)
{
GSimpleAsyncResult *res;
res = g_simple_async_result_new(G_OBJECT(conn),
callback,
- opaque,
+ user_data,
gvir_connection_open);
g_simple_async_result_run_in_thread(res,
gvir_connection_open_helper,
@@ -828,19 +828,19 @@ gvir_connection_fetch_domains_helper(GSimpleAsyncResult *res,
* gvir_connection_fetch_domains_async:
* @conn: the connection
* @cancellable: (allow-none)(transfer none): cancellation object
- * @callback: (transfer none): completion callback
- * @opaque: (transfer none)(allow-none): opaque data for callback
+ * @callback: (scope async): completion callback
+ * @user_data: (closure): opaque data for callback
*/
void gvir_connection_fetch_domains_async(GVirConnection *conn,
GCancellable *cancellable,
GAsyncReadyCallback callback,
- gpointer opaque)
+ gpointer user_data)
{
GSimpleAsyncResult *res;
res = g_simple_async_result_new(G_OBJECT(conn),
callback,
- opaque,
+ user_data,
gvir_connection_fetch_domains);
g_simple_async_result_run_in_thread(res,
gvir_connection_fetch_domains_helper,
@@ -889,19 +889,19 @@ gvir_connection_fetch_pools_helper(GSimpleAsyncResult *res,
* gvir_connection_fetch_storage_pools_async:
* @conn: the connection
* @cancellable: (allow-none)(transfer none): cancellation object
- * @callback: (transfer none): completion callback
- * @opaque: (transfer none)(allow-none): opaque data for callback
+ * @callback: (scope async): completion callback
+ * @user_data: (closure): opaque data for callback
*/
void gvir_connection_fetch_storage_pools_async(GVirConnection *conn,
GCancellable *cancellable,
GAsyncReadyCallback callback,
- gpointer opaque)
+ gpointer user_data)
{
GSimpleAsyncResult *res;
res = g_simple_async_result_new(G_OBJECT(conn),
callback,
- opaque,
+ user_data,
gvir_connection_fetch_storage_pools);
g_simple_async_result_run_in_thread(res,
gvir_connection_fetch_pools_helper,
diff --git a/libvirt-gobject/libvirt-gobject-connection.h b/libvirt-gobject/libvirt-gobject-connection.h
index d05f792..2eb58ec 100644
--- a/libvirt-gobject/libvirt-gobject-connection.h
+++ b/libvirt-gobject/libvirt-gobject-connection.h
@@ -77,7 +77,7 @@ gboolean gvir_connection_open(GVirConnection *conn,
void gvir_connection_open_async(GVirConnection *conn,
GCancellable *cancellable,
GAsyncReadyCallback callback,
- gpointer opaque);
+ gpointer user_data);
gboolean gvir_connection_open_finish(GVirConnection *conn,
GAsyncResult *result,
GError **err);
@@ -90,7 +90,7 @@ gboolean gvir_connection_fetch_domains(GVirConnection *conn,
void gvir_connection_fetch_domains_async(GVirConnection *conn,
GCancellable *cancellable,
GAsyncReadyCallback callback,
- gpointer opaque);
+ gpointer user_data);
gboolean gvir_connection_fetch_domains_finish(GVirConnection *conn,
GAsyncResult *result,
GError **err);
@@ -149,7 +149,7 @@ gboolean gvir_connection_fetch_storage_pools(GVirConnection *conn,
void gvir_connection_fetch_storage_pools_async(GVirConnection *conn,
GCancellable *cancellable,
GAsyncReadyCallback callback,
- gpointer opaque);
+ gpointer user_data);
gboolean gvir_connection_fetch_storage_pools_finish(GVirConnection *conn,
GAsyncResult *result,
GError **err);
diff --git a/libvirt-gobject/libvirt-gobject-storage-pool.c b/libvirt-gobject/libvirt-gobject-storage-pool.c
index 8f581eb..fc9cba9 100644
--- a/libvirt-gobject/libvirt-gobject-storage-pool.c
+++ b/libvirt-gobject/libvirt-gobject-storage-pool.c
@@ -385,19 +385,19 @@ gvir_storage_pool_refresh_helper(GSimpleAsyncResult *res,
* gvir_storage_pool_refresh_async:
* @pool: the storage pool
* @cancellable: (allow-none)(transfer none): cancellation object
- * @callback: (transfer none): completion callback
- * @opaque: (transfer none)(allow-none): opaque data for callback
+ * @callback: (scope async): completion callback
+ * @user_data: (closure): opaque data for callback
*/
void gvir_storage_pool_refresh_async(GVirStoragePool *pool,
GCancellable *cancellable,
GAsyncReadyCallback callback,
- gpointer opaque)
+ gpointer user_data)
{
GSimpleAsyncResult *res;
res = g_simple_async_result_new(G_OBJECT(pool),
callback,
- opaque,
+ user_data,
gvir_storage_pool_refresh);
g_simple_async_result_run_in_thread(res,
gvir_storage_pool_refresh_helper,
diff --git a/libvirt-gobject/libvirt-gobject-storage-pool.h b/libvirt-gobject/libvirt-gobject-storage-pool.h
index a789a6a..620f888 100644
--- a/libvirt-gobject/libvirt-gobject-storage-pool.h
+++ b/libvirt-gobject/libvirt-gobject-storage-pool.h
@@ -75,7 +75,7 @@ gboolean gvir_storage_pool_refresh(GVirStoragePool *pool,
void gvir_storage_pool_refresh_async(GVirStoragePool *pool,
GCancellable *cancellable,
GAsyncReadyCallback callback,
- gpointer opaque);
+ gpointer user_data);
gboolean gvir_storage_pool_refresh_finish(GVirStoragePool *pool,
GAsyncResult *result,
GError **err);
diff --git a/libvirt-gobject/libvirt-gobject-stream.h b/libvirt-gobject/libvirt-gobject-stream.h
index fd9c9bb..5181e24 100644
--- a/libvirt-gobject/libvirt-gobject-stream.h
+++ b/libvirt-gobject/libvirt-gobject-stream.h
@@ -62,7 +62,7 @@ struct _GVirStreamClass
/**
* GVirStreamSinkFunc:
* @stream: a #GVirStream
- * @buf: data pointer
+ * @buf: (out) (array length=nbytes) (transfer none): data pointer
* @nbytes: data size
* @user_data: user data passed to the function
* Returns: the number of bytes filled, 0 upon end
--
1.7.6.2
13 years, 2 months