[libvirt] [dbus PATCH] Fix GError memory leaks
by Pavel Hrdina
Signed-off-by: Pavel Hrdina <phrdina(a)redhat.com>
---
src/gdbus.c | 8 ++++----
src/main.c | 2 +-
2 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/src/gdbus.c b/src/gdbus.c
index cb06813..3407116 100644
--- a/src/gdbus.c
+++ b/src/gdbus.c
@@ -86,7 +86,7 @@ virtDBusGDBusHandlePropertyGet(GVariant *parameters,
const gchar *interface;
const gchar *name;
GVariant *value = NULL;
- GError *error = NULL;
+ g_autoptr(GError) error = NULL;
g_variant_get(parameters, "(&s&s)", &interface, &name);
@@ -128,7 +128,7 @@ virtDBusGDBusHandlePropertySet(GVariant *parameters,
const gchar *interface;
const gchar *name;
g_autoptr(GVariant) value = NULL;
- GError *error = NULL;
+ g_autoptr(GError) error = NULL;
g_variant_get(parameters, "(&s&sv)", &interface, &name, &value);
@@ -162,7 +162,7 @@ virtDBusGDBusHandlePropertyGetAll(GDBusMethodInvocation *invocation,
{
GVariant *value;
g_auto(GVariantBuilder) builder;
- GError *error = NULL;
+ g_autoptr(GError) error = NULL;
g_variant_builder_init(&builder, G_VARIANT_TYPE("(a{sv})"));
@@ -202,7 +202,7 @@ virtDBusGDBusHandleMethod(GVariant *parameters,
GUnixFDList *inFDs = NULL;
GVariant *outArgs = NULL;
GUnixFDList *outFDs = NULL;
- GError *error = NULL;
+ g_autoptr(GError) error = NULL;
for (gint i = 0; data->methods[i].name; i++) {
if (g_str_equal(methodName, data->methods[i].name)) {
diff --git a/src/main.c b/src/main.c
index b3baf76..eb30ef8 100644
--- a/src/main.c
+++ b/src/main.c
@@ -52,7 +52,7 @@ virtDBusAcquired(GDBusConnection *connection,
gpointer opaque)
{
virtDBusRegisterData *data = opaque;
- GError *error = NULL;
+ g_autoptr(GError) error = NULL;
for (gsize i = 0; i < data->ndrivers; i += 1) {
virtDBusConnectNew(&data->connectList[i], connection,
--
2.14.3
6 years, 6 months
[libvirt] [dbus PATCH 0/3] Introduce GVariant to TypedParams helper
by Pavel Hrdina
Pavel Hrdina (3):
util: Introduce virtDBusUtilTypedParams
util: Introduce virtDBusUtilGVariantToTypedParams
domain: Implement SetPerfEvents method
data/org.libvirt.Domain.xml | 6 +++
src/domain.c | 31 ++++++++++++++++
src/util.c | 89 +++++++++++++++++++++++++++++++++++++++++++++
src/util.h | 17 +++++++++
4 files changed, 143 insertions(+)
--
2.14.3
6 years, 6 months
[libvirt] --disable-nls is ignored in master
by Olaf Hering
It seems some of the recent changes for 'po' broke the --disable-nls configure option.
I expect no locales will be installed with --disable-nls, but they are installed anyway.
This leads to the well known "error: Installed (but unpackaged) file(s) found:" failure.
I tested libvirt-20180420T081114.3c66d5108.
Olaf
6 years, 6 months
[libvirt] [dbus PATCH v2] Implement GetAllDomainStats method for Connect Interface
by Katerina Koukiou
Signed-off-by: Katerina Koukiou <kkoukiou(a)redhat.com>
---
data/org.libvirt.Connect.xml | 7 +++++++
src/connect.c | 47 ++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 54 insertions(+)
diff --git a/data/org.libvirt.Connect.xml b/data/org.libvirt.Connect.xml
index 14e66e4..ee7bfdc 100644
--- a/data/org.libvirt.Connect.xml
+++ b/data/org.libvirt.Connect.xml
@@ -94,6 +94,13 @@
<arg name="flags" type="u" direction="in"/>
<arg name="storagePoolSources" type="s" direction="out"/>
</method>
+ <method name="GetAllDomainStats">
+ <annotation name="org.gtk.GDBus.DocString"
+ value="See https://libvirt.org/html/libvirt-libvirt-domain.html#virConnectGetAllDoma..."/>
+ <arg name="stats" type="u" direction="in"/>
+ <arg name="flags" type="u" direction="in"/>
+ <arg name="records" type="a(sa{sv})" direction="out"/>
+ </method>
<method name="GetCapabilities">
<annotation name="org.gtk.GDBus.DocString"
value="See https://libvirt.org/html/libvirt-libvirt-host.html#virConnectGetCapabilities"/>
diff --git a/src/connect.c b/src/connect.c
index 1ef5c93..48db724 100644
--- a/src/connect.c
+++ b/src/connect.c
@@ -503,6 +503,52 @@ virtDBusConnectFindStoragePoolSources(GVariant *inArgs,
*outArgs = g_variant_new("(s)", ret);
}
+static void
+virtDBusConnectGetAllDomainStats(GVariant *inArgs,
+ GUnixFDList *inFDs G_GNUC_UNUSED,
+ const gchar *objectPath G_GNUC_UNUSED,
+ gpointer userData,
+ GVariant **outArgs,
+ GUnixFDList **outFDs G_GNUC_UNUSED,
+ GError **error)
+{
+ virtDBusConnect *connect = userData;
+ g_autoptr(virDomainStatsRecordPtr) records = NULL;
+ guint stats;
+ gint nstats;
+ guint flags;
+ GVariant *gret;
+ GVariantBuilder builder;
+
+ g_variant_get(inArgs, "(uu)", &stats, &flags);
+
+ if (!virtDBusConnectOpen(connect, error))
+ return;
+
+ nstats = virConnectGetAllDomainStats(connect->connection,
+ stats, &records, flags);
+ if (nstats < 0)
+ return virtDBusUtilSetLastVirtError(error);
+
+ g_variant_builder_init(&builder, G_VARIANT_TYPE("a(sa{sv})"));
+
+ for (gint i = 0; i < nstats; i++) {
+ const gchar* name;
+ GVariant *grecords;
+
+ g_variant_builder_open(&builder, G_VARIANT_TYPE("(sa{sv})"));
+ name = virDomainGetName(records[i]->dom);
+ grecords = virtDBusUtilTypedParamsToGVariant(records[i]->params,
+ records[i]->nparams);
+ g_variant_builder_add(&builder, "s", name);
+ g_variant_builder_add_value(&builder, grecords);
+ g_variant_builder_close(&builder);
+ }
+ gret = g_variant_builder_end(&builder);
+
+ *outArgs = g_variant_new_tuple(&gret, 1);
+}
+
static void
virtDBusConnectGetCPUModelNames(GVariant *inArgs,
GUnixFDList *inFDs G_GNUC_UNUSED,
@@ -808,6 +854,7 @@ static virtDBusGDBusMethodTable virtDBusConnectMethodTable[] = {
{ "DomainRestore", virtDBusConnectDomainRestoreFlags },
{ "DomainSaveImageDefineXML", virtDBusConnectDomainSaveImageDefineXML },
{ "FindStoragePoolSources", virtDBusConnectFindStoragePoolSources },
+ { "GetAllDomainStats", virtDBusConnectGetAllDomainStats },
{ "GetCapabilities", virtDBusConnectGetCapabilities },
{ "GetCPUModelNames", virtDBusConnectGetCPUModelNames },
{ "GetDomainCapabilities", virtDBusConnectGetDomainCapabilities },
--
2.15.0
6 years, 6 months
[libvirt] [PATCH] remote: remove obsolete & incorrect comment from libvirtd.conf
by Daniel P. Berrangé
The libvirtd.conf file has a comment pointing people to format.html
which has nothing todo with the configuration file format.
It also has a comment about tests/daemon-conf which no longer exists,
and even if it did exist such comment is not relevant to end users
when this file is installed in /etc/.
Signed-off-by: Daniel P. Berrangé <berrange(a)redhat.com>
---
src/remote/libvirtd.conf | 5 -----
1 file changed, 5 deletions(-)
diff --git a/src/remote/libvirtd.conf b/src/remote/libvirtd.conf
index 7d823cf1ad..28df4021aa 100644
--- a/src/remote/libvirtd.conf
+++ b/src/remote/libvirtd.conf
@@ -1,10 +1,5 @@
# Master libvirt daemon configuration file
#
-# For further information consult https://libvirt.org/format.html
-#
-# NOTE: the tests/daemon-conf regression test script requires
-# that each "PARAMETER = VALUE" line in this file have the parameter
-# name just after a leading "#".
#################################################################
#
--
2.14.3
6 years, 6 months
[libvirt] [dbus PATCH 0/8] Last APIs for Connect Interface
by Katerina Koukiou
Notes:
- I am not confident about the dummy test on StoragePoolSources.
- In GetAllDomainStats I was not able to find a way to create output
(aa{sv}) as we need. So I created simple (av), hiding the inner array
type.
Katerina Koukiou (8):
Implement BaselineCPU method for Connect Interface
Implement CompareCPU method for Connect Interface
Implement FindStoragePoolSources for Domain Interface
Move definition for g_autoptr virDomainStatsRecordPtr to util.h
Implement GetAllDomainStats method for Connect Interface
Introduce virtDBusUtilStringListFree
Implement GetCPUModelNames method for Connect Interface
Implement GetDomainCapabilties method for Connect Interface
data/org.libvirt.Connect.xml | 47 ++++++++++
src/connect.c | 219 +++++++++++++++++++++++++++++++++++++++++++
src/domain.c | 2 -
src/util.c | 9 ++
src/util.h | 9 ++
tests/test_connect.py | 9 ++
6 files changed, 293 insertions(+), 2 deletions(-)
--
2.15.0
6 years, 6 months
[libvirt] [PATCH jenkins-ci] Add missing job dependencies for libvirt-glib/virt-viewer mingw builds
by Daniel P. Berrangé
Signed-off-by: Daniel P. Berrangé <berrange(a)redhat.com>
---
projects/libvirt-glib.yaml | 4 ++--
projects/virt-viewer.yaml | 4 ++--
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/projects/libvirt-glib.yaml b/projects/libvirt-glib.yaml
index 2d0e721..286d25b 100644
--- a/projects/libvirt-glib.yaml
+++ b/projects/libvirt-glib.yaml
@@ -15,13 +15,13 @@
parent_jobs: 'libvirt-glib-master-check'
machines: '{rpm_machines}'
- autotools-build-job:
- parent_jobs:
+ parent_jobs: 'libvirt-master-build-mingw32'
variant: -mingw32
local_env: '{mingw32_local_env}'
autogen_args: '{mingw32_autogen_args}'
machines: '{mingw_machines}'
- autotools-build-job:
- parent_jobs:
+ parent_jobs: 'libvirt-master-build-mingw64'
variant: -mingw64
local_env: '{mingw64_local_env}'
autogen_args: '{mingw64_autogen_args}'
diff --git a/projects/virt-viewer.yaml b/projects/virt-viewer.yaml
index 3726cd0..633ac9a 100644
--- a/projects/virt-viewer.yaml
+++ b/projects/virt-viewer.yaml
@@ -14,13 +14,13 @@
parent_jobs: 'virt-viewer-master-check'
machines: '{rpm_machines}'
- autotools-build-job:
- parent_jobs:
+ parent_jobs: 'libvirt-glib-master-build-mingw32'
variant: -mingw32
local_env: '{mingw32_local_env}'
autogen_args: '{mingw32_autogen_args}'
machines: '{mingw_machines}'
- autotools-build-job:
- parent_jobs:
+ parent_jobs: 'libvirt-glib-master-build-mingw64'
variant: -mingw64
local_env: '{mingw64_local_env}'
autogen_args: '{mingw64_autogen_args}'
--
2.14.3
6 years, 6 months
[libvirt] [PATCH] remote: always build generated source files
by Daniel P. Berrangé
The generated source files for dispatching libvirtd RPC messages contain
translations and are thus listed in POTFILES. This means they are
required in order to build libvirt.pot. Rather than changing the files
that go into libvirt.pot dynamically, just unconditionally build the
remote driver sources so they are always available for building
libvirt.pot. This ensures we don't silently loose translation messages
based on configure args.
This fixes the mingw build which needs to create libvirt.pot but has
libvirtd disabled.
Signed-off-by: Daniel P. Berrangé <berrange(a)redhat.com>
---
Pushed to fix mingw build
src/remote/Makefile.inc.am | 17 +++++++++++------
1 file changed, 11 insertions(+), 6 deletions(-)
diff --git a/src/remote/Makefile.inc.am b/src/remote/Makefile.inc.am
index 12600b8bb5..eb8d6feb31 100644
--- a/src/remote/Makefile.inc.am
+++ b/src/remote/Makefile.inc.am
@@ -81,6 +81,17 @@ EXTRA_DIST += \
remote/libvirtd.sysctl \
$(NULL)
+# Needed to build libvirt.pot, so must be listed outside
+# the WITH_REMOTE/WITH_LIBVIRTD conditionals
+BUILT_SOURCES += \
+ $(REMOTE_DRIVER_GENERATED) \
+ $(LIBVIRTD_GENERATED) \
+ $(NULL)
+MAINTAINERCLEANFILES += \
+ $(REMOTE_DRIVER_GENERATED) \
+ $(LIBVIRTD_GENERATED) \
+ $(NULL)
+
if WITH_REMOTE
noinst_LTLIBRARIES += libvirt_driver_remote.la
libvirt_la_BUILT_LIBADD += libvirt_driver_remote.la
@@ -93,9 +104,6 @@ libvirt_driver_remote_la_CFLAGS = \
libvirt_driver_remote_la_LDFLAGS = $(AM_LDFLAGS)
libvirt_driver_remote_la_SOURCES = $(REMOTE_DRIVER_SOURCES)
-BUILT_SOURCES += $(REMOTE_DRIVER_GENERATED)
-MAINTAINERCLEANFILES += $(REMOTE_DRIVER_GENERATED)
-
endif WITH_REMOTE
if WITH_REMOTE
@@ -108,9 +116,6 @@ if WITH_LIBVIRTD
sbin_PROGRAMS += libvirtd
-BUILT_SOURCES += $(LIBVIRTD_GENERATED)
-MAINTAINERCLEANFILES += $(LIBVIRTD_GENERATED)
-
augeas_DATA += remote/libvirtd.aug
augeastest_DATA += test_libvirtd.aug
--
2.14.3
6 years, 6 months
[libvirt] [PATCH 0/2] Disallow qemu-img creation of qcow[2] encryption type
by John Ferlan
Details in the patches.
John Ferlan (2):
storage: Separate out the qemu-img help output generation
storage: Check qemu-img encryption type capability
src/storage/storage_util.c | 63 +++++++++++++++++++++++++++++++++++-----------
1 file changed, 48 insertions(+), 15 deletions(-)
--
2.13.6
6 years, 6 months