All of lore.kernel.org
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@lst.de>
To: Juergen Lock <nox@jelal.kn-bremen.de>
Cc: Christoph Hellwig <hch@lst.de>, qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] PATCH: add missing (dummy) raw_aio_ioctl() for FreeBSD case
Date: Sat, 2 May 2009 20:01:55 +0200	[thread overview]
Message-ID: <20090502180155.GA11046@lst.de> (raw)
In-Reply-To: <20090502143045.GA3948@triton.kn-bremen.de>

On Sat, May 02, 2009 at 04:30:45PM +0200, Juergen Lock wrote:
>  
>  static int raw_ioctl(BlockDriverState *bs, unsigned long int req, void *buf)
>  {
> -    return -ENOTSUP;
> +    BDRVRawState *s = bs->opaque;
> +
> +    return ioctl(s->fd, req, buf);
> +}
> +
> +#ifdef CONFIG_AIO
> +static BlockDriverAIOCB *raw_aio_ioctl(BlockDriverState *bs,
> +        unsigned long int req, void *buf,
> +        BlockDriverCompletionFunc *cb, void *opaque)
> +{
> +    BDRVRawState *s = bs->opaque;
> +    RawAIOCB *acb;
> +
> +    if (fd_open(bs) < 0)
> +        return NULL;
> +
> +    acb = qemu_aio_get(bs, cb, opaque);
> +    if (!acb)
> +        return NULL;
> +    acb->aiocb.aio_fildes = s->fd;
> +    acb->aiocb.ev_signo = SIGUSR2;
> +    acb->aiocb.aio_offset = 0;
> +    acb->aiocb.aio_flags = 0;
> +
> +    acb->next = posix_aio_state->first_aio;
> +    posix_aio_state->first_aio = acb;
> +
> +    acb->aiocb.aio_ioctl_buf = buf;
> +    acb->aiocb.aio_ioctl_cmd = req;
> +    if (qemu_paio_ioctl(&acb->aiocb) < 0) {
> +        raw_aio_remove(acb);
> +        return NULL;
> +    }
> +
> +    return &acb->common;
>  }
> +#endif

Shouldn't we just make these implementations totally unconditional
(bdrv_ioctl) or conditional on CONFIG_AIO only (bdrv_aio_ioctl)?

I can't think of any Posix-ish operating system that wouldn't provide
the ioctl system call.

      reply	other threads:[~2009-05-02 18:02 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-05-01 19:30 [Qemu-devel] PATCH: add missing (dummy) raw_aio_ioctl() for FreeBSD case Juergen Lock
2009-05-01 20:05 ` Anthony Liguori
2009-05-01 20:18   ` M. Warner Losh
2009-05-01 21:19     ` Juergen Lock
2009-05-01 21:52       ` Christoph Hellwig
2009-05-02 14:30         ` Juergen Lock
2009-05-02 18:01           ` Christoph Hellwig [this message]

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=20090502180155.GA11046@lst.de \
    --to=hch@lst.de \
    --cc=nox@jelal.kn-bremen.de \
    --cc=qemu-devel@nongnu.org \
    /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.