From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from AS8PR04CU009.outbound.protection.outlook.com (mail-westeuropeazon11021129.outbound.protection.outlook.com [52.101.70.129]) by lore.virtuozzo.com (Postfix) with ESMTPS id DBBAD802A7 for ; Fri, 2 Oct 2026 16:49:07 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=k0qpI0WPRjoaScKajpd7Gv5Z1ek0pg2wrx+qFOFQer7vr/0tCNj9vXbDJev/uOcVXGWg0qbVKnYNPSxV3askF+Z1f8hABb9n1jmcdgraLV4Xw05UwpB3MusNggn2Btdla9LmBW5yI/8Aafzbd/ejkz5QgWQ8cop13R0HV0CX+hY1We2c2UVkUzBOV3BZ3Fc1Z3TpPQJGxi59j0TXmA/9JOv0yoP/1jVVyzP2adUvlifVTiCJ77QpAG03/hykZZNbZxjorgIuYQ+OQJLCxRL04q3nhxEdVxsV2bxCYwkxw1P2c0SAKltJPJs2mqtoygKFaWMJFJkWodrnHSpuObV5FA== 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=jMfj4QCF0boCbqUVP1JbRz5r/aOH1tserNiAjgWuk4o=; b=PyrF1HgJoz35YN4l5liv3JWJSVCK4z8nrX76K4wZ258+gmBW+zHwBR+zF/X5KnaCxJ/E6yPbQqnk+GSt5XumP6Zyk5NBl9aFqJcqz+ui4HkuDt5fIZsHRMVXe8q2BE3H9mB6g0bf4WOMVuket5wcn8psieHdGiF7E7csFoBG61teiI55+JR+OHPXCnue1Rc0I2y9d3zgZkp8yGfxlQKTlqgemmgz5OSN/gMW3llyidUtei3FBQQSfDI57YvzcpyRtNB0/Rfv6ZWdVkYhxwwvUzeGf5FUiEg+5mxC/Uqr3O3aGFdTWKymktc/B/sVbDPCRngrGB8YcDpTV1OUFP97PQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 2a00:1450:4864:30::17) 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=jMfj4QCF0boCbqUVP1JbRz5r/aOH1tserNiAjgWuk4o=; b=WTcvkLU/OB7n1uOhV8WUyFpasNuV7nK1aHr9vlwc+4pcrbnSbUNFECFCI6VDTKaB7Bmt/yvwh9wOOd4zSos/MTSUg57rr+WsooT8vJhAjIlp1xD6EwC63fTEmhSqHTjCqOeXCyGTflCikJJiE5f9AyLQ8WpAjaR+NSu0VkFbbKM= Received: from DU2PR04CA0011.eurprd04.prod.outlook.com (2603:10a6:10:3b::16) by VE1PR08MB5568.eurprd08.prod.outlook.com (2603:10a6:800:1a8::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.472.14; Fri, 2 Oct 2026 16:49:02 +0000 Received: from DU6PEPF0000A7E4.eurprd02.prod.outlook.com (2603:10a6:10:3b:cafe::c) by DU2PR04CA0011.outlook.office365.com (2603:10a6:10:3b::16) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.21.472.18 via Frontend Transport; Fri, 2 Oct 2026 16:49:02 +0000 Authentication-Results: spf=pass (sender IP is 2a00:1450:4864:30::17) 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::17 as permitted sender) receiver=protection.outlook.com; client-ip=2a00:1450:4864:30::17; helo=mail-wr2-x17.google.com; pr=C Received: from mail-wr2-x17.google.com (2a00:1450:4864:30::17) by DU6PEPF0000A7E4.mail.protection.outlook.com (2603:10a6:18:3::8b) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.21.472.14 via Frontend Transport; Fri, 2 Oct 2026 16:49:00 +0000 Received: by mail-wr2-x17.google.com with SMTP id ffacd0b85a97d-48b0622cc90so49329f8f.1 for ; Fri, 02 Oct 2026 09:49:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=openvz.org; s=google; t=1790959740; x=1791564540; 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=jMfj4QCF0boCbqUVP1JbRz5r/aOH1tserNiAjgWuk4o=; b=duSulxMMDLt9okwKH267OleuBanp4PE/VmzPPwQu+j0/beq5X2sBufO/MbOw/vCEAR PfcIr/iVCGn5mar0mogT0jaiP8IMwZmVbigzgqshIR8R+jSrcSB6Fir/3B7Qn8Q/KrBR HG08AnyFlVdiujX5SwZ+02DoygUiNPVbmsDy9jRW/MEF5qPjWXv4ei/9sPiH+9JuRNuh n4JLydXAW8NBsYC7zr1BaGfwsvaBrqG5qoLn61HBJcNgwRjr2N09saqgXglLPEAESnDp s7i4Vk3hW+DZlPPd7FTda52zxD1CKXKug7GRTsjIs84xVZLIv+Ggg9iy4N0lT5zZiQGC vndg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1790959740; x=1791564540; 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=jMfj4QCF0boCbqUVP1JbRz5r/aOH1tserNiAjgWuk4o=; b=pQ/KT+qsTzyr/ZONh6Djt5msK39Lu06N5mpkjXkKl+X2MaGcqISILCTZ3rz37pf2Gp 7+lc1Z9n31p9aV//c3IQxY22jguvd6OchtlQd3595oBTUIg/krYH5kyqhM7Ggy0NTUVT if5FfiFz7aDnovB2bu1ojpUu5NcicXjYNobUg/e7PGLGkJfVoI4fiIjRt3sZvVOmdkdS l38jZDXpkLZw3SjeMIJ5+O7vL7QVV8z5Hew2Ir2L0cVaHLdPCmwW90KtUmtchg4HLQY3 LNjf0uPOpRd+VBx39g/Isate+08xUMTyZwbcCJot+lM9k5XxtYiAu3PVWpKwYMkeKPyM qW+Q== X-Gm-Message-State: AFq9FYK4rmgpMkAqjwCRuoJbg9XvWi37icjjf2O9e8+HSzTW3t2lSLEk HgpmVPVRKR44A6LjMFKqftKBZ5xxRGTeOznP9M0Ak3OoP4UQpAFEpjZjoPbb09z2hDVfy/MhhcX Cj2XQ7Gg= X-Gm-Gg: AYBFou0BZqPHgRaEhxtm/2XEpTyEEFZNQqcboMLqqSnCVMSy6pA3rfCp61yze56DIE9 FezwB7ftx5UInLzdr8Ad7ZwFMtVnGRs7KCpiY2dJnbIvXUX70baGNPHtW6f+RmFQdT2bRtiLSoZ 2jpI0gJxRgyeuddAUa3UPTGAjWVAzn0LRj27QR0OUD93qLOnAkmPWon8ChctM66DkQ74w8Fh9sk m8XrinK6Zq4uHiMoPNTxfD0iZxS8Vt2RR53vCoDdYCK91rtyhRvO8kD+H9m2QDpzug04WiOMXUk 8HKZepdlgcopKQAyUYWMfQRm8/LORZsc6wjUDkEWe072LCkQGAVNRF2XOoT4mIxBPSwlaijc1rC SvAZOw/a59iOOcaxInMBrTcvyQ2364RdsoHRdtNAUC0YOIRuxmXuoW4fKGY3cSv/+r71NNLKCPX aMIUm4RXq+K88EsyoZKQ1/JSZYRPJeYcJ4l7xtlfHVwv7wu890OiZ4RwCBjnO00kAahQ== X-Received: by 2002:a05:6000:4684:b0:488:8132:143d with SMTP id ffacd0b85a97d-48b1272d237mr4230538f8f.19.1790959737094; Fri, 02 Oct 2026 09:48:57 -0700 (PDT) Received: from athena.sw.ru ([2a06:5b06:b600:300:e2e:474b:392b:33f7]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-48b380fada5sm6442174f8f.24.2026.10.02.09.48.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 02 Oct 2026 09:48:56 -0700 (PDT) From: "Denis V. Lunev" 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 Message-ID: <20261002164853.2130337-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: DU6PEPF0000A7E4:EE_|VE1PR08MB5568:EE_ X-MS-Office365-Filtering-Correlation-Id: bba24c1d-e379-41c0-b306-08df20a50f2e 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|9140799003|82310400026|6059299003|43022699015|376014|48200799018|61400799027|10067099003|5063699009|55112099003|3023799007|56012099006|18002099003|10086099003|16102099003; X-Microsoft-Antispam-Message-Info: t7W/YyeUlnYTQGomykmDr/pDP+vM2GQRMjoQ+WCGS27NotUs88hcstKTKSfLNyswXel4vgcdoVGjQqFZxkADqbKJPFmeNyAkgO1J5SHkrYqON1eLOtkZGCwFo57I6Fr1vnUqQJ3Q+T/U58HRyRJvVV1IIQ4fmN27WApbDs7+nJFwC5llO0QWJAzxHq1djlMv5+uBLlvJ1a5GYwz4Di09rki3GBhCd2ZoaTWt7o9NdGIpo06XRBxgLInG9/7u9/gT7lmt8HjVpXEiEJr1HvYKawxbSEHJJGFGc9k0s5wzxHmL4+e62Y6/XKaA1PUs/V9gE06BUaTLI/UreQCWubgv6NrlZgOD4vX5jl/inZ6varQWv33k2YFx8MvLh9JlOVZi9NiSnCufjwQ7CMLb4CtFobqq0FjEPSrgJOYVprZ7wikmcZC222NqCSEYiO55J2WFN1tdbKh3G+VKOR5zHNCgB9t11ZArFntlqNJTq3f4V8va9lekTEFh0w2QZV19ZuFza2PaiJ8Oe2BTA3Im352aNB9DKH8eXxrT11ULtCNxdSMuKcEXgTTTsniXNomUTfxqVMawtwgmSZ2K/pJhbI91iEXb+CWLmyux+YLu6KG+MC/CDWLIcJMd/xoeebPvG8bVWDxP/iE4qP80OO2Iv8NVshL++8gwB2o+Lvd6cZj9Qv8oEwXaRJpEgh0i9/HiKS4tpCFTxJt9TcjpqV5bTZFFyRxzZig6B7GVx1Osd12k2PNXEHr0Q6q3oXTUFedXkpDiwTJENP/pJ+72AZq8hHJAhR0ksgm9nIsifMzghH278M6Vc0Uqv30GxdrjXRL4+X0kx10oZo+g+DlcXc0hloeDIg== X-Forefront-Antispam-Report: CIP:2a00:1450:4864:30::17;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:mail-wr2-x17.google.com;PTR:mail-wr2-x17.google.com;CAT:NONE;SFS:(13230040)(704161411799003)(9140799003)(82310400026)(6059299003)(43022699015)(376014)(48200799018)(61400799027)(10067099003)(5063699009)(55112099003)(3023799007)(56012099006)(18002099003)(10086099003)(16102099003);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: bqPX+3URSa6iRfjWMezg25BP4A3tnv2xvmKe9P1X0mWlZ2+pOuG5v9hXhztnOWqWfnjZkVmJYzO/RE/90Kztsi0HJkDYJ2p4UClYH7fV05+wyBvpYd9UjXEB9BE6m3QXsvD5ghsCNrpY5h+jygGnBuiTSO/4D528dxMyhH/mRKGohQ4Vda7ENdBVKsZH2W9v3Dd/h96iOng6OFTis9932gxi25igHtleTF70hjVLV+o74qNqIZuRNuEOQ5Ewn7i4b8qyrEPM7MLF1e3kUrSZXXZ8++YyAbdpiRdLUMUNy8F8X72XDQEpqKrgylN6ojib/DImraJi311/+WFOcACm6uj1IkjQcJwgag/YyzWuE7/tYW7SdkDfCLjhbpZhmAuCWRFOv3MwzL5PaM+LbBhkHDpfAcljNgn8h2hGWZFLhHI4CWvLtJ6IJOiCAmiV3Q5t X-ExternalRecipientOutboundConnectors: 0bc7f26d-0264-416e-a6fc-8352af79c58f X-Auto-Response-Suppress: DR, OOF, AutoReply X-OriginatorOrg: virtuozzo.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Oct 2026 16:49:00.6094 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: bba24c1d-e379-41c0-b306-08df20a50f2e X-MS-Exchange-CrossTenant-Id: 0bc7f26d-0264-416e-a6fc-8352af79c58f X-MS-Exchange-CrossTenant-AuthSource: DU6PEPF0000A7E4.eurprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: Internet X-MS-Exchange-Transport-CrossTenantHeadersStamped: VE1PR08MB5568 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 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/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