All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Daniel P. Berrangé" <berrange@redhat.com>
To: Stefano Garzarella <sgarzare@redhat.com>
Cc: qemu-devel@nongnu.org, "Gerd Hoffmann" <kraxel@redhat.com>,
	"Eric Blake" <eblake@redhat.com>,
	"Igor Mammedov" <imammedo@redhat.com>,
	"Paolo Bonzini" <pbonzini@redhat.com>,
	"Laurent Vivier" <lvivier@redhat.com>,
	"Philippe Mathieu-Daudé" <philmd@linaro.org>,
	"Brad Smith" <brad@comstyle.com>,
	"Michael S. Tsirkin" <mst@redhat.com>,
	"Coiby Xu" <Coiby.Xu@gmail.com>,
	"Markus Armbruster" <armbru@redhat.com>,
	"David Hildenbrand" <david@redhat.com>,
	slp@redhat.com, "Eduardo Habkost" <eduardo@habkost.net>,
	stefanha@redhat.com, "Hanna Reitz" <hreitz@redhat.com>,
	"Raphael Norwitz" <raphael@enfabrica.net>,
	"Jason Wang" <jasowang@redhat.com>,
	"Marc-André Lureau" <marcandre.lureau@redhat.com>,
	"Kevin Wolf" <kwolf@redhat.com>,
	gmaglione@redhat.com, "Thomas Huth" <thuth@redhat.com>,
	qemu-block@nongnu.org
Subject: Re: [PATCH v5 09/13] osdep: move O_DSYNC and O_DIRECT defines from file-posix
Date: Thu, 23 May 2024 16:14:48 +0100	[thread overview]
Message-ID: <Zk9daPZHwpQktl9G@redhat.com> (raw)
In-Reply-To: <20240523145522.313012-10-sgarzare@redhat.com>

On Thu, May 23, 2024 at 04:55:18PM +0200, Stefano Garzarella wrote:
> These defines are also useful for vhost-user-blk when it is compiled
> in some POSIX systems that do not define them, so let's move them to
> “qemu/osdep.h”.
> 
> Suggested-by: Philippe Mathieu-Daudé <philmd@linaro.org>
> Signed-off-by: Stefano Garzarella <sgarzare@redhat.com>
> ---
>  include/qemu/osdep.h | 14 ++++++++++++++
>  block/file-posix.c   | 14 --------------
>  2 files changed, 14 insertions(+), 14 deletions(-)
> 
> diff --git a/include/qemu/osdep.h b/include/qemu/osdep.h
> index f61edcfdc2..e165b5cb1b 100644
> --- a/include/qemu/osdep.h
> +++ b/include/qemu/osdep.h
> @@ -325,6 +325,20 @@ void QEMU_ERROR("code path is reachable")
>  #define ESHUTDOWN 4099
>  #endif
>  
> +/* OS X does not have O_DSYNC */
> +#ifndef O_DSYNC
> +#ifdef O_SYNC
> +#define O_DSYNC O_SYNC
> +#elif defined(O_FSYNC)
> +#define O_DSYNC O_FSYNC
> +#endif
> +#endif
> +
> +/* Approximate O_DIRECT with O_DSYNC if O_DIRECT isn't available */
> +#ifndef O_DIRECT
> +#define O_DIRECT O_DSYNC
> +#endif

Please don't do this - we can't be confident that all code in
QEMU will be OK with O_DIRECT being simulated in this way.

I'm not convinced that the O_DSYNC simulation is a good idea
to do tree-wide either.

With regards,
Daniel
-- 
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|



  parent reply	other threads:[~2024-05-23 15:15 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-23 14:55 [PATCH v5 00/13] vhost-user: support any POSIX system (tested on macOS, FreeBSD, OpenBSD) Stefano Garzarella
2024-05-23 14:55 ` [PATCH v5 01/13] libvhost-user: set msg.msg_control to NULL when it is empty Stefano Garzarella
2024-05-23 14:55 ` [PATCH v5 02/13] libvhost-user: fail vu_message_write() if sendmsg() is failing Stefano Garzarella
2024-05-23 15:00   ` David Hildenbrand
2024-05-23 14:55 ` [PATCH v5 03/13] libvhost-user: mask F_INFLIGHT_SHMFD if memfd is not supported Stefano Garzarella
2024-05-23 15:00   ` David Hildenbrand
2024-05-23 14:55 ` [PATCH v5 04/13] vhost-user-server: do not set memory fd non-blocking Stefano Garzarella
2024-05-23 15:01   ` David Hildenbrand
2024-05-23 14:55 ` [PATCH v5 05/13] contrib/vhost-user-blk: fix bind() using the right size of the address Stefano Garzarella
2024-05-23 15:02   ` David Hildenbrand
2024-05-23 14:55 ` [PATCH v5 06/13] contrib/vhost-user-*: use QEMU bswap helper functions Stefano Garzarella
2024-05-23 15:03   ` David Hildenbrand
2024-05-23 14:55 ` [PATCH v5 07/13] vhost-user: enable frontends on any POSIX system Stefano Garzarella
2024-05-23 15:03   ` David Hildenbrand
2024-05-23 14:55 ` [PATCH v5 08/13] libvhost-user: enable it " Stefano Garzarella
2024-05-23 14:55 ` [PATCH v5 09/13] osdep: move O_DSYNC and O_DIRECT defines from file-posix Stefano Garzarella
2024-05-23 15:09   ` Stefano Garzarella
2024-05-23 15:14   ` Daniel P. Berrangé [this message]
2024-05-23 15:21     ` Stefano Garzarella
2024-05-23 14:55 ` [PATCH v5 10/13] contrib/vhost-user-blk: enable it on any POSIX system Stefano Garzarella
2024-05-23 14:55 ` [PATCH v5 11/13] hostmem: add a new memory backend based on POSIX shm_open() Stefano Garzarella
2024-05-23 14:55 ` [PATCH v5 12/13] tests/qtest/vhost-user-blk-test: use memory-backend-shm Stefano Garzarella
2024-05-23 15:06   ` David Hildenbrand
2024-05-23 15:26     ` Stefano Garzarella
2024-05-23 14:55 ` [PATCH v5 13/13] tests/qtest/vhost-user-test: add a test case for memory-backend-shm Stefano Garzarella
2024-05-23 15:06   ` David Hildenbrand

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Zk9daPZHwpQktl9G@redhat.com \
    --to=berrange@redhat.com \
    --cc=Coiby.Xu@gmail.com \
    --cc=armbru@redhat.com \
    --cc=brad@comstyle.com \
    --cc=david@redhat.com \
    --cc=eblake@redhat.com \
    --cc=eduardo@habkost.net \
    --cc=gmaglione@redhat.com \
    --cc=hreitz@redhat.com \
    --cc=imammedo@redhat.com \
    --cc=jasowang@redhat.com \
    --cc=kraxel@redhat.com \
    --cc=kwolf@redhat.com \
    --cc=lvivier@redhat.com \
    --cc=marcandre.lureau@redhat.com \
    --cc=mst@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=philmd@linaro.org \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=raphael@enfabrica.net \
    --cc=sgarzare@redhat.com \
    --cc=slp@redhat.com \
    --cc=stefanha@redhat.com \
    --cc=thuth@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.