[libvirt] [PATCH 00/12] tests: remove text monitor testing infrastructure
by Ján Tomko
Ján Tomko (12):
tests: assume JSON monitor in qemuMonitorTestNewSimple
tests: always assume JSON in qemuMonitorTestNew
tests: qemuMonitorTestAddErrorResponse: use VIR_AUTOFREE
tests: qemuMonitorTestProcessCommandDefaultValidate: simplify
condition
tests: assume JSON in qemuMonitorTestIO
tests: qemuMonitorReportError: use tmp variable properly
tests: remove text monitor testing infrastructure
tests: qemuMonitorReportError: use VIR_AUTOFREE
tests: refactor qemuMonitorTestProcessCommandDefault
tests: refactor qemuMonitorTestProcessCommandDefaultValidate
tests: qemuMonitorTestAddUnexpectedErrorResponse: VIR_AUTOFREE
tests: qemuMonitorTestAddInvalidCommandResponse: VIR_AUTOFREE
tests/qemuhotplugtest.c | 2 +-
tests/qemumonitortestutils.c | 235 ++++++++++++-----------------------
tests/qemumonitortestutils.h | 9 +-
3 files changed, 84 insertions(+), 162 deletions(-)
--
2.20.1
5 years, 6 months
[libvirt] [PATCH 00/19] Use '#pragma once' in headers
by Jonathon Jongsma
Hi all,
I'm trying to get up to speed with libvirt code, so I decided to start out with a slightly
"mindless" task. I grabbed the '#pragma once' task from
https://wiki.libvirt.org/page/BiteSizedTasks. This series covers the first part of the conversion. I
chatted with Daniel Berrange briefly on IRC before starting, and he suggested that I should try to
keep patches under 100k, and maybe each driver's source files as a single patch.
I had a bit of difficulty deciding where to split the src/conf/ and src/util/ directories. So some
of the files with more changes ended up being single-file patches. I tried to combine some related
source files into patches, but at a certain point I ran out of obvious files to combine, so I
combined a bunch of smaller miscellaneous files into one larger patch. It may not be ideal, but it's
the best I could come up with. Alternative suggestions welcome.
I'll follow up with the remaining changes if this division looks acceptable.
Jonathon Jongsma (19):
Use #pragma once in driver headers
src/access: use #pragma once in headers
src/admin: use #pragma once in headers
src/bhyve: use #pragma once in headers
conf: domain: use #pragma once in headers
conf: network: use #pragma once in headers
conf: nwfilter: use #pragma once in headers
conf: node device: use #pragma once in headers
conf: storage: use #pragma once in headers
conf: misc: use #pragma once in headers
src/cpu: use #pragma once in headers
src/datatypes.h: use #pragma once
src/esx: use #pragma once in headers
src/hyperv: use #pragma once in headers
src/interface: use #pragma once in headers
src/internal.h: use #pragma once
src/libvirt_internal.h: use #pragma once
src/libxl: use #pragma once in headers
src/logging: use #pragma once in headers
src/access/viraccessdriver.h | 10 +-
src/access/viraccessdrivernop.h | 7 +-
src/access/viraccessdriverpolkit.h | 7 +-
src/access/viraccessdriverstack.h | 7 +-
src/access/viraccessmanager.h | 26 +--
src/access/viraccessperm.h | 11 +-
src/admin/admin_server.h | 9 +-
src/admin/admin_server_dispatch.h | 11 +-
src/bhyve/bhyve_capabilities.h | 11 +-
src/bhyve/bhyve_command.h | 15 +-
src/bhyve/bhyve_conf.h | 7 +-
src/bhyve/bhyve_device.h | 11 +-
src/bhyve/bhyve_domain.h | 11 +-
src/bhyve/bhyve_driver.h | 9 +-
src/bhyve/bhyve_monitor.h | 11 +-
src/bhyve/bhyve_parse_command.h | 5 +-
src/bhyve/bhyve_process.h | 7 +-
src/bhyve/bhyve_utils.h | 31 ++-
src/conf/capabilities.h | 23 +--
src/conf/cpu_conf.h | 23 +--
src/conf/device_conf.h | 33 ++-
src/conf/domain_addr.h | 16 +-
src/conf/domain_audit.h | 10 +-
src/conf/domain_capabilities.h | 15 +-
src/conf/domain_conf.h | 91 ++++-----
src/conf/domain_event.h | 11 +-
src/conf/domain_nwfilter.h | 5 +-
src/conf/interface_conf.h | 23 +--
src/conf/moment_conf.h | 11 +-
src/conf/netdev_bandwidth_conf.h | 15 +-
src/conf/netdev_vlan_conf.h | 13 +-
src/conf/netdev_vport_profile_conf.h | 14 +-
src/conf/network_conf.h | 52 +++--
src/conf/network_event.h | 11 +-
src/conf/networkcommon_conf.h | 17 +-
src/conf/node_device_conf.h | 31 ++-
src/conf/node_device_event.h | 11 +-
src/conf/node_device_util.h | 7 +-
src/conf/numa_conf.h | 18 +-
src/conf/nwfilter_conf.h | 93 ++++-----
src/conf/nwfilter_ipaddrmap.h | 5 +-
src/conf/nwfilter_params.h | 28 ++-
src/conf/object_event.h | 11 +-
src/conf/object_event_private.h | 7 +-
src/conf/secret_conf.h | 15 +-
src/conf/secret_event.h | 11 +-
src/conf/snapshot_conf.h | 13 +-
src/conf/storage_adapter_conf.h | 11 +-
src/conf/storage_capabilities.h | 8 +-
src/conf/storage_conf.h | 41 ++--
src/conf/storage_event.h | 11 +-
src/conf/virchrdev.h | 9 +-
src/conf/virconftypes.h | 5 +-
src/conf/virdomainmomentobjlist.h | 17 +-
src/conf/virdomainobjlist.h | 21 +-
src/conf/virdomainsnapshotobjlist.h | 21 +-
src/conf/virinterfaceobj.h | 7 +-
src/conf/virnetworkobj.h | 9 +-
src/conf/virnodedeviceobj.h | 13 +-
src/conf/virnwfilterbindingdef.h | 13 +-
src/conf/virnwfilterbindingobj.h | 11 +-
src/conf/virnwfilterbindingobjlist.h | 8 +-
src/conf/virnwfilterobj.h | 11 +-
src/conf/virsavecookie.h | 13 +-
src/conf/virsecretobj.h | 11 +-
src/conf/virstorageobj.h | 11 +-
src/cpu/cpu.h | 19 +-
src/cpu/cpu_arm.h | 7 +-
src/cpu/cpu_map.h | 7 +-
src/cpu/cpu_ppc64.h | 7 +-
src/cpu/cpu_ppc64_data.h | 8 +-
src/cpu/cpu_s390.h | 7 +-
src/cpu/cpu_x86.h | 9 +-
src/cpu/cpu_x86_data.h | 58 +++---
src/datatypes.h | 89 ++++----
src/driver-hypervisor.h | 12 +-
src/driver-interface.h | 12 +-
src/driver-network.h | 12 +-
src/driver-nodedev.h | 12 +-
src/driver-nwfilter.h | 12 +-
src/driver-secret.h | 12 +-
src/driver-state.h | 12 +-
src/driver-storage.h | 12 +-
src/driver-stream.h | 12 +-
src/driver.h | 37 ++--
src/esx/esx_driver.h | 5 +-
src/esx/esx_interface_driver.h | 7 +-
src/esx/esx_network_driver.h | 7 +-
src/esx/esx_private.h | 15 +-
src/esx/esx_storage_backend_iscsi.h | 7 +-
src/esx/esx_storage_backend_vmfs.h | 7 +-
src/esx/esx_storage_driver.h | 7 +-
src/esx/esx_stream.h | 9 +-
src/esx/esx_util.h | 13 +-
src/esx/esx_vi.h | 37 ++--
src/esx/esx_vi_methods.h | 11 +-
src/esx/esx_vi_types.h | 13 +-
src/hyperv/hyperv_driver.h | 5 +-
src/hyperv/hyperv_private.h | 13 +-
src/hyperv/hyperv_util.h | 9 +-
src/hyperv/hyperv_wmi.h | 21 +-
src/hyperv/hyperv_wmi_classes.h | 27 ++-
src/hyperv/openwsman.h | 35 ++--
src/interface/interface_driver.h | 5 +-
src/internal.h | 295 +++++++++++++--------------
src/libvirt_internal.h | 7 +-
src/libxl/libxl_capabilities.h | 29 ++-
src/libxl/libxl_conf.h | 101 +++++----
src/libxl/libxl_domain.h | 29 ++-
src/libxl/libxl_driver.h | 5 +-
src/libxl/libxl_logger.h | 7 +-
src/libxl/libxl_migration.h | 11 +-
src/logging/log_daemon.h | 9 +-
src/logging/log_daemon_config.h | 7 +-
src/logging/log_daemon_dispatch.h | 7 +-
src/logging/log_handler.h | 9 +-
src/logging/log_manager.h | 9 +-
117 files changed, 928 insertions(+), 1296 deletions(-)
--
2.20.1
5 years, 6 months
[libvirt] [PATCH] virNodeDeviceCapPCIDefFormat: Drop useless space before end of tags
by Michal Privoznik
Signed-off-by: Michal Privoznik <mprivozn(a)redhat.com>
---
Pushed under trivial rule.
src/conf/node_device_conf.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/conf/node_device_conf.c b/src/conf/node_device_conf.c
index 1db045d9ac..4ef92d5129 100644
--- a/src/conf/node_device_conf.c
+++ b/src/conf/node_device_conf.c
@@ -227,14 +227,14 @@ virNodeDeviceCapPCIDefFormat(virBufferPtr buf,
virBufferEscapeString(buf, ">%s</product>\n",
data->pci_dev.product_name);
else
- virBufferAddLit(buf, " />\n");
+ virBufferAddLit(buf, "/>\n");
virBufferAsprintf(buf, "<vendor id='0x%04x'",
data->pci_dev.vendor);
if (data->pci_dev.vendor_name)
virBufferEscapeString(buf, ">%s</vendor>\n",
data->pci_dev.vendor_name);
else
- virBufferAddLit(buf, " />\n");
+ virBufferAddLit(buf, "/>\n");
if (data->pci_dev.flags & VIR_NODE_DEV_CAP_FLAG_PCI_PHYSICAL_FUNCTION) {
virBufferAddLit(buf, "<capability type='phys_function'>\n");
virBufferAdjustIndent(buf, 2);
--
2.21.0
5 years, 6 months
[libvirt] [PATCH v2] qemu: fix pr-helper0 remain
by Jie Wang
If libvirt receive DISCONNECTED event and set prDaemonRunning to false,
and qemuDomainRemoveDiskDevice is performing in the meantime.
qemuDomainRemoveDiskDevice will return directly by prDaemonRunning
check, so the pr-helper0 object will remain.
In that case we should try harder and also kill the pr-helper process,
so qemuProcessKillManagedPRDaemon could use the same treatment.
Signed-off-by: Jie Wang <wangjie88(a)huawei.com>
---
src/qemu/qemu_hotplug.c | 3 +--
src/qemu/qemu_process.c | 3 ---
2 files changed, 1 insertion(+), 5 deletions(-)
diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c
index 34249bd..5e4a929 100644
--- a/src/qemu/qemu_hotplug.c
+++ b/src/qemu/qemu_hotplug.c
@@ -465,8 +465,7 @@ qemuHotplugRemoveManagedPR(virQEMUDriverPtr driver,
virErrorPtr orig_err;
int ret = -1;
- if (!priv->prDaemonRunning ||
- virDomainDefHasManagedPR(vm->def))
+ if (virDomainDefHasManagedPR(vm->def))
return 0;
virErrorPreserveLast(&orig_err);
diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c
index 47d8ca2..8070a09 100644
--- a/src/qemu/qemu_process.c
+++ b/src/qemu/qemu_process.c
@@ -2746,9 +2746,6 @@ qemuProcessKillManagedPRDaemon(virDomainObjPtr vm)
virErrorPtr orig_err;
char *pidfile;
- if (!priv->prDaemonRunning)
- return;
-
if (!(pidfile = qemuProcessBuildPRHelperPidfilePath(vm))) {
VIR_WARN("Unable to construct pr-helper pidfile path");
return;
--
2.8.3.windows.1
5 years, 6 months
[libvirt] [PATCH] qemu: domain: Log some useful data in qemuDomainStorageSourceAccessModify
by Peter Krempa
Log the flags passed to the function in a exploded state so that it's
easily visible what's happening to the image.
Signed-off-by: Peter Krempa <pkrempa(a)redhat.com>
---
src/qemu/qemu_domain.c | 13 ++++++++++---
1 file changed, 10 insertions(+), 3 deletions(-)
diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c
index 2095191cde..d28cfa4f42 100644
--- a/src/qemu/qemu_domain.c
+++ b/src/qemu/qemu_domain.c
@@ -9339,6 +9339,9 @@ qemuDomainStorageSourceAccessModify(virQEMUDriverPtr driver,
int ret = -1;
virErrorPtr orig_err = NULL;
bool chain = flags & QEMU_DOMAIN_STORAGE_SOURCE_ACCESS_CHAIN;
+ bool force_ro = flags & QEMU_DOMAIN_STORAGE_SOURCE_ACCESS_FORCE_READ_ONLY;
+ bool force_rw = flags & QEMU_DOMAIN_STORAGE_SOURCE_ACCESS_FORCE_READ_WRITE;
+ bool revoke = flags & QEMU_DOMAIN_STORAGE_SOURCE_ACCESS_REVOKE;
int rc;
bool was_readonly = src->readonly;
bool revoke_cgroup = false;
@@ -9346,14 +9349,18 @@ qemuDomainStorageSourceAccessModify(virQEMUDriverPtr driver,
bool revoke_namespace = false;
bool revoke_lockspace = false;
- if (flags & QEMU_DOMAIN_STORAGE_SOURCE_ACCESS_FORCE_READ_ONLY)
+ VIR_DEBUG("VM: '%s', src: '%s', readonly: '%d, force_ro: '%d', force_rw: '%d', revoke: '%d', chain: '%d'",
+ vm->def->name, NULLSTR(src->path), src->readonly, force_ro,
+ force_rw, revoke, chain);
+
+ if (force_ro)
src->readonly = true;
- if (flags & QEMU_DOMAIN_STORAGE_SOURCE_ACCESS_FORCE_READ_WRITE)
+ if (force_rw)
src->readonly = false;
/* just tear down the disk access */
- if (flags & QEMU_DOMAIN_STORAGE_SOURCE_ACCESS_REVOKE) {
+ if (revoke) {
virErrorPreserveLast(&orig_err);
revoke_cgroup = true;
revoke_label = true;
--
2.21.0
5 years, 6 months
[libvirt] [PATCH] qemu: Add support for overriding max threads per process limit
by Jim Fehlig
Some VM configurations may result in a large number of threads created by
the associated qemu process which can exceed the system default limit. The
maximum number of threads allowed per process is controlled by the pids
cgroup controller and is set to 16k when creating VMs with systemd's
machined service. The maximum number of threads per process is recorded
in the pids.max file under the machine's pids controller cgroup hierarchy,
e.g.
$cgrp-mnt/pids/machine.slice/machine-qemu\\x2d1\\x2dtest.scope/pids.max
Maximum threads per process is controlled with the TasksMax property of
the systemd scope for the machine. This patch adds an option to qemu.conf
which can be used to override the maximum number of threads allowed per
qemu process. If the value of option is greater than zero, it will be set
in the TasksMax property of the machine's scope after creating the machine.
Signed-off-by: Jim Fehlig <jfehlig(a)suse.com>
---
src/lxc/lxc_cgroup.c | 1 +
src/qemu/libvirtd_qemu.aug | 1 +
src/qemu/qemu.conf | 10 ++++++++++
src/qemu/qemu_cgroup.c | 1 +
src/qemu/qemu_conf.c | 2 ++
src/qemu/qemu_conf.h | 1 +
src/qemu/test_libvirtd_qemu.aug.in | 1 +
src/util/vircgroup.c | 6 +++++-
src/util/vircgroup.h | 1 +
src/util/virsystemd.c | 24 +++++++++++++++++++++++-
src/util/virsystemd.h | 3 ++-
tests/virsystemdtest.c | 12 ++++++------
12 files changed, 54 insertions(+), 9 deletions(-)
diff --git a/src/lxc/lxc_cgroup.c b/src/lxc/lxc_cgroup.c
index d93a19d684..76014f3bfd 100644
--- a/src/lxc/lxc_cgroup.c
+++ b/src/lxc/lxc_cgroup.c
@@ -455,6 +455,7 @@ virCgroupPtr virLXCCgroupCreate(virDomainDefPtr def,
nnicindexes, nicindexes,
def->resource->partition,
-1,
+ 0,
&cgroup) < 0)
goto cleanup;
diff --git a/src/qemu/libvirtd_qemu.aug b/src/qemu/libvirtd_qemu.aug
index b311f02da6..c70b903fed 100644
--- a/src/qemu/libvirtd_qemu.aug
+++ b/src/qemu/libvirtd_qemu.aug
@@ -94,6 +94,7 @@ module Libvirtd_qemu =
| limits_entry "max_core"
| bool_entry "dump_guest_core"
| str_entry "stdio_handler"
+ | int_entry "max_threads_per_process"
let device_entry = bool_entry "mac_filter"
| bool_entry "relaxed_acs_check"
diff --git a/src/qemu/qemu.conf b/src/qemu/qemu.conf
index 5a85789d81..ab044c9cf3 100644
--- a/src/qemu/qemu.conf
+++ b/src/qemu/qemu.conf
@@ -608,6 +608,16 @@
#max_processes = 0
#max_files = 0
+# If max_threads_per_process is set to a positive integer, libvirt
+# will use it to set the maximum number of threads that can be
+# created by a qemu process. Some VM configurations can result in
+# qemu processes with tens of thousands of threads. systemd-based
+# systems typically limit the number of threads per process to
+# 16k. max_threads_per_process can be used to override default
+# limits in the host OS.
+#
+#max_threads_per_process = 0
+
# If max_core is set to a non-zero integer, then QEMU will be
# permitted to create core dumps when it crashes, provided its
# RAM size is smaller than the limit set.
diff --git a/src/qemu/qemu_cgroup.c b/src/qemu/qemu_cgroup.c
index ca76c4fdfa..9603f33e8a 100644
--- a/src/qemu/qemu_cgroup.c
+++ b/src/qemu/qemu_cgroup.c
@@ -930,6 +930,7 @@ qemuInitCgroup(virDomainObjPtr vm,
nnicindexes, nicindexes,
vm->def->resource->partition,
cfg->cgroupControllers,
+ cfg->maxThreadsPerProc,
&priv->cgroup) < 0) {
if (virCgroupNewIgnoreError())
goto done;
diff --git a/src/qemu/qemu_conf.c b/src/qemu/qemu_conf.c
index daea11dacb..8ac2dc92b5 100644
--- a/src/qemu/qemu_conf.c
+++ b/src/qemu/qemu_conf.c
@@ -687,6 +687,8 @@ virQEMUDriverConfigLoadProcessEntry(virQEMUDriverConfigPtr cfg,
return -1;
if (virConfGetValueUInt(conf, "max_files", &cfg->maxFiles) < 0)
return -1;
+ if (virConfGetValueUInt(conf, "max_threads_per_process", &cfg->maxThreadsPerProc) < 0)
+ return -1;
if (virConfGetValueType(conf, "max_core") == VIR_CONF_STRING) {
if (virConfGetValueString(conf, "max_core", &corestr) < 0)
diff --git a/src/qemu/qemu_conf.h b/src/qemu/qemu_conf.h
index 983e74a3cf..48b8711cbd 100644
--- a/src/qemu/qemu_conf.h
+++ b/src/qemu/qemu_conf.h
@@ -171,6 +171,7 @@ struct _virQEMUDriverConfig {
unsigned int maxProcesses;
unsigned int maxFiles;
+ unsigned int maxThreadsPerProc;
unsigned long long maxCore;
bool dumpGuestCore;
diff --git a/src/qemu/test_libvirtd_qemu.aug.in b/src/qemu/test_libvirtd_qemu.aug.in
index fea1d308b7..ac7ad59ba8 100644
--- a/src/qemu/test_libvirtd_qemu.aug.in
+++ b/src/qemu/test_libvirtd_qemu.aug.in
@@ -75,6 +75,7 @@ module Test_libvirtd_qemu =
{ "set_process_name" = "1" }
{ "max_processes" = "0" }
{ "max_files" = "0" }
+{ "max_threads_per_process" = "0" }
{ "max_core" = "unlimited" }
{ "dump_guest_core" = "1" }
{ "mac_filter" = "1" }
diff --git a/src/util/vircgroup.c b/src/util/vircgroup.c
index f58e336404..c31c34e5f8 100644
--- a/src/util/vircgroup.c
+++ b/src/util/vircgroup.c
@@ -1106,6 +1106,7 @@ virCgroupNewMachineSystemd(const char *name,
int *nicindexes,
const char *partition,
int controllers,
+ unsigned int maxthreads,
virCgroupPtr *group)
{
int rv;
@@ -1122,7 +1123,8 @@ virCgroupNewMachineSystemd(const char *name,
isContainer,
nnicindexes,
nicindexes,
- partition)) < 0)
+ partition,
+ maxthreads)) < 0)
return rv;
if (controllers != -1)
@@ -1234,6 +1236,7 @@ virCgroupNewMachine(const char *name,
int *nicindexes,
const char *partition,
int controllers,
+ unsigned int maxthreads,
virCgroupPtr *group)
{
int rv;
@@ -1250,6 +1253,7 @@ virCgroupNewMachine(const char *name,
nicindexes,
partition,
controllers,
+ maxthreads,
group)) == 0)
return 0;
diff --git a/src/util/vircgroup.h b/src/util/vircgroup.h
index 377e0fd870..3fb99f70ef 100644
--- a/src/util/vircgroup.h
+++ b/src/util/vircgroup.h
@@ -99,6 +99,7 @@ int virCgroupNewMachine(const char *name,
int *nicindexes,
const char *partition,
int controllers,
+ unsigned int maxthreads,
virCgroupPtr *group)
ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2)
ATTRIBUTE_NONNULL(3);
diff --git a/src/util/virsystemd.c b/src/util/virsystemd.c
index 3f03e3bd63..497d100a5c 100644
--- a/src/util/virsystemd.c
+++ b/src/util/virsystemd.c
@@ -238,12 +238,14 @@ int virSystemdCreateMachine(const char *name,
bool iscontainer,
size_t nnicindexes,
int *nicindexes,
- const char *partition)
+ const char *partition,
+ unsigned int maxthreads)
{
int ret;
DBusConnection *conn;
char *creatorname = NULL;
char *slicename = NULL;
+ char *scopename = NULL;
static int hasCreateWithNetwork = 1;
if ((ret = virSystemdHasMachined()) < 0)
@@ -389,11 +391,31 @@ int virSystemdCreateMachine(const char *name,
goto cleanup;
}
+ if (maxthreads > 0) {
+ if (!(scopename = virSystemdMakeScopeName(name, drivername, false)))
+ goto cleanup;
+
+ if (virDBusCallMethod(conn,
+ NULL,
+ NULL,
+ "org.freedesktop.systemd1",
+ "/org/freedesktop/systemd1",
+ "org.freedesktop.systemd1.Manager",
+ "SetUnitProperties",
+ "sba(sv)",
+ scopename,
+ true,
+ 1,
+ "TasksMax", "t", maxthreads) < 0)
+ goto cleanup;
+ }
+
ret = 0;
cleanup:
VIR_FREE(creatorname);
VIR_FREE(slicename);
+ VIR_FREE(scopename);
return ret;
}
diff --git a/src/util/virsystemd.h b/src/util/virsystemd.h
index 7d9c0ebd62..bdce3b2e9d 100644
--- a/src/util/virsystemd.h
+++ b/src/util/virsystemd.h
@@ -37,7 +37,8 @@ int virSystemdCreateMachine(const char *name,
bool iscontainer,
size_t nnicindexes,
int *nicindexes,
- const char *partition);
+ const char *partition,
+ unsigned int maxthreads);
int virSystemdTerminateMachine(const char *name);
diff --git a/tests/virsystemdtest.c b/tests/virsystemdtest.c
index 82c02decd1..478fa844fa 100644
--- a/tests/virsystemdtest.c
+++ b/tests/virsystemdtest.c
@@ -172,7 +172,7 @@ static int testCreateContainer(const void *opaque ATTRIBUTE_UNUSED)
123,
true,
0, NULL,
- "highpriority.slice") < 0) {
+ "highpriority.slice", 0) < 0) {
fprintf(stderr, "%s", "Failed to create LXC machine\n");
return -1;
}
@@ -205,7 +205,7 @@ static int testCreateMachine(const void *opaque ATTRIBUTE_UNUSED)
123,
false,
0, NULL,
- NULL) < 0) {
+ NULL, 0) < 0) {
fprintf(stderr, "%s", "Failed to create KVM machine\n");
return -1;
}
@@ -242,7 +242,7 @@ static int testCreateNoSystemd(const void *opaque ATTRIBUTE_UNUSED)
123,
false,
0, NULL,
- NULL)) == 0) {
+ NULL, 0)) == 0) {
unsetenv("FAIL_NO_SERVICE");
fprintf(stderr, "%s", "Unexpected create machine success\n");
return -1;
@@ -276,7 +276,7 @@ static int testCreateSystemdNotRunning(const void *opaque ATTRIBUTE_UNUSED)
123,
false,
0, NULL,
- NULL)) == 0) {
+ NULL, 0)) == 0) {
unsetenv("FAIL_NOT_REGISTERED");
fprintf(stderr, "%s", "Unexpected create machine success\n");
return -1;
@@ -310,7 +310,7 @@ static int testCreateBadSystemd(const void *opaque ATTRIBUTE_UNUSED)
123,
false,
0, NULL,
- NULL)) == 0) {
+ NULL, 0)) == 0) {
unsetenv("FAIL_BAD_SERVICE");
fprintf(stderr, "%s", "Unexpected create machine success\n");
return -1;
@@ -345,7 +345,7 @@ static int testCreateNetwork(const void *opaque ATTRIBUTE_UNUSED)
123,
true,
nnicindexes, nicindexes,
- "highpriority.slice") < 0) {
+ "highpriority.slice", 0) < 0) {
fprintf(stderr, "%s", "Failed to create LXC machine\n");
return -1;
}
--
2.21.0
5 years, 6 months
[libvirt] [PATCH] build: fix linking libqemutestdriver with LTO enabled
by Jim Fehlig
openSUSE Factory is in the process of enabling Link Time Optimization [0]
and stumbled upon missing symbols when linking libqemutestdriver
libtool: link: gcc -shared -fPIC -DPIC ../src/libvirt_qemu_probes.o \
-Wl,--whole-archive ../src/.libs/libvirt_driver_qemu_impl.a \
../src/.libs/libvirt_driver_network_impl.a \
../src/.libs/libvirt_driver_storage_impl.a -Wl,--no-whole-archive \
-lcap-ng -lgnutls -lnl-route-3 -lnl-3 -ldbus-1 -lselinux -lapparmor \
/usr/lib/libxml2.so -ldl -lz -llzma -lm -lblkid -ltirpc \
-fstack-protector-strong -O2 -fstack-protector-strong -flto=16 -g -O2 \
-fstack-protector-strong -flto=16 -g \
-Wl,-soname -Wl,libqemutestdriver.so -o .libs/libqemutestdriver.so
...
/usr/lib/gcc/i586-suse-linux/9/../../../../i586-suse-linux/bin/ld: ./.libs/libqemutestdriver.so: undefined reference to `mdir_name'
/usr/lib/gcc/i586-suse-linux/9/../../../../i586-suse-linux/bin/ld: ./.libs/libqemutestdriver.so: undefined reference to `rpl_ioctl'
/usr/lib/gcc/i586-suse-linux/9/../../../../i586-suse-linux/bin/ld: ./.libs/libqemutestdriver.so: undefined reference to `rpl_pipe2'
/usr/lib/gcc/i586-suse-linux/9/../../../../i586-suse-linux/bin/ld: ./.libs/libqemutestdriver.so: undefined reference to `recvfd'
/usr/lib/gcc/i586-suse-linux/9/../../../../i586-suse-linux/bin/ld: ./.libs/libqemutestdriver.so: undefined reference to `c_strcasecmp'
The missing symbols are provided by GNUlib. Add it when linking
libqemutestdriver.
[0] https://en.opensuse.org/openSUSE:LTO
Signed-off-by: Jim Fehlig <jfehlig(a)suse.com>
---
tests/Makefile.am | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 46d94d2236..1d80647c9f 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -557,7 +557,7 @@ endif WITH_DTRACE_PROBES
libqemutestdriver_la_SOURCES =
libqemutestdriver_la_LDFLAGS = $(DRIVERLIB_LDFLAGS)
-libqemutestdriver_la_LIBADD = $(qemu_LDADDS)
+libqemutestdriver_la_LIBADD = $(qemu_LDADDS) $(GNULIB_LIBS)
qemucpumock_la_SOURCES = \
qemucpumock.c testutilshostcpus.h
@@ -729,7 +729,7 @@ lxcconf2xmltest_SOURCES = \
lxcconf2xmltest_LDADD = $(lxc_LDADDS)
else ! WITH_LXC
EXTRA_DIST += lxcxml2xmltest.c testutilslxc.c testutilslxc.h
-endif ! WITH_LXC
+-endif ! WITH_LXC
if WITH_OPENVZ
openvzutilstest_SOURCES = \
--
2.21.0
5 years, 6 months
[libvirt] [PATCH] test_driver: implement virDomainGetLaunchSecurityInfo
by Ilias Stamatis
Since this is the test driver and this is tied to AMD CPUs at the
moment, we can pretend that the domain doesn't have launch security and
always return 0 parameters.
Signed-off-by: Ilias Stamatis <stamatis.iliass(a)gmail.com>
---
src/test/test_driver.c | 13 +++++++++++++
1 file changed, 13 insertions(+)
diff --git a/src/test/test_driver.c b/src/test/test_driver.c
index 1aa79ce898..213f17808b 100644
--- a/src/test/test_driver.c
+++ b/src/test/test_driver.c
@@ -2284,6 +2284,18 @@ testDomainGetOSType(virDomainPtr dom ATTRIBUTE_UNUSED)
}
+static int
+testDomainGetLaunchSecurityInfo(virDomainPtr domain ATTRIBUTE_UNUSED,
+ virTypedParameterPtr *params ATTRIBUTE_UNUSED,
+ int *nparams,
+ unsigned int flags)
+{
+ virCheckFlags(0, -1);
+ *nparams = 0;
+ return 0;
+}
+
+
static unsigned long long
testDomainGetMaxMemory(virDomainPtr domain)
{
@@ -7011,6 +7023,7 @@ static virHypervisorDriver testHypervisorDriver = {
.domainDestroy = testDomainDestroy, /* 0.1.1 */
.domainDestroyFlags = testDomainDestroyFlags, /* 4.2.0 */
.domainGetOSType = testDomainGetOSType, /* 0.1.9 */
+ .domainGetLaunchSecurityInfo = testDomainGetLaunchSecurityInfo, /* 5.5.0 */
.domainGetMaxMemory = testDomainGetMaxMemory, /* 0.1.4 */
.domainSetMaxMemory = testDomainSetMaxMemory, /* 0.1.1 */
.domainSetMemory = testDomainSetMemory, /* 0.1.4 */
--
2.21.0
5 years, 6 months
[libvirt] [PATCH] tests: qemumonitorjson: Replace use of virReportError
by Peter Krempa
Use VIR_TEST_VERBOSE instead. This fixes the following syntax check
problem:
tests/qemumonitorjsontest.c:1409: virReportError(VIR_ERR_INTERNAL_ERROR, "arr should have been cleared");
Signed-off-by: Peter Krempa <pkrempa(a)redhat.com>
---
Pushed under the build-breaker rule.
tests/qemumonitorjsontest.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tests/qemumonitorjsontest.c b/tests/qemumonitorjsontest.c
index 68b115fa89..e087d1c256 100644
--- a/tests/qemumonitorjsontest.c
+++ b/tests/qemumonitorjsontest.c
@@ -1406,7 +1406,7 @@ testQemuMonitorJSONqemuMonitorJSONMergeBitmaps(const void *opaque)
return -1;
if (arr) {
- virReportError(VIR_ERR_INTERNAL_ERROR, "arr should have been cleared");
+ VIR_TEST_VERBOSE("arr should have been cleared");
return -1;
}
--
2.21.0
5 years, 6 months