{"id":2225144,"url":"http://patchwork.ozlabs.org/api/1.1/patches/2225144/?format=json","web_url":"http://patchwork.ozlabs.org/project/qemu-devel/patch/20260420201317.30199-3-junjie.cao@intel.com/","project":{"id":14,"url":"http://patchwork.ozlabs.org/api/1.1/projects/14/?format=json","name":"QEMU Development","link_name":"qemu-devel","list_id":"qemu-devel.nongnu.org","list_email":"qemu-devel@nongnu.org","web_url":"","scm_url":"","webscm_url":""},"msgid":"<20260420201317.30199-3-junjie.cao@intel.com>","date":"2026-04-20T20:13:16","name":"[2/3] migration/file: switch file_write_ramblock_iov to pwritev_all","commit_ref":null,"pull_url":null,"state":"new","archived":false,"hash":"f649177d0006158544a1faa38ce82aa99cda79b5","submitter":{"id":91537,"url":"http://patchwork.ozlabs.org/api/1.1/people/91537/?format=json","name":"Junjie Cao","email":"junjie.cao@intel.com"},"delegate":null,"mbox":"http://patchwork.ozlabs.org/project/qemu-devel/patch/20260420201317.30199-3-junjie.cao@intel.com/mbox/","series":[{"id":500601,"url":"http://patchwork.ozlabs.org/api/1.1/series/500601/?format=json","web_url":"http://patchwork.ozlabs.org/project/qemu-devel/list/?series=500601","date":"2026-04-20T20:13:15","name":"migration: switch remaining positioned I/O to _all helpers","version":1,"mbox":"http://patchwork.ozlabs.org/series/500601/mbox/"}],"comments":"http://patchwork.ozlabs.org/api/patches/2225144/comments/","check":"pending","checks":"http://patchwork.ozlabs.org/api/patches/2225144/checks/","tags":{},"headers":{"Return-Path":"<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@legolas.ozlabs.org","Authentication-Results":["legolas.ozlabs.org;\n\tdkim=pass (2048-bit key;\n unprotected) header.d=intel.com header.i=@intel.com header.a=rsa-sha256\n header.s=Intel header.b=ItEY6Drr;\n\tdkim-atps=neutral","legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org\n (client-ip=209.51.188.17; helo=lists1p.gnu.org;\n envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org;\n receiver=patchwork.ozlabs.org)"],"Received":["from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17])\n\t(using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits))\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4fzkqR0gyKz1yHr\n\tfor <incoming@patchwork.ozlabs.org>; Mon, 20 Apr 2026 22:11:31 +1000 (AEST)","from localhost ([::1] helo=lists1p.gnu.org)\n\tby lists1p.gnu.org with esmtp (Exim 4.90_1)\n\t(envelope-from <qemu-devel-bounces@nongnu.org>)\n\tid 1wEnSd-0006Fi-1f; Mon, 20 Apr 2026 08:10:52 -0400","from eggs.gnu.org ([2001:470:142:3::10])\n by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)\n (Exim 4.90_1) (envelope-from <junjie.cao@intel.com>)\n id 1wEnSR-0006FD-2D\n for qemu-devel@nongnu.org; Mon, 20 Apr 2026 08:10:31 -0400","from mgamail.intel.com ([198.175.65.13])\n by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)\n (Exim 4.90_1) (envelope-from <junjie.cao@intel.com>)\n id 1wEnSP-0004Rl-EH\n for qemu-devel@nongnu.org; Mon, 20 Apr 2026 08:10:30 -0400","from orviesa003.jf.intel.com ([10.64.159.143])\n by orvoesa105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;\n 20 Apr 2026 05:10:29 -0700","from junjie-optiplex-micro-plus-7010.bj.intel.com ([10.238.152.98])\n by ORVIESA003-auth.jf.intel.com with\n ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 20 Apr 2026 05:10:27 -0700"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple;\n d=intel.com; i=@intel.com; q=dns/txt; s=Intel;\n t=1776687030; x=1808223030;\n h=from:to:cc:subject:date:message-id:in-reply-to:\n references:mime-version:content-transfer-encoding;\n bh=CUDka3bP53CRZaZv32S7MqGXZ/SM72d8bEpuI1Piopo=;\n b=ItEY6DrrQqCXTvVGELAfMRomF4dm3hwZyOAzF9qQZUCEiQzHFYXdpmrO\n 5iyu67jPt7u5m8Ff2fPgditcQ43937kMW4eJ4TfqL8fwGww+Cc+ed8Myg\n 1Za/kmsmxEbcmrz2cMNE0Ztqn1JTdCmZPdvXa1/2cEXSkxgEm+Wu8ewYd\n KooYwIHacBTw5ORWv/CTwsFDQ3v0RwZNhhH8VC4Ev//APYI2bWhop1QIG\n 1+EAw8uAVNtM5SFVu1yiZ7PuENN9wFLtN8kk7MX5Sez+VSnKg/owH7wtm\n lxL3S3A9RfSmeOUpMAnzVSwncrWAssRjSofdBXIa8+IxXUHgCvsV8dPg2 A==;","X-CSE-ConnectionGUID":["NJ/yu9czScqvlmYg5useOQ==","ZAxxBapDSL2tunq1GIsgbg=="],"X-CSE-MsgGUID":["REwC9txnQNePC5zRVwpl4g==","n/4TiuQ2SO6jNX998X1NEg=="],"X-IronPort-AV":["E=McAfee;i=\"6800,10657,11762\"; a=\"88674250\"","E=Sophos;i=\"6.23,189,1770624000\"; d=\"scan'208\";a=\"88674250\"","E=Sophos;i=\"6.23,189,1770624000\"; d=\"scan'208\";a=\"235708274\""],"X-ExtLoop1":"1","From":"Junjie Cao <junjie.cao@intel.com>","To":"qemu-devel@nongnu.org","Cc":"peterx@redhat.com,\n\tfarosas@suse.de,\n\tjunjie.cao@intel.com","Subject":"[PATCH 2/3] migration/file: switch file_write_ramblock_iov to\n pwritev_all","Date":"Tue, 21 Apr 2026 04:13:16 +0800","Message-ID":"<20260420201317.30199-3-junjie.cao@intel.com>","X-Mailer":"git-send-email 2.43.0","In-Reply-To":"<20260420201317.30199-1-junjie.cao@intel.com>","References":"<20260420201317.30199-1-junjie.cao@intel.com>","MIME-Version":"1.0","Content-Transfer-Encoding":"8bit","Received-SPF":"pass client-ip=198.175.65.13;\n envelope-from=junjie.cao@intel.com;\n helo=mgamail.intel.com","X-Spam_score_int":"-24","X-Spam_score":"-2.5","X-Spam_bar":"--","X-Spam_report":"(-2.5 / 5.0 requ) BAYES_00=-1.9, DATE_IN_FUTURE_06_12=1.947,\n DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1,\n DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001,\n SPF_PASS=-0.001 autolearn=ham autolearn_force=no","X-Spam_action":"no action","X-BeenThere":"qemu-devel@nongnu.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"qemu development <qemu-devel.nongnu.org>","List-Unsubscribe":"<https://lists.nongnu.org/mailman/options/qemu-devel>,\n <mailto:qemu-devel-request@nongnu.org?subject=unsubscribe>","List-Archive":"<https://lists.nongnu.org/archive/html/qemu-devel>","List-Post":"<mailto:qemu-devel@nongnu.org>","List-Help":"<mailto:qemu-devel-request@nongnu.org?subject=help>","List-Subscribe":"<https://lists.nongnu.org/mailman/listinfo/qemu-devel>,\n <mailto:qemu-devel-request@nongnu.org?subject=subscribe>","Errors-To":"qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org","Sender":"qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org"},"content":"file_write_ramblock_iov() uses single-shot qio_channel_pwritev() and\nonly checks for ret < 0.  A short write (0 <= ret < requested) would be\ntreated as success.\n\nSwitch to qio_channel_pwritev_all() which retries until all bytes are\nwritten or an error occurs.\n\nFixes: f427d90b98 (\"migration/multifd: Support outgoing mapped-ram stream format\")\nSigned-off-by: Junjie Cao <junjie.cao@intel.com>\n---\n migration/file.c | 8 ++++----\n 1 file changed, 4 insertions(+), 4 deletions(-)","diff":"diff --git a/migration/file.c b/migration/file.c\nindex 0853188601..3729728dfe 100644\n--- a/migration/file.c\n+++ b/migration/file.c\n@@ -200,7 +200,7 @@ void file_connect_incoming(FileMigrationArgs *file_args, Error **errp)\n int file_write_ramblock_iov(QIOChannel *ioc, const struct iovec *iov,\n                             int niov, MultiFDPages_t *pages, Error **errp)\n {\n-    ssize_t ret = 0;\n+    int ret = 0;\n     int i, slice_idx, slice_num;\n     uintptr_t base, next, offset;\n     size_t len;\n@@ -239,8 +239,8 @@ int file_write_ramblock_iov(QIOChannel *ioc, const struct iovec *iov,\n             break;\n         }\n \n-        ret = qio_channel_pwritev(ioc, &iov[slice_idx], slice_num,\n-                                  block->pages_offset + offset, errp);\n+        ret = qio_channel_pwritev_all(ioc, &iov[slice_idx], slice_num,\n+                                      block->pages_offset + offset, errp);\n         if (ret < 0) {\n             break;\n         }\n@@ -249,7 +249,7 @@ int file_write_ramblock_iov(QIOChannel *ioc, const struct iovec *iov,\n         slice_num = 0;\n     }\n \n-    return (ret < 0) ? ret : 0;\n+    return ret;\n }\n \n int multifd_file_recv_data(MultiFDRecvParams *p, Error **errp)\n","prefixes":["2/3"]}