d03e1b3ce3
User-facing breaking change: The slirp submodule for user networking got removed. It would be necessary to add the --enable-slirp option to the build and/or install the appropriate library to continue building it. Since PVE is not explicitly supporting it, it would require additionally installing the libslirp0 package on all installations and there is *very* little mention on the community forum when searching for "slirp" or "netdev user", the plan is to only enable it again if there is some real demand for it. Notable changes: * The big change for this release is the rework of job locking, using a job mutex and introducing _locked() variants of job API functions moving away from call-side AioContext locking. See (in the qemu submodule) commit 6f592e5aca ("job.c: enable job lock/unlock and remove Aiocontext locks") and previous commits for context. Changes required for the backup patches: * Use WITH_JOB_LOCK_GUARD() and call the _locked() variant of job API functions where appropriate (many are only availalbe as a _locked() variant). * Remove acquiring/releasing AioContext around functions taking the job mutex lock internally. The patch introducing sequential transaction support for jobs needs to temporarily unlock the job mutex to call job_start() when starting the next job in the transaction. * The zeroinit block driver now marks its child as primary. The documentation in include/block/block-common.h states: > Filter node has exactly one FILTERED|PRIMARY child, and may have > other children which must not have these bits Without this, an assert will trigger when copying to a zeroinit target with qemu-img convert, because bdrv_child_cb_attach() expects any non-PRIMARY child to be not FILTERED: > qemu-img convert -n -p -f raw -O raw input.raw zeroinit:output.raw > qemu-img: ../block.c:1476: bdrv_child_cb_attach: Assertion > `!(child->role & BDRV_CHILD_FILTERED)' failed. Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
62 lines
2.0 KiB
Diff
62 lines
2.0 KiB
Diff
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
From: Stefan Reiter <s.reiter@proxmox.com>
|
|
Date: Tue, 12 Jan 2021 14:12:20 +0100
|
|
Subject: [PATCH] PVE: redirect stderr to journal when daemonized
|
|
|
|
QEMU uses the logging for error messages usually, so LOG_ERR is most
|
|
fitting.
|
|
|
|
Signed-off-by: Stefan Reiter <s.reiter@proxmox.com>
|
|
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
|
|
---
|
|
meson.build | 2 ++
|
|
os-posix.c | 7 +++++--
|
|
2 files changed, 7 insertions(+), 2 deletions(-)
|
|
|
|
diff --git a/meson.build b/meson.build
|
|
index f7f5b3f253..283b0e356e 100644
|
|
--- a/meson.build
|
|
+++ b/meson.build
|
|
@@ -1526,6 +1526,7 @@ keyutils = dependency('libkeyutils', required: false,
|
|
has_gettid = cc.has_function('gettid')
|
|
|
|
libuuid = cc.find_library('uuid', required: true)
|
|
+libsystemd = cc.find_library('systemd', required: true)
|
|
libproxmox_backup_qemu = cc.find_library('proxmox_backup_qemu', required: true)
|
|
|
|
# libselinux
|
|
@@ -3096,6 +3097,7 @@ if have_block
|
|
# os-posix.c contains POSIX-specific functions used by qemu-storage-daemon,
|
|
# os-win32.c does not
|
|
blockdev_ss.add(when: 'CONFIG_POSIX', if_true: files('os-posix.c'))
|
|
+ blockdev_ss.add(when: 'CONFIG_POSIX', if_true: libsystemd)
|
|
softmmu_ss.add(when: 'CONFIG_WIN32', if_true: [files('os-win32.c')])
|
|
endif
|
|
|
|
diff --git a/os-posix.c b/os-posix.c
|
|
index 4858650c3e..c5cb12226a 100644
|
|
--- a/os-posix.c
|
|
+++ b/os-posix.c
|
|
@@ -28,6 +28,8 @@
|
|
#include <pwd.h>
|
|
#include <grp.h>
|
|
#include <libgen.h>
|
|
+#include <systemd/sd-journal.h>
|
|
+#include <syslog.h>
|
|
|
|
/* Needed early for CONFIG_BSD etc. */
|
|
#include "net/slirp.h"
|
|
@@ -287,9 +289,10 @@ void os_setup_post(void)
|
|
|
|
dup2(fd, 0);
|
|
dup2(fd, 1);
|
|
- /* In case -D is given do not redirect stderr to /dev/null */
|
|
+ /* In case -D is given do not redirect stderr to journal */
|
|
if (!qemu_log_enabled()) {
|
|
- dup2(fd, 2);
|
|
+ int journal_fd = sd_journal_stream_fd("QEMU", LOG_ERR, 0);
|
|
+ dup2(journal_fd, 2);
|
|
}
|
|
|
|
close(fd);
|