[libvirt] [PATCH 0/2] Don't choke on valid NUMA nodesets on daemon restart
by Andrea Bolognani
Details in the commit message for 2/2 and the bug report
referenced therein.
Andrea Bolognani (2):
tests: Create full host NUMA topology by default
qemu: Figure out nodeset bitmap size correctly
src/qemu/qemu_domain.c | 11 +++++-
tests/qemustatusxml2xmldata/modern-in.xml | 2 +-
tests/testutilsqemu.c | 57 +++++++++++++++++++++++++++-
tests/vircapstest.c | 62 +------------------------------
4 files changed, 68 insertions(+), 64 deletions(-)
--
2.14.3
6 years, 7 months
[libvirt] [dbus PATCH] Fix memory leaks introduced by commits 40dc3b and 408a25
by Katerina Koukiou
Signed-off-by: Katerina Koukiou <kkoukiou(a)redhat.com>
---
src/domain.c | 16 ++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)
diff --git a/src/domain.c b/src/domain.c
index 6c44377..ae1b68f 100644
--- a/src/domain.c
+++ b/src/domain.c
@@ -506,7 +506,7 @@ virtDBusDomainBlockPeek(GVariant *inArgs,
gsize size;
guint flags;
g_autofree guchar *buffer = NULL;
- GVariantBuilder *builder;
+ GVariantBuilder builder;
GVariant *res;
g_variant_get(inArgs, "(&sttu)", &disk, &offset, &size, &flags);
@@ -519,11 +519,11 @@ virtDBusDomainBlockPeek(GVariant *inArgs,
if (virDomainBlockPeek(domain, disk, offset, size, buffer, flags) < 0)
return virtDBusUtilSetLastVirtError(error);
- builder = g_variant_builder_new(G_VARIANT_TYPE("ay"));
+ g_variant_builder_init(&builder, G_VARIANT_TYPE("ay"));
for (unsigned int i = 0; i < size; i++)
- g_variant_builder_add(builder, "y", buffer[i]);
+ g_variant_builder_add(&builder, "y", buffer[i]);
- res = g_variant_builder_end(builder);
+ res = g_variant_builder_end(&builder);
*outArgs = g_variant_new_tuple(&res, 1);
}
@@ -1221,7 +1221,7 @@ virtDBusDomainMemoryPeek(GVariant *inArgs,
gsize size;
guint flags;
g_autofree guchar *buffer = NULL;
- GVariantBuilder *builder;
+ GVariantBuilder builder;
GVariant *res;
g_variant_get(inArgs, "(ttu)", &offset, &size, &flags);
@@ -1234,11 +1234,11 @@ virtDBusDomainMemoryPeek(GVariant *inArgs,
if (virDomainMemoryPeek(domain, offset, size, buffer, flags) < 0)
return virtDBusUtilSetLastVirtError(error);
- builder = g_variant_builder_new(G_VARIANT_TYPE("ay"));
+ g_variant_builder_init(&builder, G_VARIANT_TYPE("ay"));
for (unsigned int i = 0; i < size; i++)
- g_variant_builder_add(builder, "y", buffer[i]);
+ g_variant_builder_add(&builder, "y", buffer[i]);
- res = g_variant_builder_end(builder);
+ res = g_variant_builder_end(&builder);
*outArgs = g_variant_new_tuple(&res, 1);
}
--
2.15.0
6 years, 7 months
[libvirt] [PATCH v2 0/7] qemu: Add support for 'write-cache' disk frontend argument (blockdev-add saga)
by Peter Krempa
Version 2:
- new and better testing against the newest capability file
- reordered test case, so that the new parameter is visibly added
Peter Krempa (7):
tests: qemu: Add helper code to lookup most recent capability file
tests: qemuxml2argv: Add infrastructure to pass output file suffix
tests: qemuxml2argv: Add infrastructure for testing with real qemuCaps
qemu: domain: Add helper for translating disk cachemode to qemu flags
tests: qemuxml2argv: Test formatting of 'write-cache' parameter
qemu: caps: Add capability for 'write-cache' parameter of disk
frontends
qemu: Format 'write-cache' parameter for disk frontends
src/qemu/qemu_capabilities.c | 5 ++
src/qemu/qemu_capabilities.h | 1 +
src/qemu/qemu_command.c | 27 +++++++
src/qemu/qemu_domain.c | 75 +++++++++++++++++
src/qemu/qemu_domain.h | 6 ++
tests/qemucapabilitiesdata/caps_2.10.0.aarch64.xml | 1 +
tests/qemucapabilitiesdata/caps_2.10.0.ppc64.xml | 1 +
tests/qemucapabilitiesdata/caps_2.10.0.s390x.xml | 1 +
tests/qemucapabilitiesdata/caps_2.10.0.x86_64.xml | 1 +
tests/qemucapabilitiesdata/caps_2.11.0.s390x.xml | 1 +
tests/qemucapabilitiesdata/caps_2.12.0.aarch64.xml | 1 +
tests/qemucapabilitiesdata/caps_2.12.0.ppc64.xml | 1 +
tests/qemucapabilitiesdata/caps_2.12.0.s390x.xml | 1 +
tests/qemucapabilitiesdata/caps_2.12.0.x86_64.xml | 1 +
tests/qemucapabilitiesdata/caps_2.7.0.s390x.xml | 1 +
tests/qemucapabilitiesdata/caps_2.7.0.x86_64.xml | 1 +
tests/qemucapabilitiesdata/caps_2.8.0.s390x.xml | 1 +
tests/qemucapabilitiesdata/caps_2.8.0.x86_64.xml | 1 +
tests/qemucapabilitiesdata/caps_2.9.0.ppc64.xml | 1 +
tests/qemucapabilitiesdata/caps_2.9.0.s390x.xml | 1 +
tests/qemucapabilitiesdata/caps_2.9.0.x86_64.xml | 1 +
.../disk-drive-write-cache.new.args | 45 +++++++++++
tests/qemuxml2argvdata/disk-drive-write-cache.xml | 45 +++++++++++
tests/qemuxml2argvtest.c | 81 ++++++++++++++++++-
tests/testutilsqemu.c | 94 ++++++++++++++++++++++
tests/testutilsqemu.h | 5 ++
26 files changed, 397 insertions(+), 3 deletions(-)
create mode 100644 tests/qemuxml2argvdata/disk-drive-write-cache.new.args
create mode 100644 tests/qemuxml2argvdata/disk-drive-write-cache.xml
--
2.16.2
6 years, 7 months
[libvirt] [dbus PATCH v2 0/3] Introduce more Domain* APIs
by Katerina Koukiou
Changes to v1:
Resending unmerged patches from previous patchset with fixed comments.
Katerina Koukiou (3):
Implement FSFreeze method for Domain Interface
Implement FSThaw method for Domain Interface
Implement GetControlInfo method for Domain Interface
data/org.libvirt.Domain.xml | 20 ++++++
src/domain.c | 144 ++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 164 insertions(+)
--
2.15.0
6 years, 7 months
[libvirt] [PATCH sandbox-image 0/9] Tweaks
by Radostin Stoyanov
This patch series introduces a few small changes towards making the code of
virt-sandbox-image compatible with PEP8.
Radostin Stoyanov (9):
pylint: Remove unused import statements
pylint: Move standard library imports on top
pylint: Use consistent indentation of 4 spaces
py3: Use 'builtins' instead of '__builtin__'
pylint: Fix white-space around keywords
setup: Add shebang
cli: Remove unused constants
cli: Remove redundant global statements
docker: Add missing import base64
libvirt_sandbox_image/cli.py | 38 +++++++++++-----------------
libvirt_sandbox_image/sources/base.py | 4 +--
libvirt_sandbox_image/sources/docker.py | 10 ++++----
libvirt_sandbox_image/sources/virtbuilder.py | 4 +--
libvirt_sandbox_image/template.py | 4 +--
scripts/virt-sandbox-image | 5 ++--
setup.py | 17 ++++++-------
7 files changed, 37 insertions(+), 45 deletions(-)
mode change 100644 => 100755 setup.py
--
2.14.3
6 years, 7 months
[libvirt] [PATCH v3 0/7] qemu: Better xml->argv testing and add support for write-cache for disks (blockdev-add saga)
by Peter Krempa
Version 3:
- renamed the testing macros
- removed hand-rolled code to compare versions
- fixed the test case to demonstrate usage of the new test-suite
- reworded comment in test suite on how to use it
Peter Krempa (7):
tests: qemu: Add helper code to lookup latest capability file
tests: qemuxml2argv: Add infrastructure to pass output file suffix
tests: qemuxml2argv: Add infrastructure for testing with real qemuCaps
qemu: domain: Add helper for translating disk cachemode to qemu flags
tests: qemuxml2argv: Test formatting of 'write-cache' parameter
qemu: caps: Add capability for 'write-cache' parameter of disk
frontends
qemu: Format 'write-cache' parameter for disk frontends
src/qemu/qemu_capabilities.c | 5 ++
src/qemu/qemu_capabilities.h | 1 +
src/qemu/qemu_command.c | 27 +++++++
src/qemu/qemu_domain.c | 75 +++++++++++++++++++
src/qemu/qemu_domain.h | 6 ++
tests/qemucapabilitiesdata/caps_2.10.0.aarch64.xml | 1 +
tests/qemucapabilitiesdata/caps_2.10.0.ppc64.xml | 1 +
tests/qemucapabilitiesdata/caps_2.10.0.s390x.xml | 1 +
tests/qemucapabilitiesdata/caps_2.10.0.x86_64.xml | 1 +
tests/qemucapabilitiesdata/caps_2.11.0.s390x.xml | 1 +
tests/qemucapabilitiesdata/caps_2.12.0.aarch64.xml | 1 +
tests/qemucapabilitiesdata/caps_2.12.0.ppc64.xml | 1 +
tests/qemucapabilitiesdata/caps_2.12.0.s390x.xml | 1 +
tests/qemucapabilitiesdata/caps_2.12.0.x86_64.xml | 1 +
tests/qemucapabilitiesdata/caps_2.7.0.s390x.xml | 1 +
tests/qemucapabilitiesdata/caps_2.7.0.x86_64.xml | 1 +
tests/qemucapabilitiesdata/caps_2.8.0.s390x.xml | 1 +
tests/qemucapabilitiesdata/caps_2.8.0.x86_64.xml | 1 +
tests/qemucapabilitiesdata/caps_2.9.0.ppc64.xml | 1 +
tests/qemucapabilitiesdata/caps_2.9.0.s390x.xml | 1 +
tests/qemucapabilitiesdata/caps_2.9.0.x86_64.xml | 1 +
.../disk-drive-write-cache.x86_64-2.6.0.args | 43 +++++++++++
.../disk-drive-write-cache.x86_64-2.7.0.args | 45 ++++++++++++
.../disk-drive-write-cache.x86_64-latest.args | 47 ++++++++++++
tests/qemuxml2argvdata/disk-drive-write-cache.xml | 45 ++++++++++++
tests/qemuxml2argvtest.c | 83 +++++++++++++++++++++-
tests/testutilsqemu.c | 63 ++++++++++++++++
tests/testutilsqemu.h | 5 ++
28 files changed, 458 insertions(+), 3 deletions(-)
create mode 100644 tests/qemuxml2argvdata/disk-drive-write-cache.x86_64-2.6.0.args
create mode 100644 tests/qemuxml2argvdata/disk-drive-write-cache.x86_64-2.7.0.args
create mode 100644 tests/qemuxml2argvdata/disk-drive-write-cache.x86_64-latest.args
create mode 100644 tests/qemuxml2argvdata/disk-drive-write-cache.xml
--
2.16.2
6 years, 7 months
[libvirt] [dbus PATCH 0/6] Some Set APIs for Domain Interface
by Katerina Koukiou
Katerina Koukiou (6):
Implement BlockJobSetSpeed for Domain Interface
Implement MigrateSetCompressionCache method for Domain Interface
Implement SetUserPassword method for Domain Interface
Implement SetTime method for Domain Interface
Implement SetMetadata method for Domain Interface
Implement SetMemoryStatsPeriod method for Domain Interface
data/org.libvirt.Domain.xml | 43 +++++++++++
src/domain.c | 178 ++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 221 insertions(+)
--
2.15.0
6 years, 7 months
[libvirt] [PATCH 0/2] vz: build fix
by Nikolay Shirokovskiy
Diff from v1:
- add patch "check scripts: handle unintialized driver vars in check-driverimpls.pl"
Nikolay Shirokovskiy (2):
check scripts: handle unintialized driver vars in check-driverimpls.pl
vz: build fix
src/check-driverimpls.pl | 2 +-
src/vz/vz_driver.c | 9 +++++----
2 files changed, 6 insertions(+), 5 deletions(-)
--
1.8.3.1
6 years, 7 months
[libvirt] [dbus PATCH v2] Implement GetDHCPLeases method for Network Interface
by Katerina Koukiou
Signed-off-by: Katerina Koukiou <kkoukiou(a)redhat.com>
---
data/org.libvirt.Network.xml | 9 ++++++
src/network.c | 74 ++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 83 insertions(+)
diff --git a/data/org.libvirt.Network.xml b/data/org.libvirt.Network.xml
index 9d522dc..cf05062 100644
--- a/data/org.libvirt.Network.xml
+++ b/data/org.libvirt.Network.xml
@@ -36,6 +36,15 @@
<annotation name="org.gtk.GDBus.DocString"
value="See https://libvirt.org/html/libvirt-libvirt-network.html#virNetworkDestroy"/>
</method>
+ <method name="GetDHCPLeases">
+ <annotation name="org.gtk.GDBus.DocString"
+ value="See https://libvirt.org/html/libvirt-libvirt-network.html#virNetworkGetDHCPLe...
+ Empty string can be used to pass a NULL as @mac argument.
+ Empty string will be returned in output for NULL variables."/>
+ <arg name="mac" type="s" direction="in"/>
+ <arg name="flags" type="u" direction="in"/>
+ <arg name="leases" type="a(stssssuss)" direction="out"/>
+ </method>
<method name="GetXMLDesc">
<annotation name="org.gtk.GDBus.DocString"
value="See https://libvirt.org/html/libvirt-libvirt-network.html#virNetworkGetXMLDesc"/>
diff --git a/src/network.c b/src/network.c
index c507225..5d24af8 100644
--- a/src/network.c
+++ b/src/network.c
@@ -3,6 +3,12 @@
#include <libvirt/libvirt.h>
+VIRT_DBUS_ENUM_DECL(virtDBusNetworkIPAddr)
+VIRT_DBUS_ENUM_IMPL(virtDBusNetworkIPAddr,
+ VIR_IP_ADDR_TYPE_LAST,
+ "ipv4",
+ "ipv6")
+
VIRT_DBUS_ENUM_DECL(virtDBusNetworkUpdateCommand)
VIRT_DBUS_ENUM_IMPL(virtDBusNetworkUpdateCommand,
VIR_NETWORK_UPDATE_COMMAND_LAST,
@@ -29,6 +35,15 @@ VIRT_DBUS_ENUM_IMPL(virtDBusNetworkUpdateSection,
"dns-txt",
"dns-srv")
+static void
+virtDBusNetworkDHCPLeaseListFree(virNetworkDHCPLeasePtr *leases)
+{
+ for (gint i = 0; leases[i] != NULL; i += 1)
+ virNetworkDHCPLeaseFree(leases[i]);
+
+ g_free(leases);
+}
+
static virNetworkPtr
virtDBusNetworkGetVirNetwork(virtDBusConnect *connect,
const gchar *objectPath,
@@ -235,6 +250,64 @@ virtDBusNetworkDestroy(GVariant *inArgs G_GNUC_UNUSED,
virtDBusUtilSetLastVirtError(error);
}
+G_DEFINE_AUTOPTR_CLEANUP_FUNC(virNetworkDHCPLeasePtr, virtDBusNetworkDHCPLeaseListFree);
+
+static void
+virtDBusNetworkGetDHCPLeases(GVariant *inArgs,
+ GUnixFDList *inFDs G_GNUC_UNUSED,
+ const gchar *objectPath,
+ gpointer userData,
+ GVariant **outArgs,
+ GUnixFDList **outFDs G_GNUC_UNUSED,
+ GError **error)
+{
+ virtDBusConnect *connect = userData;
+ g_autoptr(virNetwork) network = NULL;
+ const gchar *mac;
+ guint flags;
+ g_autoptr(virNetworkDHCPLeasePtr) leases = NULL;
+ gint nleases;
+ GVariantBuilder builder;
+ GVariant *res;
+
+ g_variant_get(inArgs, "(&su)", &mac, &flags);
+ if (g_str_equal(mac, ""))
+ mac = NULL;
+
+ network = virtDBusNetworkGetVirNetwork(connect, objectPath, error);
+ if (!network)
+ return;
+
+ nleases = virNetworkGetDHCPLeases(network, mac, &leases, flags);
+ if (nleases < 0)
+ return virtDBusUtilSetLastVirtError(error);
+
+ g_variant_builder_init(&builder, G_VARIANT_TYPE("a(stssssuss)"));
+ for (gint i = 0; i < nleases; i++) {
+ const gchar *typeStr;
+
+ virNetworkDHCPLeasePtr lease = leases[i];
+
+ typeStr = virtDBusNetworkIPAddrTypeToString(lease->type);
+ if (!typeStr) {
+ g_set_error(error, VIRT_DBUS_ERROR, VIRT_DBUS_ERROR_LIBVIRT,
+ "Can't format virIPAddrType '%d' to string.", lease->type);
+ return;
+ }
+
+ g_variant_builder_add(&builder, "(stssssuss)",
+ lease->iface, lease->expirytime,
+ typeStr, lease->mac,
+ lease->iaid ? lease->iaid : "" ,
+ lease->ipaddr, lease->prefix,
+ lease->hostname ? lease->hostname : "",
+ lease->clientid ? lease->clientid : "");
+ }
+ res = g_variant_builder_end(&builder);
+
+ *outArgs = g_variant_new_tuple(&res, 1);
+}
+
static void
virtDBusNetworkGetXMLDesc(GVariant *inArgs,
GUnixFDList *inFDs G_GNUC_UNUSED,
@@ -342,6 +415,7 @@ static virtDBusGDBusPropertyTable virtDBusNetworkPropertyTable[] = {
static virtDBusGDBusMethodTable virtDBusNetworkMethodTable[] = {
{ "Create", virtDBusNetworkCreate },
{ "Destroy", virtDBusNetworkDestroy },
+ { "GetDHCPLeases", virtDBusNetworkGetDHCPLeases },
{ "GetXMLDesc", virtDBusNetworkGetXMLDesc },
{ "Undefine", virtDBusNetworkUndefine },
{ "Update", virtDBusNetworkUpdate },
--
2.15.0
6 years, 7 months