From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: <010701a18d5286a8-d32c5af2-ccf4-49aa-97ac-f7ce18168fac-000000@eu-central-1.amazonses.com> Received: from AM0PR83CU005.outbound.protection.outlook.com (mail-westeuropeazon11020141.outbound.protection.outlook.com [52.101.69.141]) by lore.virtuozzo.com (Postfix) with ESMTPS id CEB7880E7E for ; Fri, 30 Oct 2026 14:59:23 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=yuVaRAP3PMz0AwjM32SXQjh9sM6/37fCwM+OnevG0Qzzt8aMihinHPjofN0WotAHRnhiHJib3Ka1hHycO7Iyc5oePr+9mSCEXRmqKxVbVmGSvpRiB/e49nUfTxt0wD5P1GGSwAbxmf5EMTZBmQ0gZ0pFSRlHPlnBTmzsHUB7RzL3YT1JjXK1rVWLP0gMbgKmrOvDZRwu+UDyqqAqpSoVEQtxChCWIHLetu8WZzgbPVg++lMxmjQtizsSzw4tqN7y7jgoDzfhH+6iB37kB0Fjrv44HOUBZuKCaBcSnsZu07Lf/oc0BBTTFu2ZbOqqZPOYRSQ+PVyNAjzwtwj1fd9mSA== 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=0NJDB3I/AD9gd2C19HPWJpZFTemREvljcPIUKCDOma0=; b=AZFsPG+VtL2eFkF8RZqOdAGweppxTBxk4/JXmmGUjXaA+9IzV3W3XY7hw6pxquBbPB0pljx0lp5dOljaPJmov//9q7NFR9w9tOdZjfiul0K+I5r1je45XWF0ShP5JJs6NWjcFeZgzb0w+RnEOdpQjtp8ybQKiZHZAMSSisxXLF/mBltlx+Gtb8/iE1ie+okItLG63Bl+2CoWjd9gRjEoLyh6l1ROWWCrtDXyJq0oddkjNhXLFKykekBc9ebEPs0Sc+yklQn8UY22LB6ztTBANduFQMv0hmNQzHsg3G8608pSxfMtIUKdREyUoQDtmxG2lnApVX1QdS7SXzF5mWEDnw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 69.169.224.5) smtp.rcpttodomain=virtuozzo.com smtp.mailfrom=eu-central-1.amazonses.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=sashiko.virtuozzo.com; dkim=pass (signature was verified) header.d=sashiko.virtuozzo.com; dkim=pass (signature was verified) header.d=amazonses.com; 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=0NJDB3I/AD9gd2C19HPWJpZFTemREvljcPIUKCDOma0=; b=Sn5s6+yqc8Tz2ve6Hi3+0cXwrwInfBLSSgEb9L6kadDMz0gdnhcD1rXXLjMSOsvlLWnRWiZJoEpuvSqfepO0gYwEnDbfkpgUMZ0iCDoPn0QKl9LsRbB0cWP9r2XL/zCZyfUguzpeVMNgdTWLM1mNz89H0NGe2IUSD92Fp7aQ8wU= Received: from GVZP280CA0045.SWEP280.PROD.OUTLOOK.COM (2603:10a6:150:26f::16) by FRZPR08MB11069.eurprd08.prod.outlook.com (2603:10a6:d10:139::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.569.9; Fri, 30 Oct 2026 14:59:20 +0000 Received: from WA1PEPF000099CF.eurprd04.prod.outlook.com (2603:10a6:150:26f:cafe::28) by GVZP280CA0045.outlook.office365.com (2603:10a6:150:26f::16) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.21.569.9 via Frontend Transport; Fri, 30 Oct 2026 14:59:18 +0000 Authentication-Results: mx.microsoft.com 1; spf=pass (sender IP is 69.169.224.5) smtp.mailfrom=eu-central-1.amazonses.com; dkim=pass (signature was verified) header.d=sashiko.virtuozzo.com;dkim=pass (signature was verified) header.d=amazonses.com;dmarc=pass action=none header.from=sashiko.virtuozzo.com; Received-SPF: Pass (protection.outlook.com: domain of eu-central-1.amazonses.com designates 69.169.224.5 as permitted sender) receiver=protection.outlook.com; client-ip=69.169.224.5; helo=b224-5.smtp-out.eu-central-1.amazonses.com; pr=C Received: from b224-5.smtp-out.eu-central-1.amazonses.com (69.169.224.5) by WA1PEPF000099CF.mail.protection.outlook.com (10.167.242.23) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.21.569.4 via Frontend Transport; Fri, 30 Oct 2026 14:59:18 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/simple; s=23yjbh4k34hwzfubhuiim7m4inbd3ick; d=sashiko.virtuozzo.com; t=1793372358; h=Message-ID:From:Subject:To:Cc:In-Reply-To:References:Content-Type:Content-Transfer-Encoding:Date; bh=yujbZwuEqAZ/Q/C03S6uSjRM+WLjyb76MTR4SRgivZY=; b=FUzqHqV8vP1NOPkJ9gWk/m29iA41eHpASnbmF+FtBxII9U7XQCw+bz7h6/r30bSG 8Ps2UJnYXGxdgoqhNbzjCGtMGvJ5xf1x0TAw+5cTbmafBIo8/vL/CJyYnutW5KaHuTr E+/hU+zwUEXCV2sgpyRZ9nPaJ2Bahivnt5psl05NVx2l0nJoLGnCzi1FePK5WKbTST3 eAZDpgWhL0S7vsvx97llBEsYoqOuEbn87eivoSvuAuwnDUqQYqmxuKw2mSCTEnuzJoG g/yEvk1o1lsoSKKBcF/T9Guw8zLAAAZKAzR43PQ6gzSUgZ3d+AP7Iec+upBb6VknlCw JvfApZQmLg== DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/simple; s=qftdzk2dqsatjnlrq4r5brjbihpfcrsh; d=amazonses.com; t=1793372358; h=Message-ID:From:Subject:To:Cc:In-Reply-To:References:Content-Type:Content-Transfer-Encoding:Date:Feedback-ID; bh=yujbZwuEqAZ/Q/C03S6uSjRM+WLjyb76MTR4SRgivZY=; b=jkEeRoY01yzJw+WTEzDDpQeZ7HNTysfGB8WEoF5WGLx3yE5zHSmy+BE6wNrXC+0z Ksp0GxhntBOU35KFTTTLwr91t4yq5K9uRkMZqaY/OXCIZ69j6pHeV7R4eitLGpi1i22 y2XPFmsfF5OT+sNpGuHS2u0owzexmxHtPhKkXnic= Message-ID: <010701a18d5286a8-d32c5af2-ccf4-49aa-97ac-f7ce18168fac-000000@eu-central-1.amazonses.com> From: no-reply@sashiko.virtuozzo.com Subject: Re: [PATCH QEMU HCI-8.1 v6 16/34] migration: Fix regression of passing error_fatal into vmstate_load_state() To: svt-core@virtuozzo.com, Andrey Drobyshev Cc: andrey.drobyshev@virtuozzo.com In-Reply-To: <20261030-vfio_v1-v6-16-45de246bc92e@virtuozzo.com> References: <20261030-vfio_v1-v6-0-45de246bc92e@virtuozzo.com> <20261030-vfio_v1-v6-16-45de246bc92e@virtuozzo.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Date: Fri, 30 Oct 2026 14:59:18 +0000 Feedback-ID: ::1.eu-central-1.2wRQJBpg9g1fGRYexx3dUuYGS25Bux+2TEOx72/m6U4=:AmazonSES X-SES-Outgoing: 2026.10.30-69.169.224.5 X-EOPAttributedMessage: 0 X-EOPTenantAttributedMessage: 0bc7f26d-0264-416e-a6fc-8352af79c58f:0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: WA1PEPF000099CF:EE_|FRZPR08MB11069:EE_ MIME-Version: 1.0 X-MS-Office365-Filtering-Correlation-Id: cbce3a90-e710-44f8-c559-08df36965f9c X-LD-Processed: 0bc7f26d-0264-416e-a6fc-8352af79c58f,ExtAddr X-MS-Exchange-AtpMessageProperties: SA List-Id: svt-core@virtuozzo.com X-MS-Exchange-Transport-Rules-Loop: 1 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|704161411799003|376014|61400799027|9140799003|32142699015|48200799018|6133799003|5113699003|4113699003|18002099003|16102099003|22082099003|55112099003|13003099007|56012099006|5063699009|4143699003|261022105027099003|261021121427099003|10067099003|261009223327099003|261009221227099003|261009223027099003|261009220027099003|261026140227099003|261028144727099003|261026121527099003|261009221727099003; X-Microsoft-Antispam-Message-Info: mLDDaaWR1zKa6xwGvZIjBLAN2NCBCJjuePZc4gvu8G+qk4kBrgpMstHdOxxJazEDfPm1nyG26VgqZIaYVBUwy6at+tn4DJxXUQgLJAExkBy0X3guBZZ+qdb2S8LUK6FGb+uEFZC26Yx7QhoeRdEVdo3txD7FBN1xeggNrTAEOKJzg8LjoBj4aU3WbXf2f+ISO5mXxFUrP/tcnZNapEg9KafUVNaD1e0+Vfu0LUtQZTQt28WLRk4+yMwc/sJesXdPBcJtELFWJ23q1bb/pDRYoRPLKyjI7LHfzqLedoSasmRlZScVCteOr/xCgWjtc725ux/2iAV9FiWYjR54SFkkJ+aaNxfudz16JfCfknYfJg3O72OnKWSXpMLNlhpnFgqfyqFRTiCa9ZQpDpGdZBiFfPSF1gpKFeSlTZTeLM2//plm2h+IMJVW7yuKRk6zJrQpM1rB5WKancRGxQy+HkC0vldlovkUESkIj4+KXG1JUm9EySztcte072ABLOmoYCC3dATVH3m5NJbLRUlWWugRnEf0MFwRM4GwpWDDTM8am9K4Em7atXrIyCuscQEBIKPDnN3GpetHNCqNxAlKJ/cl5K6JhPAJu3BGq7H9IHpZfg7wsaBvWvpWClgXeAXAiFtUg+ZVt8fUGIKgUOX5nflO5zTHoDHQBTb8GJcl0MECyK2Bwz6Ngf7Mkd5sbNGMlDtF9TuhHivwwzeoKLT94MqcIWXS6GF7aZJV6mTpK1dlIwqmtIMAZ7tZ3GyzyYu1YeXHL43uySe2FidMKYTxfBgIxOWfwWypv1wGGQi5KAFbxh390qGVQmc5By5fUuKSmoUMD4UHFPvO+QvwAFttXQC18Q== X-Forefront-Antispam-Report: CIP:69.169.224.5;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:b224-5.smtp-out.eu-central-1.amazonses.com;PTR:b224-5.smtp-out.eu-central-1.amazonses.com;CAT:NONE;SFS:(13230040)(704161411799003)(376014)(61400799027)(9140799003)(32142699015)(48200799018)(6133799003)(5113699003)(4113699003)(18002099003)(16102099003)(22082099003)(55112099003)(13003099007)(56012099006)(5063699009)(4143699003)(261022105027099003)(261021121427099003)(10067099003)(261009223327099003)(261009221227099003)(261009223027099003)(261009220027099003)(261026140227099003)(261028144727099003)(261026121527099003)(261009221727099003);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: wzsaCXPQpHiGtBl0Rpui/1OyW/fGpdG9Yj+CNWo1d/nGwHCHKBh/2k2kBWEPrRAPN1CHo5ZMnJo5E1bXn761IB4nAfR/bubbEqqmmRbNlkk+Umfkjw+jI9I3NA9sLu9lRMNOuzBBGhWKMt+/2ofGvkGFbIDmldldZIePK13etgJZ8kgVXFA+qohJWKzhl6M83O520IhNcrGnRAe/P5zCMgxj2G4a3ziacQBvwZCWH9XnZlexHFC4PAWBSrxdWx4FhfKZa4rCmVJBtDtO7ZlioetMPGRF+dqvhf9zNOG6Le2HoyqOXOpr75wSEZlzj8nFIX3HtT7nIXiDa+V7j6e9LMHfaxLR1sQEBGxrFD9+bD8mYbm9Jk1q7NxL+TPlXS3obyrd+aTWh0PXy35OIY8ue3I0Ud2ypQbGP+LqYI8Vexl7XXFI5/9mGQzwLlxOHWIN X-ExternalRecipientOutboundConnectors: 0bc7f26d-0264-416e-a6fc-8352af79c58f X-OriginatorOrg: virtuozzo.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Oct 2026 14:59:18.6176 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: cbce3a90-e710-44f8-c559-08df36965f9c X-MS-Exchange-CrossTenant-Id: 0bc7f26d-0264-416e-a6fc-8352af79c58f X-MS-Exchange-CrossTenant-AuthSource: WA1PEPF000099CF.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: Internet X-MS-Exchange-Transport-CrossTenantHeadersStamped: FRZPR08MB11069 Thank you for your contribution! Sashiko AI review found 2 potential issue(= s) to consider: - [Medium] migration: vmstate_load() still passes error_fatal, so load erro= rs exit QEMU - [Low] migration: void save callbacks only report vmstate_save_state() fai= lure, stream not failed -- commit 6e93ee51257c3f9653027d6d85f483dda49b4fbb Author: Arun Menon migration: Fix regression of passing error_fatal into vmstate_load_state() This patch replaces error_fatal in the vmstate_load_state() and vmstate_save_state() calls in several hw/ files with a local Error object. Failures are now reported with error_report_err() and, where the caller can return a value, propagated. Link: https://lore.kernel.org/r/20251028-solve_error_fatal_regression-v2-1-= dab24c808a28@redhat.com > diff --git a/hw/display/virtio-gpu.c b/hw/display/virtio-gpu.c > --- a/hw/display/virtio-gpu.c > +++ b/hw/display/virtio-gpu.c [ ... ] > @@ -1344,9 +1350,11 @@ static int virtio_gpu_load(QEMUFile *f, void *opaq= ue, size_t size, > } > =20 > /* load & apply scanout state */ > - vmstate_load_state(f, &vmstate_virtio_gpu_scanouts, g, 1, &error_fat= al); > - > - return 0; > + ret =3D vmstate_load_state(f, &vmstate_virtio_gpu_scanouts, g, 1, &e= rr); > + if (ret < 0) { > + error_report_err(err); > + } > + return ret; > } [Severity: Low] This isn't a bug, but the behaviour here changes. The old code ignored the result of vmstate_load_state() and returned 0, while the new code returns the failure to the caller. The error is also printed here by error_report_err(). Could the outer vmstate_load_state() caller print it a second time, so that the same failure is reported twice? > diff --git a/hw/pci/pci.c b/hw/pci/pci.c > --- a/hw/pci/pci.c > +++ b/hw/pci/pci.c [ ... ] > void pci_device_save(PCIDevice *s, QEMUFile *f) > { > + Error *local_err =3D NULL; > + int ret; > + > /* Clear interrupt status bit: it is implicit > * in irq_state which we are saving. > * This makes us compatible with old devices > * which never set or clear this bit. */ > s->config[PCI_STATUS] &=3D ~PCI_STATUS_INTERRUPT; > - vmstate_save_state(f, &vmstate_pci_device, s, NULL, &error_fatal); > + ret =3D vmstate_save_state(f, &vmstate_pci_device, s, NULL, &local_e= rr); > + if (ret < 0) { > + error_report_err(local_err); > + } > /* Restore the interrupt status bit. */ > pci_update_irq_status(s); > } [Severity: Low] Can a save failure here go unnoticed by the migration core? pci_device_save() returns void, so it prints the error and returns normally. vmstate_save_state_v() only sets the Error object on failure: migration/vmstate.c:vmstate_save_state_v() { ... if (ret) { error_setg(errp, "Save of field %s/%s failed", vmsd->name, field->name); ... return ret; } } It does not call qemu_file_set_error(), so the QEMUFile error state stays clear. virtio_save() then keeps writing the stream, and the migration or snapshot could be left incomplete with no failure flagged. The same pattern appears in the other void save callbacks changed by this patch: hw/virtio/virtio-pci.c:virtio_pci_save_extra_state() hw/virtio/virtio-mmio.c:virtio_mmio_save_extra_state() hw/s390x/virtio-ccw.c:virtio_ccw_save_config() > diff --git a/hw/scsi/spapr_vscsi.c b/hw/scsi/spapr_vscsi.c > --- a/hw/scsi/spapr_vscsi.c > +++ b/hw/scsi/spapr_vscsi.c [ ... ] > + rc =3D vmstate_save_state(f, &vmstate_spapr_vscsi_req, req, NULL, &l= ocal_err); > + if (rc < 0) { > + error_report_err(local_err); > + return; > + } > trace_spapr_vscsi_save_request(req->qtag, req->cur_desc_num, > req->cur_desc_offset); > } [Severity: Low] vscsi_save_request() is a void .save_request hook, so the SCSI core cannot see this failure either. Is it intended that the error is only printed here and the save carries on? > diff --git a/hw/virtio/virtio.c b/hw/virtio/virtio.c > --- a/hw/virtio/virtio.c > +++ b/hw/virtio/virtio.c [ ... ] The patch fixes the hw/ callers, but the central loader still passes error_fatal: migration/savevm.c:vmstate_load() { ... return vmstate_load_state(f, se->vmsd, se->opaque, se->load_version_id, &error_fatal); } [Severity: Medium] Does this leave the regression described in the commit message in place for the main load path? vmstate_load() is called from qemu_loadvm_section_start_full() and qemu_loadvm_section_part_end(). Any vmsd load failure there, such as a version_id that is too new or too old, or a pre_load, get or post_load failure, still calls exit(1) inside vmstate_load_state(). The error handling in both callers is therefore not reached for vmsd devices: ret =3D vmstate_load(f, se); if (ret < 0) { error_report("error while loading state for instance 0x%"PRIx32" of" " device '%s'", instance_id, idstr); return ret; } and: ret =3D vmstate_load(f, se); if (ret < 0) { error_report("error while loading state section id %d(%s)", section_id, se->idstr); return ret; } A grep of migration/savevm.c at this commit and at the end of the series shows the same &error_fatal in vmstate_load(). Should vmstate_load() also use a local Error object and propagate the failure? --=20 Sashiko AI review =C2=B7 https://sashiko.vzint.dev/#/patchset/20261030-vfio= _v1-v6-0-45de246bc92e@virtuozzo.com?part=3D16