From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from MRWPR03CU001.outbound.protection.outlook.com (mail-francesouthazon11021125.outbound.protection.outlook.com [40.107.130.125]) by lore.virtuozzo.com (Postfix) with ESMTPS id B4FCD802A5 for ; Mon, 5 Oct 2026 09:26:50 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=rxqF1lDBI/FqoQXtARHgCj7q9SGV9FSrGAb/Ud3yM/Dpdz0n7tebtS2IttbQFXySH10ZGbfmq6E+CvaUGE3tATCyWz6HyP9u4vnUtjHJkOCiZbzxsjQlmjUL1udaJoOxOzvhFPmsMYvNf8FvW0Pil+xDip43RJsfSBDAnyC7v0ocvWeIbr4mo4Ehhes/4kOyNMHF7bLAP11NakmkRWJxbHCrNzasQxM2FFFZpfqPT9PaSX1cv3ynIaq3s09jwXcQ3saehW6BuPAt7yyJ0jK67wOLune5vqh8kEO0ng4UsviySl0LKUXBfmrEaR9Q/IEgkbCU4YjiC+ymfNKiaxGX0A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=z8/LP2ZdU/nnDfSjiSYonfMAxq71Z3TeQiqusbuYxx8=; b=CeSWjTJEehJ8Yve7AgqFGAh2pSgTP/xJPKLXLXkCevHZG4Jb5GHMaeQfMa69np9jZS39cH/rSU3RIHEOIHuRS5RIhz/ngWJ1zgOgfxfz2iNFevAFv70BaX7LyADCOtcbrpAKGd7dXK2OAGRAKlYOkndwj1qE4L/zXgnXoN6HZytVL0KeDzdqefG3foS5SZ45/CjL0y0YnmsP0SbaG6DIvTmKwd+08w2fMrhJja0nXtgHksTqJax0XVZJ6OgGwQF6VTJnTSVg5zHrCLqcSEkiIJmApDlfzBG7kbhPCbN5IZlRFZ1RE6mwW6QoKHHStCAMhrIE/2z1tkUi5n9cwGCalA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 2a00:1450:4864:30::e) smtp.rcpttodomain=virtuozzo.com smtp.mailfrom=openvz.org; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=openvz.org; dkim=pass (signature was verified) header.d=openvz.org; arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=virtuozzo.onmicrosoft.com; s=selector2-virtuozzo-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=z8/LP2ZdU/nnDfSjiSYonfMAxq71Z3TeQiqusbuYxx8=; b=f3oTLnxXZOG4aqf8R12fAxHRQr2bwq717WZU81UJX9JPP02vwRi5qXnCvXqVK4bUCUDH484Rfq7c0uqd2IOZtxxgXD/BwawUEpxYadtnjgzYaPpV9Y1h2vLid7GQjmTLJDnx+zhzaZxgabv86RyCzUiPRfG21i/B67Fs/Cz1LtA= Received: from PAZP264CA0252.FRAP264.PROD.OUTLOOK.COM (2603:10a6:102:239::14) by PAVPR08MB9185.eurprd08.prod.outlook.com (2603:10a6:102:30d::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.496.12; Mon, 5 Oct 2026 09:26:42 +0000 Received: from MI3PEPF00008556.eurprd05.prod.outlook.com (2603:10a6:102:239:cafe::80) by PAZP264CA0252.outlook.office365.com (2603:10a6:102:239::14) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.21.472.20 via Frontend Transport; Mon, 5 Oct 2026 09:26:40 +0000 Authentication-Results: spf=pass (sender IP is 2a00:1450:4864:30::e) smtp.mailfrom=openvz.org; dkim=pass (signature was verified) header.d=openvz.org;dmarc=pass action=none header.from=openvz.org; Received-SPF: Pass (protection.outlook.com: domain of openvz.org designates 2a00:1450:4864:30::e as permitted sender) receiver=protection.outlook.com; client-ip=2a00:1450:4864:30::e; helo=mail-wr2-x0e.google.com; pr=C Received: from mail-wr2-x0e.google.com (2a00:1450:4864:30::e) by MI3PEPF00008556.mail.protection.outlook.com (2603:10a6:298:1::8a) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.21.472.14 via Frontend Transport; Mon, 5 Oct 2026 09:26:38 +0000 Received: by mail-wr2-x0e.google.com with SMTP id ffacd0b85a97d-48af4663da5so1328007f8f.3 for ; Mon, 05 Oct 2026 02:26:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=openvz.org; s=google; t=1791192398; x=1791797198; darn=virtuozzo.com; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to:content-type; bh=z8/LP2ZdU/nnDfSjiSYonfMAxq71Z3TeQiqusbuYxx8=; b=LpSllBma0DEFNv7UsRk1K1k1qPTc8n5xVbddXqRPKK1SDfNLyK+AFzbhbPxK/odVYG 5imB1KAXh/IRqz48VUti2repumv4BFajUuK5DemEy+GrvJd7q540ChooOIKjedsOaWVq hhrSuFcmY2ePBuFvUPptrGdwe8H/Gf2i7wWKC2vH7Qj7YX80L+ETVBJlSWEdX4RHasGX WlyL/yO7LMhvcym7ZNp0Zg1sF5tbuvi0n0sv5nx8OUvm4zh/3Vv8wkJte0oaZhmBQ4yu 51eXhi81pDofZuXbZqRscaf33NO4Vwypo2a0QJGcik+NBdpTNANFLLrRl9ecXe+p6O3C YGTA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1791192398; x=1791797198; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to:content-type; bh=z8/LP2ZdU/nnDfSjiSYonfMAxq71Z3TeQiqusbuYxx8=; b=jYM1mD/ICkmMMI3ltm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69f28mr6332620f8f.4.1791192398301; Mon, 05 Oct 2026 02:26:38 -0700 (PDT) Received: from athena.sw.ru ([2a06:5b06:b600:300:bff9:47a9:54d2:1c0b]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-48c62270739sm2434715f8f.11.2026.10.05.02.26.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 05 Oct 2026 02:26:37 -0700 (PDT) From: "Denis V. Lunev" To: svt-core@virtuozzo.com Cc: andrey.drobyshev@virtuozzo.com, den@openvz.org, Maxim Nestratov Subject: [PATCH hci-8.0 v2 0/3] chardev: fix qemu-update destroying VMs with a console log #VSTOR-148304 Date: Mon, 5 Oct 2026 11:26:32 +0200 Message-ID: <20261005092635.3564485-1-den@openvz.org> X-Mailer: git-send-email 2.53.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-EOPAttributedMessage: 0 X-EOPTenantAttributedMessage: 0bc7f26d-0264-416e-a6fc-8352af79c58f:0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: MI3PEPF00008556:EE_|PAVPR08MB9185:EE_ X-MS-Office365-Filtering-Correlation-Id: d82e24a7-0f5b-4a1f-4c63-08df22c2c262 X-LD-Processed: 0bc7f26d-0264-416e-a6fc-8352af79c58f,ExtAddr X-MS-Exchange-AtpMessageProperties: SA X-MS-Exchange-SenderADCheck: 0 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|704161411799003|82310400026|61400799027|376014|6059299003|48200799018|9140799003|43022699015|10067099003|5063699009|56012099006|3023799007|10086099003|18002099003|55112099003|16102099003; X-Microsoft-Antispam-Message-Info: BIXYm4C+XpOAyOY1jdineHOz1/RRFf9HKFUheIHxIogZdsaBWI9a9sYqGXHCI8dcYFx9IR/NE1Ls0h93qsoGk8EBENzWJXy/+5QJMiJoeV12p+1wPjXjeQMsm7mn8numafm9AvVaYmth/lIMxfrlQV5reBYKP1+LtPYuKupEvhDqS1g9rc0UiVm07n6QaySDZgv15E/4dr3CsA8M/Nf4DTcmG/kwubryNCAh3XlHW9mE7XJeX1XqUJWtFM++BWHBL3UPI36jlA8fjspBY4hxoKSYQLBb6eDYkJg/SlZWjmtAkBnsLraw/NjRbZ6w3YC3NjcBURmCFhM2L0uY7kUQzMZbRtAVf9LJBxzpm1ApA0VQqQGX3Xw6sS+UD50mm47twdh0ahLW8gE4eJF/kCKe7rVSZpnJ2ibqJDGlm0HZA9p4A3xJQK7vw3wsd167JNAhXPylTGjqSN57KxaDOU153TZlVCBIao2/fjhVTKf+z7CcYYb92ZCFFCydi8H7sfsG4DQzG7adjpJrIaWx7sDjRRrPQ2mofHCd2BkZmfHe5XzNS4s0n1ehCpOobWHuTrOfZLo1Asb+gNN1O83wCAa0bRnoe4auzNMMiRTZIk3CHxb9WBYO788qL7TTVjk9GbDISLGrN0XK9rt3tL4+TJptzZ1SvluV1m9nuZ07nZ15EOP1oL5RlupqbK5rm5p/78fZeGPplfUUAGQgq4JUpY+nIktSHyNMIOC2OB2Opn9UowEp44o98FlL10KkJh2xMK2AEYKIThULFw9kwctmO/7QC4jrf3a913Bf1M9xmgtsApIPtpaJioScZ7dpaQPM120+x8Bjc5cxtC94M55ur/jcCw== X-Forefront-Antispam-Report: CIP:2a00:1450:4864:30::e;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:mail-wr2-x0e.google.com;PTR:mail-wr2-x0e.google.com;CAT:NONE;SFS:(13230040)(704161411799003)(82310400026)(61400799027)(376014)(6059299003)(48200799018)(9140799003)(43022699015)(10067099003)(5063699009)(56012099006)(3023799007)(10086099003)(18002099003)(55112099003)(16102099003);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: mIoK1fK5XANhQQqLO59AmC0Ktdz5FalDzbpu6wuO/1ZmrD+LS+cYqqAhrTyBT6P+SfmMAEXFFZs1XVP407G8VAJ/6tCyTSMCvJf4yTfsJS+kvGgDT+MZ8vv4x3bJy8oskF/dXzLqpefzHutalC3VJwYll150etZeyu94VDRzpO1myJ4JJrnRFpRqyMyypCdB8oPdaKW+6nfxwQYwLR5PVvI5YlFUSTpgH2PG7FHiejvdgjTFWRJqTGHYI3NoVFrLR1TAkYAqUBoY4miOpL8o8vynA2tpKyaGnsc+z72CymY9Bf+lsMvp5YebaAArbiSUmqNCnE968J/qevdUasfA4ON4hpoqM61Kigtx9fyrvmZCaJdg9kCaCit48whYmFpclRSZWyJURAr4m1ijXyuezPzGNMEOwldy4U8FYvp6mKi3eaFpW+s9lPEnawGPpo5U X-ExternalRecipientOutboundConnectors: 0bc7f26d-0264-416e-a6fc-8352af79c58f X-Auto-Response-Suppress: DR, OOF, AutoReply X-OriginatorOrg: virtuozzo.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Oct 2026 09:26:38.9296 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: d82e24a7-0f5b-4a1f-4c63-08df22c2c262 X-MS-Exchange-CrossTenant-Id: 0bc7f26d-0264-416e-a6fc-8352af79c58f X-MS-Exchange-CrossTenant-AuthSource: MI3PEPF00008556.eurprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: Internet X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAVPR08MB9185 List-Id: 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//fd is read (Andrey) - R-b on 1/3 and 2/3 Signed-off-by: Denis V. Lunev Cc: Andrey Drobyshev Cc: Maxim Nestratov 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 -- 2.53.0