Commit fdf263f6 authored by Andreas Färber's avatar Andreas Färber Committed by Stefan Hajnoczi
Browse files

block/raw-posix: Build fix for O_ASYNC



Commit eeb6b45d (block: raw-posix image
file reopen) broke the build on OpenIndiana.

illumos has no O_ASYNC. Exclude it from flags to be compared
and instead assert that it is not set where defined.

Cf. e61ab1da for qemu-ga.

Cc: qemu-stable@nongnu.org (1.3.x)
Cc: Jeff Cody <jcody@redhat.com>
Suggested-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
Signed-off-by: default avatarAndreas Färber <andreas.faerber@web.de>
Signed-off-by: default avatarStefan Hajnoczi <stefanha@redhat.com>
parent cd923475
Loading
Loading
Loading
Loading
+10 −1
Original line number Diff line number Diff line
@@ -345,11 +345,20 @@ static int raw_reopen_prepare(BDRVReopenState *state,

    raw_s->fd = -1;

    int fcntl_flags = O_APPEND | O_ASYNC | O_NONBLOCK;
    int fcntl_flags = O_APPEND | O_NONBLOCK;
#ifdef O_NOATIME
    fcntl_flags |= O_NOATIME;
#endif

#ifdef O_ASYNC
    /* Not all operating systems have O_ASYNC, and those that don't
     * will not let us track the state into raw_s->open_flags (typically
     * you achieve the same effect with an ioctl, for example I_SETSIG
     * on Solaris). But we do not use O_ASYNC, so that's fine.
     */
    assert((s->open_flags & O_ASYNC) == 0);
#endif

    if ((raw_s->open_flags & ~fcntl_flags) == (s->open_flags & ~fcntl_flags)) {
        /* dup the original fd */
        /* TODO: use qemu fcntl wrapper */