From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: passt.top; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: passt.top; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=YeOIl/Rb; dkim-atps=neutral Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by passt.top (Postfix) with ESMTP id 6875A5A004F for ; Mon, 26 Aug 2024 09:55:51 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1724658950; 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=kvr/04X3RZVhJrapu5qDkAeHl8NsM07m7XuxOBqDeck=; b=YeOIl/RbcrEb4+CVzKrrnIUkPykv/UoO77Vwes+KrZr5kxF1Dbf00XILc9DdVszpvPW0Pq UXjRWWjxhxW8IlsaU+SRBe9I7QoAJGlpHUiP7Km1iDOMZRIplCxz9eEEKA/IhlOnDQM2OO 32ihNae37eM+74eRCnFTt704tt3ESEQ= Received: from mail-oa1-f72.google.com (mail-oa1-f72.google.com [209.85.160.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-686-BKeS71v2Pj-juEWmeR3Ruw-1; Mon, 26 Aug 2024 03:55:48 -0400 X-MC-Unique: BKeS71v2Pj-juEWmeR3Ruw-1 Received: by mail-oa1-f72.google.com with SMTP id 586e51a60fabf-270333dbeaeso4440056fac.2 for ; Mon, 26 Aug 2024 00:55:48 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1724658948; x=1725263748; h=content-transfer-encoding:mime-version:organization:references :in-reply-to:message-id:subject:cc:to:from:date:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=kvr/04X3RZVhJrapu5qDkAeHl8NsM07m7XuxOBqDeck=; b=k9WchsF5LFZKopZNS/iIKym/aTVf9J0PxOpaG3+41GvbDZOIpylj/Xwg3wdKymG4EW Y7EtM1TywZI9tAU37yTgnnwHTUX7jcpkaqNGI3227h/lC+2fze1Ns2Q1hwWIgHCBZoMV P5dfV30t/BIkb8idNYq1sRPXmakdYANyl2afXBizglsQBKJ+2w4zJEKdULvxWOc8Wsst lCO9h8nOQ9Vm9D/k78Ro+csNlzyF9zj8gpHPEO354DU3z4Xj6XtsntN8GOuUo6JTqdAi XnQpR6c8+VOvso39ksZOiZPs+Fl3t56YexncGVOW9TvxsdDf2+L5dVI4EJfScpq05Wu5 6qZg== X-Forwarded-Encrypted: i=1; AJvYcCUYL3blYrkW9ONHRjWp1CHYnYyLRX6tYDiPG/N7u8DZooXK+3iA7tVAbpAM+g9AecoMm6QAenLT1qY=@passt.top X-Gm-Message-State: AOJu0YyDJJoDj3fULNvONg6H8QlMVMvySfBL03/hNHf1L7peigUQr+O/ mQ4x/J61I4ySjOY1cv2I9ulg8rcWefNZro0EumNHbRjnpg76u4Zgw6hbcksA1Gunk4eu1UvN0zN 7c0GbpDYe2TOP4jtKpaqgibdf+Hp6WBexYwrTGTCllS3z1mgCjg== X-Received: by 2002:a05:6870:d38d:b0:25e:2a65:59cf with SMTP id 586e51a60fabf-273e65200a6mr10351836fac.22.1724658947891; Mon, 26 Aug 2024 00:55:47 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHbtOMLT5bS6JP5T6a02Y+18tsndot9IfWH4daPNWXU8J5ZsWi+ldMj8f/T5BqAj9st4Cw+UQ== X-Received: by 2002:a05:6870:d38d:b0:25e:2a65:59cf with SMTP id 586e51a60fabf-273e65200a6mr10351819fac.22.1724658947407; Mon, 26 Aug 2024 00:55:47 -0700 (PDT) Received: from maya.myfinge.rs (ifcgrfdd.trafficplex.cloud. [2a10:fc81:a806:d6a9::1]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-714342e09e0sm6558428b3a.105.2024.08.26.00.55.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 26 Aug 2024 00:55:45 -0700 (PDT) Date: Mon, 26 Aug 2024 09:55:42 +0200 From: Stefano Brivio To: David Gibson Subject: Re: [PATCH v3 3/4] vhost-user: introduce vhost-user API Message-ID: <20240826095542.6ebe2410@elisabeth> In-Reply-To: References: <20240815155024.827956-1-lvivier@redhat.com> <20240815155024.827956-4-lvivier@redhat.com> <20240823001422.6c441841@elisabeth> Organization: Red Hat X-Mailer: Claws Mail 4.2.0 (GTK 3.24.41; x86_64-pc-linux-gnu) MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Message-ID-Hash: NY4GPJ3TR5VBZ4NAJJY6WFE7YFCRGX7W X-Message-ID-Hash: NY4GPJ3TR5VBZ4NAJJY6WFE7YFCRGX7W X-MailFrom: sbrivio@redhat.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Laurent Vivier , passt-dev@passt.top X-Mailman-Version: 3.3.8 Precedence: list List-Id: Development discussion and patches for passt Archived-At: Archived-At: List-Archive: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: On Mon, 26 Aug 2024 15:27:59 +1000 David Gibson wrote: > On Fri, Aug 23, 2024 at 12:14:22AM +0200, Stefano Brivio wrote: > > On Thu, 15 Aug 2024 17:50:22 +0200 > > Laurent Vivier wrote: > [snip] > > > > + if (sz_payload) { > > > + do { > > > + ret = recv(conn_fd, &vmsg->payload, sz_payload, 0); > > > + } while (ret < 0 && (errno == EINTR || errno == EAGAIN)); > > > > No need for curly brackets, it's a one-line statement. > > Unlike if, while or for, I'm pretty sure the braces are mandatory for > do {} while. What do you mean by mandatory? This is not covered in any special way by the kernel coding style documentation, and that statement is not a compound statement: $ cat dowhile.c #include int main() { int a = 3; do printf("%i\n", a--); while (a); return 0; } $ gcc -Wall -Wextra -pedantic -std=c89 -o dowhile dowhile.c $ ./dowhile 3 2 1 but sure, if you suggest that curly brackets improve clarity here, I have nothing against them. -- Stefano