All Virtuozzo development lists (kernel + QEMU)
 help / color / mirror / Atom feed
From: "Denis V. Lunev" <den@openvz.org>
To: svt-core@virtuozzo.com
Cc: andrey.drobyshev@virtuozzo.com, den@virtuozzo.com
Subject: [PATCH 0/3] chardev: fix qemu-update destroying VMs with a console log #VSTOR-148304
Date: Fri,  2 Oct 2026 18:48:50 +0200	[thread overview]
Message-ID: <20261002164853.2130337-1-den@openvz.org> (raw)

qemu-update destroys every running VM whose console log the qemu user
cannot create, which is the case for nova console.log on node-local
storage:

  qemu-kvm: -chardev pty,id=charserial0,logfile=.../console.log,
  logappend=on: Could not create '.../console.log': Permission denied

and the update stops on that node. libvirt passes the log to QEMU as a
virtlogd pipe in an fdset. That fdset cannot be carried over cpr-exec,
so the qemu-update command line names the log path, and the new QEMU
reopens it in qemu_char_open(). On shared storage the open succeeds,
and the VM survives, but QEMU then writes console.log directly instead
of through virtlogd.

The series keeps the log fd, i.e. the virtlogd pipe, in the cpr
registry next to the backend fds. The new QEMU never opens the logfile
path. Patch 1 gives the base chardev class a cpr_claim_fds() hook so
that the log can be re-claimed on a failed chardev-change. Patch 2 is
the fix. Patch 3 extends the cpr-exec iotest.

No libvirt change is needed: the path in the qemu-update command line
is no longer read. A vz-cpr-path placeholder there would make an exec
into an unfixed qemu-kvm fail for every VM with a console log.

The first update from a build without this series still loses the log:
the old QEMU did not save the fd, so the new one warns and runs without
a log until the VM restarts. The VM itself keeps running.

This supersedes qemu.vzs PR #7, which reopens the path and only warns
if that fails.

Tested on hci-8.0:
- migrate-cpr-exec: the new cases fail without patch 2, only the
  rollback case fails without the base cpr_claim_fds() body, all pass
  with the series; test-char and migration-test mode/{transfer,exec}
  pass
- virsh qemu-update of an Alma9 guest with a pty serial log in a
  directory the qemu user cannot write, using the source build as
  emulator: unfixed to unfixed reproduces the failure; unfixed to fixed
  keeps the VM running without a log; fixed to fixed twice keeps the
  same virtlogd pipe and console output keeps reaching console.log

Signed-off-by: Denis V. Lunev <den@openvz.org>
Cc: Andrey Drobyshev <andrey.drobyshev@virtuozzo.com>
Cc: Maxim Nestratov <mnestratov@virtuozzo.com>

Denis V. Lunev (3):
  chardev: implement cpr_claim_fds() in the base class #VSTOR-148304
  chardev: preserve the logfile fd across cpr-exec #VSTOR-148304
  iotests/migrate-cpr-exec: cover chardevs with logfile= #VSTOR-148304

 chardev/char-file.c                           |   3 +
 chardev/char-pty.c                            |   3 +
 chardev/char-socket.c                         |   3 +
 chardev/char.c                                |  43 ++++--
 include/migration/cpr.h                       |   1 +
 tests/qemu-iotests/tests/migrate-cpr-exec     | 132 ++++++++++++++++++
 tests/qemu-iotests/tests/migrate-cpr-exec.out |   4 +-
 7 files changed, 176 insertions(+), 13 deletions(-)


base-commit: f2f4b3de1a1be3360a77ca6ab79762466d238804
-- 
2.53.0


             reply	other threads:[~2026-10-02 16:49 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-02 16:48 Denis V. Lunev [this message]
2026-10-02 16:48 ` [PATCH 1/3] chardev: implement cpr_claim_fds() in the base class #VSTOR-148304 Denis V. Lunev
2026-10-02 16:50   ` no-reply
2026-10-05  9:05   ` Andrey Drobyshev
2026-10-02 16:48 ` [PATCH 2/3] chardev: preserve the logfile fd across cpr-exec #VSTOR-148304 Denis V. Lunev
2026-10-02 16:54   ` no-reply
2026-10-05  9:05   ` Andrey Drobyshev
2026-10-02 16:48 ` [PATCH 3/3] iotests/migrate-cpr-exec: cover chardevs with logfile= #VSTOR-148304 Denis V. Lunev
2026-10-02 16:55   ` no-reply
2026-10-05  9:05   ` Andrey Drobyshev

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20261002164853.2130337-1-den@openvz.org \
    --to=den@openvz.org \
    --cc=andrey.drobyshev@virtuozzo.com \
    --cc=den@virtuozzo.com \
    --cc=svt-core@virtuozzo.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.