[PATCH 0/4] Restrictive numatune mode related fixes
by Michal Privoznik
*** BLURB HERE ***
Michal Prívozník (4):
lib: Don't short circuit around virDomainCgroupSetupVcpuBW()
hypervisor: Drop dead code in virDomainCgroupSetupGlobalCpuCgroup()
ch: Explicitly forbid live changing nodeset for strict numatune
lib: Set up cpuset controller for restrictive numatune
src/ch/ch_driver.c | 2 +-
src/ch/ch_process.c | 6 +++---
src/hypervisor/domain_cgroup.c | 25 ++-----------------------
src/hypervisor/domain_cgroup.h | 3 +--
src/lxc/lxc_controller.c | 3 ++-
src/qemu/qemu_driver.c | 12 ------------
src/qemu/qemu_process.c | 11 ++++++-----
7 files changed, 15 insertions(+), 47 deletions(-)
--
2.35.1
2 years, 7 months
[PATCH] lib: Use virReportSystemError() more
by Michal Privoznik
Instead of reporting virReportError(..., g_strerror(), ...) let's
use proper virReportSystemError(). Generated with help of cocci:
@@
expression c;
@@
<...
- virReportError(c,
+ virReportSystemError(errno,
...,
- g_strerror(errno),
...);
...>
But then I had to hand fix format strings, because I'm not sure
if cocci even knows how to do that. And even if it did, I surely
don't.
Signed-off-by: Michal Privoznik <mprivozn(a)redhat.com>
---
src/libxl/libxl_conf.c | 7 +++----
src/libxl/libxl_driver.c | 35 +++++++++++++++--------------------
src/qemu/qemu_interface.c | 8 ++++----
3 files changed, 22 insertions(+), 28 deletions(-)
diff --git a/src/libxl/libxl_conf.c b/src/libxl/libxl_conf.c
index a0fc51c74a..6398129195 100644
--- a/src/libxl/libxl_conf.c
+++ b/src/libxl/libxl_conf.c
@@ -1775,10 +1775,9 @@ libxlDriverConfigInit(libxlDriverConfig *cfg)
uint64_t free_mem;
if (g_mkdir_with_parents(cfg->logDir, 0777) < 0) {
- virReportError(VIR_ERR_INTERNAL_ERROR,
- _("failed to create log dir '%s': %s"),
- cfg->logDir,
- g_strerror(errno));
+ virReportSystemError(errno,
+ _("failed to create log dir '%s'"),
+ cfg->logDir);
return -1;
}
diff --git a/src/libxl/libxl_driver.c b/src/libxl/libxl_driver.c
index 01f281d0a5..5d76eb9752 100644
--- a/src/libxl/libxl_driver.c
+++ b/src/libxl/libxl_driver.c
@@ -721,38 +721,33 @@ libxlStateInitialize(bool privileged,
libxl_driver->config = cfg;
if (g_mkdir_with_parents(cfg->stateDir, 0777) < 0) {
- virReportError(VIR_ERR_INTERNAL_ERROR,
- _("failed to create state dir '%s': %s"),
- cfg->stateDir,
- g_strerror(errno));
+ virReportSystemError(errno,
+ _("failed to create state dir '%s'"),
+ cfg->stateDir);
goto error;
}
if (g_mkdir_with_parents(cfg->libDir, 0777) < 0) {
- virReportError(VIR_ERR_INTERNAL_ERROR,
- _("failed to create lib dir '%s': %s"),
- cfg->libDir,
- g_strerror(errno));
+ virReportSystemError(errno,
+ _("failed to create lib dir '%s'"),
+ cfg->libDir);
goto error;
}
if (g_mkdir_with_parents(cfg->saveDir, 0777) < 0) {
- virReportError(VIR_ERR_INTERNAL_ERROR,
- _("failed to create save dir '%s': %s"),
- cfg->saveDir,
- g_strerror(errno));
+ virReportSystemError(errno,
+ _("failed to create save dir '%s'"),
+ cfg->saveDir);
goto error;
}
if (g_mkdir_with_parents(cfg->autoDumpDir, 0777) < 0) {
- virReportError(VIR_ERR_INTERNAL_ERROR,
- _("failed to create dump dir '%s': %s"),
- cfg->autoDumpDir,
- g_strerror(errno));
+ virReportSystemError(errno,
+ _("failed to create dump dir '%s'"),
+ cfg->autoDumpDir);
goto error;
}
if (g_mkdir_with_parents(cfg->channelDir, 0777) < 0) {
- virReportError(VIR_ERR_INTERNAL_ERROR,
- _("failed to create channel dir '%s': %s"),
- cfg->channelDir,
- g_strerror(errno));
+ virReportSystemError(errno,
+ _("failed to create channel dir '%s'"),
+ cfg->channelDir);
goto error;
}
diff --git a/src/qemu/qemu_interface.c b/src/qemu/qemu_interface.c
index 676bc896d6..d0dcce5690 100644
--- a/src/qemu/qemu_interface.c
+++ b/src/qemu/qemu_interface.c
@@ -370,10 +370,10 @@ qemuCreateInBridgePortWithHelper(virQEMUDriverConfig *cfg,
if (errbuf && *errbuf)
errstr = g_strdup_printf("\nstderr=%s", errbuf);
- virReportError(VIR_ERR_INTERNAL_ERROR,
- _("%s: failed to communicate with bridge helper: %s%s"),
- cmdstr, g_strerror(errno),
- NULLSTR_EMPTY(errstr));
+ virReportSystemError(errno,
+ _("%s: failed to communicate with bridge helper: %s"),
+ cmdstr,
+ NULLSTR_EMPTY(errstr));
VIR_FREE(errstr);
goto cleanup;
}
--
2.35.1
2 years, 7 months
[PATCH 0/7] docs: Convert some pages to rST and clean up (part 3)
by Peter Krempa
This iteration has some patches from Pavel who also converted the pages
to RST but didn't send it out yet. Included are those that didn't
diverge yet.
Additionally since I've moved the descriptions of types used in the C#
bindings to the libvirt-csharp repo this series also cleans out the
redundancy and converts the 'csharp' page.
Pavel Hrdina (4):
docs: convert 'dbus' page to rst
docs: convert 'python' page to rst
docs: convert 'tlscerts' page to rst
docs: convert 'windows' page to rst
Peter Krempa (3):
docs: Move 'tlscerts' page to 'kbase/'
docs: csharp: Remove project-specific information
docs: convert 'csharp' page to rst
docs/csharp.html.in | 470 ----------------------------------------
docs/csharp.rst | 38 ++++
docs/daemons.rst | 2 +-
docs/dbus.html.in | 94 --------
docs/dbus.rst | 75 +++++++
docs/docs.html.in | 3 -
docs/kbase/index.rst | 3 +
docs/kbase/meson.build | 1 +
docs/kbase/tlscerts.rst | 331 ++++++++++++++++++++++++++++
docs/meson.build | 9 +-
docs/python.html.in | 72 ------
docs/python.rst | 79 +++++++
docs/remote.html.in | 2 +-
docs/tlscerts.html.in | 413 -----------------------------------
docs/windows.html.in | 194 -----------------
docs/windows.rst | 139 ++++++++++++
16 files changed, 672 insertions(+), 1253 deletions(-)
delete mode 100644 docs/csharp.html.in
create mode 100644 docs/csharp.rst
delete mode 100644 docs/dbus.html.in
create mode 100644 docs/dbus.rst
create mode 100644 docs/kbase/tlscerts.rst
delete mode 100644 docs/python.html.in
create mode 100644 docs/python.rst
delete mode 100644 docs/tlscerts.html.in
delete mode 100644 docs/windows.html.in
create mode 100644 docs/windows.rst
--
2.35.1
2 years, 7 months
[PATCH v1 0/4] Add 'version' to other exported types
by Victor Toso
Hi,
This series is an extension of what Daniel did in e0e0bf6628 "scripts:
include function versions in API definition".
The main motivation behind this is to help code generators to consider
if a given symbol is present in a given version of libvirt that they are
either running/building against, more specifically:
https://gitlab.com/libvirt/libvirt-go-module/-/merge_requests/7
As headers are already a great source of documentation for developers,
I'm suggesting to add a specific comment to each of this exported types:
/* ... Since <version> */
For the use case I mentioned above, I'm adding small parsing function in
apibuild.py to fetch the above metadata and included it on the generated
XML API.
To avoid adding too much noise in the githistory, I'm proposing the
addition of symbols.versions.allowlist file, that apibuild.py can use to
fetch the first git tag that a given symbol appeared in. I did a small
script to generate it, but it sums up to calling the bellow command for
any tag that starts with 'v' and has not '-rc'.
git grep $symbol $tag ./include
I'm trying the simples approach I could find but I'm happy to improve
this further based on your suggestions.
Ah, the diff in the generated XMLs, per patch (sadly, pasteben drops it
after a single day). The initial reference is current master 67c77744d7
'tests: Fixing compiler warning in cputest'
0001 (enums) ... https://paste.centos.org/view/e9137ef0
0002 (typedefs) https://paste.centos.org/view/76f0b397
0003 (macros) .. https://paste.centos.org/view/b68fb03a
0004 (variables) https://paste.centos.org/view/4a20d9bb
Cheers,
Victor
Victor Toso (4):
scripts: apibuild: parse 'Since' version for enums
scripts: apibuild: parse 'Since' for typedefs
scripts: apibuild: parse 'Since' for macros
scripts: apibuild: add 'version' to variables
scripts/apibuild.py | 68 +-
symbols.versions.allowlist | 2144 ++++++++++++++++++++++++++++++++++++
2 files changed, 2199 insertions(+), 13 deletions(-)
create mode 100644 symbols.versions.allowlist
--
2.35.1
2 years, 7 months
[PATCH] qemu: Rename @main variable in qemuDomainRemoveLogs()
by Michal Privoznik
Older GCC fails to understand that 'char *main' is a variable and
not main() function. Rename the variable to appease old GCC.
Signed-off-by: Michal Privoznik <mprivozn(a)redhat.com>
---
src/qemu/qemu_domain.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c
index c35e5c09a3..a4334de158 100644
--- a/src/qemu/qemu_domain.c
+++ b/src/qemu/qemu_domain.c
@@ -11828,7 +11828,7 @@ qemuDomainRemoveLogs(virQEMUDriver *driver,
{
g_autoptr(virQEMUDriverConfig) cfg = NULL;
g_autofree char *format = NULL;
- g_autofree char *main = NULL;
+ g_autofree char *main_log = NULL;
g_autoptr(DIR) dir = NULL;
struct dirent *entry;
int rc;
@@ -11840,13 +11840,13 @@ qemuDomainRemoveLogs(virQEMUDriver *driver,
if (virDirOpen(&dir, cfg->logDir) < 0)
return -1;
- main = g_strdup_printf("%s.log", name);
+ main_log = g_strdup_printf("%s.log", name);
format = g_strdup_printf("%s.log.%%u", name);
while ((rc = virDirRead(dir, &entry, cfg->logDir)) > 0) {
unsigned int u;
- if (STREQ(entry->d_name, main) ||
+ if (STREQ(entry->d_name, main_log) ||
sscanf(entry->d_name, format, &u) == 1) {
g_autofree char *path = NULL;
--
2.35.1
2 years, 7 months
[PATCH] virsh: Remove any reference of KVM device assignment
by Michal Privoznik
The KVM device assignment was removed in v5.7.0-rc1~103 but virsh
and its manpage still mention it. Don't do that.
Signed-off-by: Michal Privoznik <mprivozn(a)redhat.com>
---
docs/manpages/virsh.rst | 7 +++----
tools/virsh-nodedev.c | 2 +-
2 files changed, 4 insertions(+), 5 deletions(-)
diff --git a/docs/manpages/virsh.rst b/docs/manpages/virsh.rst
index d2e6528533..215beabd96 100644
--- a/docs/manpages/virsh.rst
+++ b/docs/manpages/virsh.rst
@@ -5198,10 +5198,9 @@ guests via <hostdev> passthrough. This is reversed with
``nodedev-reattach``, and is done automatically for managed devices.
Different backend drivers expect the device to be bound to different
-dummy devices. For example, QEMU's "kvm" backend driver (the default)
-expects the device to be bound to pci-stub, but its "vfio" backend
-driver expects the device to be bound to vfio-pci. The *--driver*
-parameter can be used to specify the desired backend driver.
+dummy devices. For example, QEMU's "vfio" backend driver expects the
+device to be bound to vfio-pci. The *--driver* parameter can be used
+to specify the desired backend driver.
nodedev-dumpxml
diff --git a/tools/virsh-nodedev.c b/tools/virsh-nodedev.c
index d21b2baab6..90066249af 100644
--- a/tools/virsh-nodedev.c
+++ b/tools/virsh-nodedev.c
@@ -615,7 +615,7 @@ static const vshCmdOptDef opts_node_device_detach[] = {
{.name = "driver",
.type = VSH_OT_STRING,
.completer = virshNodeDevicePCIBackendCompleter,
- .help = N_("pci device assignment backend driver (e.g. 'vfio' or 'kvm')")
+ .help = N_("pci device assignment backend driver (e.g. 'vfio' or 'xen')")
},
{.name = NULL}
};
--
2.35.1
2 years, 7 months
[PATCH v2 0/4] VirtioNet RSS support.
by Andrew Melnychenko
This series of patches add RSS property support for virtio-net-pci.
Virtio RSS effectively works with TAP devices, it requires additional
vectors for VirtioNet, queues for TAP device, and vCPU cores.
Example of device configuration:
```
<interface type="network">
<mac address="52:54:00:c4:90:25"/>
<source network="default"/>
<model type="virtio"/>
<driver name="qemu" queues="9" rss="on" rss_hash_report="off"/>
<address type="pci" domain="0x0000" bus="0x01" slot="0x00" function="0x0"/>
</interface>
```
Capability "rss" enables RSS, "rss_hash_report" - enables hashes in vheader.
For now, "rss" property will trigger "in-qemu" RSS in most cases.
Current Qemu(6.2) supports eBPF RSS that may require additional capabilities.
In future, the helper will be provided. And this code is the base for VirtIO RSS.
Changes since v1:
* refactored patches
* changed docs and tests
Changes since RFC:
* rebased and refactored
* added tests
* postponed the helper
Andrew Melnychenko (4):
domain_conf: Added configs for RSS and Hash report.
qemu_capabilities: Added capabilites for qemu's "rss" and "hash".
qemu_command: Added "rss" and "hash" properties.
test: Added xml2argv and xml2xml tests.
docs/formatdomain.rst | 18 ++++++++
docs/schemas/domaincommon.rng | 10 +++++
src/conf/domain_conf.c | 31 ++++++++++++-
src/conf/domain_conf.h | 2 +
src/qemu/qemu_capabilities.c | 2 +
src/qemu/qemu_capabilities.h | 1 +
src/qemu/qemu_command.c | 2 +
src/qemu/qemu_validate.c | 14 ++++++
.../caps_5.1.0.x86_64.xml | 1 +
.../caps_5.2.0.aarch64.xml | 1 +
.../qemucapabilitiesdata/caps_5.2.0.ppc64.xml | 1 +
.../caps_5.2.0.riscv64.xml | 1 +
.../qemucapabilitiesdata/caps_5.2.0.s390x.xml | 1 +
.../caps_5.2.0.x86_64.xml | 1 +
.../caps_6.0.0.aarch64.xml | 1 +
.../qemucapabilitiesdata/caps_6.0.0.s390x.xml | 1 +
.../caps_6.0.0.x86_64.xml | 1 +
.../caps_6.1.0.x86_64.xml | 1 +
.../caps_6.2.0.aarch64.xml | 1 +
.../qemucapabilitiesdata/caps_6.2.0.ppc64.xml | 1 +
.../caps_6.2.0.x86_64.xml | 1 +
.../net-virtio-rss.x86_64-latest.args | 43 +++++++++++++++++++
tests/qemuxml2argvdata/net-virtio-rss.xml | 39 +++++++++++++++++
.../virtio-options.x86_64-latest.args | 2 +-
tests/qemuxml2argvdata/virtio-options.xml | 2 +-
tests/qemuxml2argvtest.c | 2 +
26 files changed, 178 insertions(+), 3 deletions(-)
create mode 100644 tests/qemuxml2argvdata/net-virtio-rss.x86_64-latest.args
create mode 100644 tests/qemuxml2argvdata/net-virtio-rss.xml
--
2.34.1
2 years, 7 months
[PATCH] qemu: disarm fake reboot flag on reset
by Nikolay Shirokovskiy
From: Maxim Nestratov <mnestratov(a)virtuozzo.com>
This is a quite an old (created at 2016) patch fixing an issue for at
that time contemporary Fedora 23. virsh reboot returns success (yet
after hanging for a while), VM is rebooted sucessfully too but then
shutdown from inside guest causes reboot and not shutdown.
VM has agent installed. So virsh reboot first tries to reboot VM thru
the agent. The agent calls 'shutdown -r' command. Typically it returns
instantly but on this distro for some reason it takes time. I did not
investigate the cause but the command waits in dbus client code,
probably waits for reply. The libvirt waits 60s for agent command to
execute and then errors out. Next reboot API falls back to ACPI shutdown
which returns successfully thus the reboot command return success too.
Yet shutdown command in guest eventually successfull and guest is truly
rebooted. So libvirt does not receive SHUTDOWN event and fake reboot
flag which is armed on fallback path stays armed. Thus next shutdown
from guest leads to reboot.
The issue has 100% repro on Fedora 23. On modern distros I can't
reproduce it at all. Shutdown command is asynchronous and returns
immediately even if I start some service that ignores TERM signal and
thus shutdown procedure waits for 90s (if I not mistaken) before sending
KILL.
Yet I guess it is nice to have this patch to be more robust.
Signed-off-by: Nikolay Shirokovskiy <nikolay.shirokovskiy(a)openvz.org>
---
src/qemu/qemu_process.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c
index f63fc3389d..d81ed9391a 100644
--- a/src/qemu/qemu_process.c
+++ b/src/qemu/qemu_process.c
@@ -435,6 +435,7 @@ qemuProcessHandleReset(qemuMonitor *mon G_GNUC_UNUSED,
if (priv->agent)
qemuAgentNotifyEvent(priv->agent, QEMU_AGENT_EVENT_RESET);
+ qemuDomainSetFakeReboot(vm, false);
qemuDomainSaveStatus(vm);
unlock:
--
2.35.1
2 years, 7 months
libvirt: introduce VIR_DOMAIN_DESTROY_REMOVE_LOGS flag
by Nikolay Shirokovskiy
The patch series based on discussion in RFC [1].
I wonder if we'd better add some property like "transient logs" instead
of adding a flag to destoy API.
Yes libguestfs uses virDomainDestroyFlags to terminate a VM and it is
intended client of this new flag but it or other clients may want to use
shutdown API or use autodestroy domains with same log behaviour. Then
for the current task we only need to support this property in domain xml
I guess.
[1] removing VMs logs
https://listman.redhat.com/archives/libvir-list/2022-February/msg00273.html
Nikolay Shirokovskiy (3):
libvirt: introduce VIR_DOMAIN_DESTROY_REMOVE_LOGS flag
qemu: support VIR_DOMAIN_DESTROY_REMOVE_LOGS flag
tools: support --remove-logs flag on destroing domain
docs/manpages/virsh.rst | 7 +++++-
include/libvirt/libvirt-domain.h | 1 +
src/libvirt-domain.c | 6 +++++
src/qemu/qemu_domain.c | 41 ++++++++++++++++++++++++++++++++
src/qemu/qemu_domain.h | 4 ++++
src/qemu/qemu_driver.c | 8 ++++++-
tools/virsh-domain.c | 8 ++++++-
7 files changed, 72 insertions(+), 3 deletions(-)
--
2.31.1
2 years, 7 months