[libvirt] [dbus PATCH 00/10] NodeAPIs for Connect Interface
by Katerina Koukiou
Katerina Koukiou (10):
Implement NodeGetCellsFreeMemory method for Connect Interface
Implement NodeGetCPUStats method for Connect Interface
Implement NodeGetFreeMemory method for Connect Interface
Implement NodeGetInfo method for Connect Interface
Implement NodeGetMemoryParameters method in Connect Interface
Implement NodeGetMemoryStats method for Connect Interface
Implement NodeGetSecurityModel method for Domain Interface
Implement NodeSetMemoryParameters method for Connect Interface
Implement NodeSuspendForDuration method for Connect Interface
Implement NodeGetCPUMap method for Connect Interface
data/org.libvirt.Connect.xml | 63 ++++++++
src/connect.c | 342 +++++++++++++++++++++++++++++++++++++++++++
2 files changed, 405 insertions(+)
--
2.15.0
6 years, 5 months
[libvirt] [GSoC] Introduction
by Sukrit Bhatnagar
Hi,
I am Sukrit Bhatnagar, selected in GSoC '18 for the project
"Automatic freeing of resources". I will be modifying the libvirt
core C library to add functionality for GCC cleanup attribute.
Over the next couple of months, I will be discussing the general
code design in this list. I had started a similar discussion a
few weeks ago [1].
I will also be continuing the addition of virQEMUBuildBufferEscapeComma
in qemu_command.c which I had been working on as a BiteSizedTask.
Looking forward to work with the libvirt community.
[1]: https://www.redhat.com/archives/libvir-list/2018-March/msg01532.html
--
Thanks,
Sukrit Bhatnagar
6 years, 5 months
[libvirt] [jenkins-ci PATCH 0/5] guests: Enable ccache transparently
by Andrea Bolognani
This allows us to drop the ugly workaround from the Go and
MinGW templates; as a nice side-effect, we also remove the
need to hardcode most OS-dependent paths in the inventory.
Andrea Bolognani (5):
guests: Reorder tasks
guests: Figure out OS-dependent paths automatically
guests: Figure out more OS-dependent paths ahead of time
guests: Create ccache symlink farm
jobs: Remove $CC override
guests/group_vars/all/main.yml | 7 +--
guests/host_vars/libvirt-freebsd-10/main.yml | 5 --
guests/host_vars/libvirt-freebsd-11/main.yml | 5 --
guests/host_vars/libvirt-freebsd-current/main.yml | 5 --
guests/site.yml | 17 +++---
guests/tasks/paths.yml | 69 +++++++++++++++++++++++
guests/tasks/users.yml | 33 ++++++++++-
guests/templates/bashrc | 5 +-
jobs/defaults.yaml | 6 --
jobs/go.yaml | 8 ---
10 files changed, 111 insertions(+), 49 deletions(-)
create mode 100644 guests/tasks/paths.yml
--
2.14.3
6 years, 5 months
[libvirt] [PATCH v4 0/5] Enable memory-backend-file.discard-data
by Michal Privoznik
v4 of:
https://www.redhat.com/archives/libvir-list/2018-April/msg01897.html
diff to v3:
- patches 1 and 2 from the original set are pushed,
- patch 3 is split into two (1 and 2 in this series),
- Introduced new QEMU_CAPS_QOM_LIST_PROPERTIES
- virQEMUCapsProbeQMPGenericProps is called iff the capability is set
Michal Privoznik (5):
qemuMonitorJSONGetDeviceProps: Separate props processing
qemu_monitor: Introduce qemuMonitorGetObjectProps
qemu_capabilities: Introduce QEMU_CAPS_QOM_LIST_PROPERTIES
qemu_capabilities: Introduce QEMU_CAPS_OBJECT_MEMORY_FILE_DISCARD
qemu: Introduce memoryBacking/discard
docs/formatdomain.html.in | 34 +-
docs/schemas/cputypes.rng | 5 +
docs/schemas/domaincommon.rng | 10 +
src/conf/domain_conf.c | 39 +-
src/conf/domain_conf.h | 3 +
src/conf/numa_conf.c | 27 +
src/conf/numa_conf.h | 3 +
src/libvirt_private.syms | 1 +
src/qemu/qemu_capabilities.c | 20 +
src/qemu/qemu_capabilities.h | 2 +
src/qemu/qemu_command.c | 27 +-
src/qemu/qemu_monitor.c | 13 +
src/qemu/qemu_monitor.h | 3 +
src/qemu/qemu_monitor_json.c | 89 +-
src/qemu/qemu_monitor_json.h | 4 +
.../caps_2.12.0.aarch64.replies | 416 +-
tests/qemucapabilitiesdata/caps_2.12.0.aarch64.xml | 4 +-
.../qemucapabilitiesdata/caps_2.12.0.ppc64.replies | 4454 ++++++++++----------
tests/qemucapabilitiesdata/caps_2.12.0.ppc64.xml | 4 +-
.../qemucapabilitiesdata/caps_2.12.0.s390x.replies | 78 +-
tests/qemucapabilitiesdata/caps_2.12.0.s390x.xml | 2 +
.../caps_2.12.0.x86_64.replies | 804 ++--
tests/qemucapabilitiesdata/caps_2.12.0.x86_64.xml | 4 +-
tests/qemuxml2argvdata/hugepages-pages7.args | 3 +-
tests/qemuxml2argvdata/hugepages-pages7.xml | 4 +-
tests/qemuxml2argvtest.c | 3 +-
26 files changed, 3252 insertions(+), 2804 deletions(-)
--
2.16.1
6 years, 5 months
[libvirt] [PATCH] nwfilter: increase pcap buffer size to be compatible with TPACKET_V3
by Laine Stump
When an nwfilter rule sets the parameter CTRL_IP_LEARNING to "dhcp",
this turns on the "dhcpsnoop" thread, which uses libpcap to monitor
traffic on the domain's tap device and extract the IP address from the
DHCP response.
If libpcap on the host is built with TPACKET_V3 defined, the dhcpsnoop
code's initialization of the libpcap socket fails with the following
error:
virNWFilterSnoopDHCPOpen:1134 : internal error: pcap_setfilter: can't remove kernel filter: Bad file descriptor
It turns out that this was because libpcap with TPACKET_V3 defined
requires a larger buffer size than libvirt was setting (we were
setting it to 128k). Changing the buffer size to 256k eliminates the
error, and the dhcpsnoop thread once again works properly.
Thanks to Christian Ehrhardt <paelzer(a)gmail.com> for discovering that
buffer size was the problem.
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1547237
Signed-off-by: Laine Stump <laine(a)laine.org>
---
src/nwfilter/nwfilter_dhcpsnoop.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/nwfilter/nwfilter_dhcpsnoop.c b/src/nwfilter/nwfilter_dhcpsnoop.c
index 6069e70460..62eb617515 100644
--- a/src/nwfilter/nwfilter_dhcpsnoop.c
+++ b/src/nwfilter/nwfilter_dhcpsnoop.c
@@ -259,7 +259,7 @@ struct _virNWFilterDHCPDecodeJob {
* libpcap 1.5 requires a 128kb buffer
* 128 kb is bigger than (DHCP_PKT_BURST * PCAP_PBUFSIZE / 2)
*/
-# define PCAP_BUFFERSIZE (128 * 1024)
+# define PCAP_BUFFERSIZE (256 * 1024)
# define MAX_QUEUED_JOBS (DHCP_PKT_BURST + 2 * DHCP_PKT_RATE)
--
2.14.3
6 years, 5 months
[libvirt] [dbus PATCH 0/6] More DomainSet* APIs
by Katerina Koukiou
Katerina Koukiou (6):
Implement SetBlkioParameters method for Domain Interface
Implement SetBlockIOTune method for Domain Interface
Implement SetInterfaceParameters method for Domain Interface
Implement SetMemoryParameters method for Domain Interface
Implement SetNumaParameters method for Domain Interface
Implement SetSchedulerParameters method for Domain Interface
data/org.libvirt.Domain.xml | 37 ++++++++
src/domain.c | 200 ++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 237 insertions(+)
--
2.15.0
6 years, 5 months
[libvirt] [dbus PATCH v2] Implement GetIOThreadInfo method for Domain Interface
by Katerina Koukiou
Signed-off-by: Katerina Koukiou <kkoukiou(a)redhat.com>
---
data/org.libvirt.Domain.xml | 6 +++++
src/domain.c | 63 +++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 69 insertions(+)
diff --git a/data/org.libvirt.Domain.xml b/data/org.libvirt.Domain.xml
index 96b9220..531cdb5 100644
--- a/data/org.libvirt.Domain.xml
+++ b/data/org.libvirt.Domain.xml
@@ -222,6 +222,12 @@
<arg name="flags" type="u" direction="in"/>
<arg name="interfaceParameters" type="a{sv}" direction="out"/>
</method>
+ <method name="GetIOThreadInfo">
+ <annotation name="org.gtk.GDBus.DocString"
+ value="See https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainGetIOThread..."/>
+ <arg name="flags" type="u" direction="in"/>
+ <arg name="ioThreadInfo" type="a(uab)" direction="out"/>
+ </method>
<method name="GetJobInfo">
<annotation name="org.gtk.GDBus.DocString"
value="See https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainGetJobInfo"/>
diff --git a/src/domain.c b/src/domain.c
index 76eec1d..e7b4b24 100644
--- a/src/domain.c
+++ b/src/domain.c
@@ -85,6 +85,25 @@ virtDBusDomainFSInfoListClear(virtDBusDomainFSInfoList *info)
G_DEFINE_AUTO_CLEANUP_CLEAR_FUNC(virtDBusDomainFSInfoList,
virtDBusDomainFSInfoListClear);
+struct _virtDBusDomainIOThreadInfoList {
+ virDomainIOThreadInfoPtr *info;
+ gint count;
+};
+
+typedef struct _virtDBusDomainIOThreadInfoList virtDBusDomainIOThreadInfoList;
+
+static void
+virtDBusDomainIOThreadInfoListClear(virtDBusDomainIOThreadInfoList *info)
+{
+ for (gint i = 0; i < info->count; i++)
+ virDomainIOThreadInfoFree(info->info[i]);
+
+ g_free(info->info);
+}
+
+G_DEFINE_AUTO_CLEANUP_CLEAR_FUNC(virtDBusDomainIOThreadInfoList,
+ virtDBusDomainIOThreadInfoListClear);
+
static GVariant *
virtDBusDomainMemoryStatsToGVariant(virDomainMemoryStatPtr stats,
gint nr_stats)
@@ -1218,6 +1237,49 @@ virtDBusDomainGetInterfaceParameters(GVariant *inArgs,
*outArgs = g_variant_new_tuple(&grecords, 1);
}
+static void
+virtDBusDomainGetIOThreadInfo(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(virDomain) domain = NULL;
+ g_auto(virtDBusDomainIOThreadInfoList) info = { 0 };
+ GVariantBuilder builder;
+ guint flags;
+ GVariant *gret;
+
+ g_variant_get(inArgs, "(u)", &flags);
+
+ domain = virtDBusDomainGetVirDomain(connect, objectPath, error);
+ if (!domain)
+ return;
+
+ info.count = virDomainGetIOThreadInfo(domain, &info.info, flags);
+ if (info.count < 0)
+ return virtDBusUtilSetLastVirtError(error);
+
+ g_variant_builder_init(&builder, G_VARIANT_TYPE("a(uab)"));
+
+ for (gint i = 0; i < info.count; i++) {
+ g_variant_builder_open(&builder, G_VARIANT_TYPE("(uab)"));
+ g_variant_builder_add(&builder, "u", info.info[i]->iothread_id);
+
+ g_variant_builder_open(&builder, G_VARIANT_TYPE("ab"));
+ for (gint j = 0; j < info.info[i]->cpumaplen; j++)
+ g_variant_builder_add(&builder, "b", info.info[i]->cpumap[j]);
+ g_variant_builder_close(&builder);
+ g_variant_builder_close(&builder);
+ }
+ gret = g_variant_builder_end(&builder);
+
+ *outArgs = g_variant_new_tuple(&gret, 1);
+}
+
static void
virtDBusDomainGetJobInfo(GVariant *inArgs G_GNUC_UNUSED,
GUnixFDList *inFDs G_GNUC_UNUSED,
@@ -2457,6 +2519,7 @@ static virtDBusGDBusMethodTable virtDBusDomainMethodTable[] = {
{ "GetGuestVcpus", virtDBusDomainGetGuestVcpus },
{ "GetHostname", virtDBusDomainGetHostname },
{ "GetInterfaceParameters", virtDBusDomainGetInterfaceParameters },
+ { "GetIOThreadInfo", virtDBusDomainGetIOThreadInfo },
{ "GetJobInfo", virtDBusDomainGetJobInfo },
{ "GetJobStats", virtDBusDomainGetJobStats },
{ "GetMemoryParameters", virtDBusDomainGetMemoryParameters },
--
2.15.0
6 years, 5 months
[libvirt] [PATCH] syntax-check: pass srcdir to group-qemu-caps.pl
by Ján Tomko
The script assumed to be run in the source directory.
Pass top_srcdir as the argument to fix VPATH builds.
My commit 81a7571 broke this.
Signed-off-by: Ján Tomko <jtomko(a)redhat.com>
---
Pushed as a build-breaker fix.
cfg.mk | 2 +-
tests/group-qemu-caps.pl | 10 ++++++++--
2 files changed, 9 insertions(+), 3 deletions(-)
diff --git a/cfg.mk b/cfg.mk
index 158d4cbd73..c3d18279ce 100644
--- a/cfg.mk
+++ b/cfg.mk
@@ -1120,7 +1120,7 @@ test-wrap-argv:
$(PERL) $(top_srcdir)/tests/test-wrap-argv.pl --check $$files
group-qemu-caps:
- $(PERL) $(top_srcdir)/tests/group-qemu-caps.pl --check
+ $(PERL) $(top_srcdir)/tests/group-qemu-caps.pl --check $(top_srcdir)/
# sc_po_check can fail if generated files are not built first
sc_po_check: \
diff --git a/tests/group-qemu-caps.pl b/tests/group-qemu-caps.pl
index 847e360254..514764f47f 100755
--- a/tests/group-qemu-caps.pl
+++ b/tests/group-qemu-caps.pl
@@ -31,15 +31,21 @@ if (defined $ARGV[0] && $ARGV[0] eq "--check") {
shift @ARGV;
}
+my $prefix = '';
+if (defined $ARGV[0]) {
+ $prefix = $ARGV[0];
+ shift @ARGV;
+}
+
my $ret = 0;
-if (®roup_caps('src/qemu/qemu_capabilities.c',
+if (®roup_caps($prefix . 'src/qemu/qemu_capabilities.c',
'^VIR_ENUM_IMPL\(virQEMUCaps,',
'\);',
0,
" ") < 0) {
$ret = 1;
}
-if (®roup_caps('src/qemu/qemu_capabilities.h',
+if (®roup_caps($prefix . 'src/qemu/qemu_capabilities.h',
'virQEMUCapsFlags grouping marker',
'QEMU_CAPS_LAST \/\* this must',
1,
--
2.16.1
6 years, 5 months
[libvirt] [PATCH v2] logging: Don't inhibit shutdown in system daemon
by Martin Kletzander
That is a job of libvirtd and virtlogd has a dependency on it, so that will
prevent it properly. Doing it one extra time in virtlogd might also cause AVC
denials because it is not allowed to call that dbus method.
Caused by commit df34363d58bb.
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1547250
Signed-off-by: Martin Kletzander <mkletzan(a)redhat.com>
---
I have an idea how to make this way nicer, but it requires a rework and maybe
people will not like it as much, so for now this is the preferred fix.
v2:
- Don't revert the shutdown inhibition for all instances, only for the system
one.
v1:
- https://www.redhat.com/archives/libvir-list/2018-April/msg02381.html
src/logging/log_daemon.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/src/logging/log_daemon.c b/src/logging/log_daemon.c
index 35d7ebb6d2bb..91bd9d0b9052 100644
--- a/src/logging/log_daemon.c
+++ b/src/logging/log_daemon.c
@@ -128,6 +128,12 @@ virLogDaemonInhibitor(bool inhibit, void *opaque)
{
virLogDaemonPtr dmn = opaque;
+ /* virtlogd uses inhibition only to stop session daemon being killed after
+ * the specified timeout, for the system daemon this is taken care of by
+ * libvirtd and the dependencies between the services. */
+ if (virNetDaemonIsPrivileged(dmn->dmn))
+ return;
+
if (inhibit)
virNetDaemonAddShutdownInhibition(dmn->dmn);
else
--
2.17.0
6 years, 5 months
[libvirt] [PATCH] logging: Don't inhibit shutdown
by Martin Kletzander
That is a job of libvirtd and virtlogd has a dependency on it, so that will
prevent it properly. Doing it one extra time in virtlogd might also cause AVC
denials because it is not allowed to call that dbus method.
This basically reverts df34363d58bbf424d5c8170a93d3ad5dcd4afb26, but manually
due to the numerous changes since that was merged.
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1547250
Signed-off-by: Martin Kletzander <mkletzan(a)redhat.com>
---
src/logging/log_daemon.c | 19 ++-----------------
src/logging/log_handler.c | 28 ++++------------------------
src/logging/log_handler.h | 11 ++---------
3 files changed, 8 insertions(+), 50 deletions(-)
diff --git a/src/logging/log_daemon.c b/src/logging/log_daemon.c
index 35d7ebb6d2bb..9cf3fd4dbb5f 100644
--- a/src/logging/log_daemon.c
+++ b/src/logging/log_daemon.c
@@ -123,17 +123,6 @@ virLogDaemonFree(virLogDaemonPtr logd)
}
-static void
-virLogDaemonInhibitor(bool inhibit, void *opaque)
-{
- virLogDaemonPtr dmn = opaque;
-
- if (inhibit)
- virNetDaemonAddShutdownInhibition(dmn->dmn);
- else
- virNetDaemonRemoveShutdownInhibition(dmn->dmn);
-}
-
static virLogDaemonPtr
virLogDaemonNew(virLogDaemonConfigPtr config, bool privileged)
{
@@ -185,9 +174,7 @@ virLogDaemonNew(virLogDaemonConfigPtr config, bool privileged)
if (!(logd->handler = virLogHandlerNew(privileged,
config->max_size,
- config->max_backups,
- virLogDaemonInhibitor,
- logd)))
+ config->max_backups)))
goto error;
return logd;
@@ -277,9 +264,7 @@ virLogDaemonNewPostExecRestart(virJSONValuePtr object, bool privileged,
if (!(logd->handler = virLogHandlerNewPostExecRestart(child,
privileged,
config->max_size,
- config->max_backups,
- virLogDaemonInhibitor,
- logd)))
+ config->max_backups)))
goto error;
return logd;
diff --git a/src/logging/log_handler.c b/src/logging/log_handler.c
index 40dfa8ecaebe..6d4e539f078e 100644
--- a/src/logging/log_handler.c
+++ b/src/logging/log_handler.c
@@ -65,9 +65,6 @@ struct _virLogHandler {
virLogHandlerLogFilePtr *files;
size_t nfiles;
-
- virLogHandlerShutdownInhibitor inhibitor;
- void *opaque;
};
static virClassPtr virLogHandlerClass;
@@ -174,7 +171,6 @@ virLogHandlerDomainLogFileEvent(int watch,
return;
error:
- handler->inhibitor(false, handler->opaque);
virLogHandlerLogFileClose(handler, logfile);
virObjectUnlock(handler);
}
@@ -183,9 +179,7 @@ virLogHandlerDomainLogFileEvent(int watch,
virLogHandlerPtr
virLogHandlerNew(bool privileged,
size_t max_size,
- size_t max_backups,
- virLogHandlerShutdownInhibitor inhibitor,
- void *opaque)
+ size_t max_backups)
{
virLogHandlerPtr handler;
@@ -198,8 +192,6 @@ virLogHandlerNew(bool privileged,
handler->privileged = privileged;
handler->max_size = max_size;
handler->max_backups = max_backups;
- handler->inhibitor = inhibitor;
- handler->opaque = opaque;
return handler;
@@ -220,8 +212,6 @@ virLogHandlerLogFilePostExecRestart(virLogHandlerPtr handler,
if (VIR_ALLOC(file) < 0)
return NULL;
- handler->inhibitor(true, handler->opaque);
-
if ((path = virJSONValueObjectGetString(object, "path")) == NULL) {
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("Missing 'path' field in JSON document"));
@@ -276,7 +266,6 @@ virLogHandlerLogFilePostExecRestart(virLogHandlerPtr handler,
return file;
error:
- handler->inhibitor(false, handler->opaque);
virLogHandlerLogFileFree(file);
return NULL;
}
@@ -286,9 +275,7 @@ virLogHandlerPtr
virLogHandlerNewPostExecRestart(virJSONValuePtr object,
bool privileged,
size_t max_size,
- size_t max_backups,
- virLogHandlerShutdownInhibitor inhibitor,
- void *opaque)
+ size_t max_backups)
{
virLogHandlerPtr handler;
virJSONValuePtr files;
@@ -297,9 +284,7 @@ virLogHandlerNewPostExecRestart(virJSONValuePtr object,
if (!(handler = virLogHandlerNew(privileged,
max_size,
- max_backups,
- inhibitor,
- opaque)))
+ max_backups)))
return NULL;
if (!(files = virJSONValueObjectGet(object, "files"))) {
@@ -349,10 +334,8 @@ virLogHandlerDispose(void *obj)
virLogHandlerPtr handler = obj;
size_t i;
- for (i = 0; i < handler->nfiles; i++) {
- handler->inhibitor(false, handler->opaque);
+ for (i = 0; i < handler->nfiles; i++)
virLogHandlerLogFileFree(handler->files[i]);
- }
VIR_FREE(handler->files);
}
@@ -373,8 +356,6 @@ virLogHandlerDomainOpenLogFile(virLogHandlerPtr handler,
virObjectLock(handler);
- handler->inhibitor(true, handler->opaque);
-
for (i = 0; i < handler->nfiles; i++) {
if (STREQ(virRotatingFileWriterGetPath(handler->files[i]->file),
path)) {
@@ -429,7 +410,6 @@ virLogHandlerDomainOpenLogFile(virLogHandlerPtr handler,
error:
VIR_FORCE_CLOSE(pipefd[0]);
VIR_FORCE_CLOSE(pipefd[1]);
- handler->inhibitor(false, handler->opaque);
virLogHandlerLogFileFree(file);
virObjectUnlock(handler);
return -1;
diff --git a/src/logging/log_handler.h b/src/logging/log_handler.h
index 70be567ccc37..76df55c55e57 100644
--- a/src/logging/log_handler.h
+++ b/src/logging/log_handler.h
@@ -30,20 +30,13 @@ typedef struct _virLogHandler virLogHandler;
typedef virLogHandler *virLogHandlerPtr;
-typedef void (*virLogHandlerShutdownInhibitor)(bool inhibit,
- void *opaque);
-
virLogHandlerPtr virLogHandlerNew(bool privileged,
size_t max_size,
- size_t max_backups,
- virLogHandlerShutdownInhibitor inhibitor,
- void *opaque);
+ size_t max_backups);
virLogHandlerPtr virLogHandlerNewPostExecRestart(virJSONValuePtr child,
bool privileged,
size_t max_size,
- size_t max_backups,
- virLogHandlerShutdownInhibitor inhibitor,
- void *opaque);
+ size_t max_backups);
void virLogHandlerFree(virLogHandlerPtr handler);
--
2.17.0
6 years, 5 months