Virtuozzo QEMU development (svt-core@virtuozzo.com)
 help / color / mirror / Atom feed
From: Andrey Drobyshev <andrey.drobyshev@virtuozzo.com>
To: "Denis V. Lunev" <den@openvz.org>, svt-core@virtuozzo.com
Cc: Maxim Nestratov <mnestratov@virtuozzo.com>
Subject: Re: [PATCH hci-8.0 v2 0/3] chardev: fix qemu-update destroying VMs with a console log #VSTOR-148304
Date: Mon, 5 Oct 2026 12:47:08 +0300	[thread overview]
Message-ID: <1815a20a-af2a-4a7f-a0f8-b3fac14c9edd@virtuozzo.com> (raw)
In-Reply-To: <20261005092635.3564485-1-den@openvz.org>

Reviewed-by: Andrey Drobyshev <andrey.drobyshev@virtuozzo.com>

Applied to hci-dev


On 10/5/26 12:26 PM, Denis V. Lunev wrote:
> 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
> 
> Changes in v2:
> - 1/3: the cpr_claim_fds() comment in char.h says an override must call
>   the parent's hook first (Andrey)
> - 3/3: new case for a source that did not save the log fd: the target
>   must not create the logfile path and must warn (Andrey)
> - 3/3: _open_files() skips fds closed while /proc/<pid>/fd is read
>   (Andrey)
> - R-b on 1/3 and 2/3
> 
> 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/chardev/char.h                        |   5 +-
>  include/migration/cpr.h                       |   1 +
>  tests/qemu-iotests/tests/migrate-cpr-exec     | 154 ++++++++++++++++++
>  tests/qemu-iotests/tests/migrate-cpr-exec.out |   4 +-
>  8 files changed, 202 insertions(+), 14 deletions(-)
> 
> 
> base-commit: f2f4b3de1a1be3360a77ca6ab79762466d238804


      parent reply	other threads:[~2026-10-05  9:47 UTC|newest]

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

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=1815a20a-af2a-4a7f-a0f8-b3fac14c9edd@virtuozzo.com \
    --to=andrey.drobyshev@virtuozzo.com \
    --cc=den@openvz.org \
    --cc=mnestratov@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox