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: den@virtuozzo.com
Subject: Re: [PATCH 2/3] chardev: preserve the logfile fd across cpr-exec #VSTOR-148304
Date: Mon, 5 Oct 2026 12:05:23 +0300	[thread overview]
Message-ID: <da0b6628-f2f7-48a0-b25c-033adc309a71@virtuozzo.com> (raw)
In-Reply-To: <20261002164853.2130337-3-den@openvz.org>



On 10/2/26 7:48 PM, Denis V. Lunev wrote:
> From: Denis V. Lunev <den@openvz.org>
> 
> A chardev with logfile= opens the log in qemu_char_open() on every
> start, including the start of the new QEMU after cpr-exec. The backend
> fds are taken from the cpr fd registry there, the log fd is not, so the
> new process reopens the path itself.
> 
> libvirt normally opens the log through virtlogd and passes a pipe in an
> fdset. The qemu-update command line cannot carry that fdset, so it
> names the log file path. The exec'd QEMU, running as the qemu user,
> then fails to create a log it has no write access to, e.g. a 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 VM is destroyed. Where the open succeeds, the new QEMU writes
> the file directly, behind virtlogd's back.
> 
> Save the log fd in the cpr registry under the chardev label and take it
> from there on cpr-exec incoming, as the backends do. The logfile path
> is not opened at all then. If the source did not save it, run without
> a log rather than reopen the path. A failed chardev-change re-claims
> the log through the base class cpr_claim_fds(), since the replacement's
> log has displaced the entry.
> 
> Signed-off-by: Denis V. Lunev <den@openvz.org>
> ---
>  [...]

LGTM.

Nit: include/chardev/char.h:308 - comment probably needs updating (this
patch or previous one), stating that overrides must call the parent's
hook first.

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

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

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-02 16:48 [PATCH 0/3] chardev: fix qemu-update destroying VMs with a console log #VSTOR-148304 Denis V. Lunev
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 [this message]
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=da0b6628-f2f7-48a0-b25c-033adc309a71@virtuozzo.com \
    --to=andrey.drobyshev@virtuozzo.com \
    --cc=den@openvz.org \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox