From nobody Mon Feb 9 04:59:29 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1636695765; cv=none; d=zohomail.com; s=zohoarc; b=CtvoUNOCj7WVuJyZCKOdtJ3PrvCpp8gv7fIAf+4ryfDKAnUHx4EUd767KIIPGg+jgsgChFI7hFRtrk5XOXALiX30JemYT4oRLDVwPG/aZM2Gv3O2z/BZLsSGJlL+6IHj4dD2dj9ZVHfS0f2bjJl17OIf90BuCVyyLAgq7P2OWpo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1636695765; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=Bjrh0f64PpUFOitgFXl5DU47FbzO9rtRnmHn46eI6S8=; b=ZXHsw4MMSfh10ufPnEQ7uZHV5RASyzAhQT93OET70iB3rXRTNRRPEy8vaVVe7WrGOJmmg/o1ga8HbHSB5HbgxZCKLGTpto4ugJKL7B2TPrA5QGnhUblB2I0FgVsSqmyU2tXd07Oyo1sRs7B/Dce+2qWIYxyE8bwYP+FZEp00RHs= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1636695765537184.26708145543853; Thu, 11 Nov 2021 21:42:45 -0800 (PST) Received: from localhost ([::1]:48546 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mlPKm-0000hO-HJ for importer@patchew.org; Fri, 12 Nov 2021 00:42:44 -0500 Received: from eggs.gnu.org ([209.51.188.92]:57986) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mlPHc-00069T-NK for qemu-devel@nongnu.org; Fri, 12 Nov 2021 00:39:28 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:52700) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mlPHX-0005OL-Cx for qemu-devel@nongnu.org; Fri, 12 Nov 2021 00:39:27 -0500 Received: from mail-vk1-f199.google.com (mail-vk1-f199.google.com [209.85.221.199]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-488-bz-Hu6XrOG6MnI7cgiKLIQ-1; Fri, 12 Nov 2021 00:39:21 -0500 Received: by mail-vk1-f199.google.com with SMTP id y15-20020a1f7d0f000000b002f244d4c479so3843761vkc.9 for ; Thu, 11 Nov 2021 21:39:21 -0800 (PST) Received: from LeoBras.redhat.com ([2804:431:c7f0:7e14:3b94:fb27:f0ad:a824]) by smtp.gmail.com with ESMTPSA id r2sm1465280vsk.28.2021.11.11.21.39.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 11 Nov 2021 21:39:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1636695562; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Bjrh0f64PpUFOitgFXl5DU47FbzO9rtRnmHn46eI6S8=; b=NCD4wOq4FFTdSYgoCIFWEkFEsV0Dv1LIa9BF7CY8ikH0isD+xrIy4FNw3oIdc+BQ62rh2q sN98pVqZ36O2RsT1kSQL31nTFbfAslRxZ2Ywkeo4I9Aoar91ypf0tJEdr/zpl0kCymeKqH k8nu2nKor43Zj9Pe016w9hy9RUTyLfA= X-MC-Unique: bz-Hu6XrOG6MnI7cgiKLIQ-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Bjrh0f64PpUFOitgFXl5DU47FbzO9rtRnmHn46eI6S8=; b=NOKjTPYSmD90FaVovjcyNGVLFRby1OVRe71o3fAVydtiS5gzywyMLqSHqCjxqDmR74 mprKqvAW5NpSakwdCC8jHpMZFrNq+/WzK6UvXN1QkW8kO8/o2dpC3E88FGigXXv/HJvq fnLkhZRvoLwHQtYnvTgGgWZ6OCmbku6bUvX86Qqsdpc6lx0YElouy81mbxq+yHlsSqDD qwcdJLqETIfcLdg50cbC/HF11CVboaJpnCha8VCENJdCam476pIdbJ3DqlCGXLPR2/dD UYFV6ViNl0A9jvMhGHH0PWYP1GpiLHAa+mcBxQiKJUJHawfOF0Lb/LCC7U1Zp+x5RSaY p3sA== X-Gm-Message-State: AOAM533ZGUKW9sOS5UGNpe1fi2/pnA2JZQDCfKzBNS+A5hCnMRXYAJ66 frY5g6ywFJ1fqt3r7NK3rKbdzIYc4t3uGBGCggm8NMLArTWJ2FlvWrwLw2mYL3eglBy1pmVmw+0 kdw/iv3NatYaJa3w= X-Received: by 2002:ab0:35cd:: with SMTP id x13mr12718305uat.46.1636695560879; Thu, 11 Nov 2021 21:39:20 -0800 (PST) X-Google-Smtp-Source: ABdhPJx87JJEKafitmpodLYDyDNm1IO66kUATrg8sRtsSDKch3tKyOdtwYznZCQ846VyV493eP+s+A== X-Received: by 2002:ab0:35cd:: with SMTP id x13mr12718272uat.46.1636695560699; Thu, 11 Nov 2021 21:39:20 -0800 (PST) From: Leonardo Bras To: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , Juan Quintela , "Dr. David Alan Gilbert" , Eric Blake , Markus Armbruster Subject: [PATCH v5 2/6] QIOChannelSocket: Add flags parameter for writing Date: Fri, 12 Nov 2021 02:10:37 -0300 Message-Id: <20211112051040.923746-3-leobras@redhat.com> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20211112051040.923746-1-leobras@redhat.com> References: <20211112051040.923746-1-leobras@redhat.com> MIME-Version: 1.0 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=leobras@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=leobras@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -34 X-Spam_score: -3.5 X-Spam_bar: --- X-Spam_report: (-3.5 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.7, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, 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: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Leonardo Bras , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1636695766277100001 Content-Type: text/plain; charset="utf-8" Change qio_channel_socket_writev() in order to accept flags, so its possible to selectively make use of sendmsg() flags. qio_channel_socket_writev() contents were moved to a helper function qio_channel_socket_writev_flags() which accepts an extra argument for flags. (This argument is passed directly to sendmsg(). Signed-off-by: Leonardo Bras Reviewed-by: Daniel P. Berrang=C3=A9 --- io/channel-socket.c | 26 +++++++++++++++++++------- 1 file changed, 19 insertions(+), 7 deletions(-) diff --git a/io/channel-socket.c b/io/channel-socket.c index 606ec97cf7..b57a27bf91 100644 --- a/io/channel-socket.c +++ b/io/channel-socket.c @@ -520,12 +520,13 @@ static ssize_t qio_channel_socket_readv(QIOChannel *i= oc, return ret; } =20 -static ssize_t qio_channel_socket_writev(QIOChannel *ioc, - const struct iovec *iov, - size_t niov, - int *fds, - size_t nfds, - Error **errp) +static ssize_t qio_channel_socket_writev_flags(QIOChannel *ioc, + const struct iovec *iov, + size_t niov, + int *fds, + size_t nfds, + int flags, + Error **errp) { QIOChannelSocket *sioc =3D QIO_CHANNEL_SOCKET(ioc); ssize_t ret; @@ -558,7 +559,7 @@ static ssize_t qio_channel_socket_writev(QIOChannel *io= c, } =20 retry: - ret =3D sendmsg(sioc->fd, &msg, 0); + ret =3D sendmsg(sioc->fd, &msg, flags); if (ret <=3D 0) { if (errno =3D=3D EAGAIN) { return QIO_CHANNEL_ERR_BLOCK; @@ -572,6 +573,17 @@ static ssize_t qio_channel_socket_writev(QIOChannel *i= oc, } return ret; } + +static ssize_t qio_channel_socket_writev(QIOChannel *ioc, + const struct iovec *iov, + size_t niov, + int *fds, + size_t nfds, + Error **errp) +{ + return qio_channel_socket_writev_flags(ioc, iov, niov, fds, nfds, 0, e= rrp); +} + #else /* WIN32 */ static ssize_t qio_channel_socket_readv(QIOChannel *ioc, const struct iovec *iov, --=20 2.33.1