qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Stefan Hajnoczi <stefanha@redhat.com>
To: Sam Li <faithilikerun@gmail.com>
Cc: qemu-devel <qemu-devel@nongnu.org>,
	Hannes Reinecke <hare@suse.de>, Fam Zheng <fam@euphon.net>,
	Kevin Wolf <kwolf@redhat.com>, Eric Blake <eblake@redhat.com>,
	Markus Armbruster <armbru@redhat.com>,
	Hanna Reitz <hreitz@redhat.com>,
	Dmitry Fomichev <dmitry.fomichev@wdc.com>,
	qemu block <qemu-block@nongnu.org>,
	Damien Le Moal <damien.lemoal@opensource.wdc.com>
Subject: Re: [PATCH v7 4/8] block: add block layer APIs resembling Linux ZonedBlockDevice ioctls
Date: Tue, 23 Aug 2022 08:40:22 -0400	[thread overview]
Message-ID: <YwTKtrBdda6xEX2z@fedora> (raw)
In-Reply-To: <CAAAx-8Jk1d4wO5bfNPOLb_XStOC8Bz07kxVbBC3f9-+u3ZxXqA@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 1664 bytes --]

On Tue, Aug 23, 2022 at 12:12:44PM +0800, Sam Li wrote:
> Stefan Hajnoczi <stefanha@redhat.com> 于2022年8月23日周二 08:49写道:
> > On Tue, Aug 16, 2022 at 02:25:18PM +0800, Sam Li wrote:
> > > +static int handle_aiocb_zone_report(void *opaque) {
> > > +#if defined(CONFIG_BLKZONED)
> > > +    RawPosixAIOData *aiocb = opaque;
> > > +    int fd = aiocb->aio_fildes;
> > > +    unsigned int *nr_zones = aiocb->zone_report.nr_zones;
> > > +    BlockZoneDescriptor *zones = aiocb->zone_report.zones;
> > > +    int64_t sector = aiocb->aio_offset;
> > > +
> > > +    struct blk_zone *blkz;
> > > +    int64_t rep_size;
> > > +    unsigned int nrz;
> > > +    int ret, n = 0, i = 0;
> > > +
> > > +    nrz = *nr_zones;
> > > +    rep_size = sizeof(struct blk_zone_report) + nrz * sizeof(struct blk_zone);
> > > +    g_autofree struct blk_zone_report *rep = NULL;
> > > +    rep = g_malloc(rep_size);
> > > +
> > > +    blkz = (struct blk_zone *)(rep + 1);
> > > +    while (n < nrz) {
> > > +        memset(rep, 0, rep_size);
> > > +        rep->sector = sector;
> > > +        rep->nr_zones = nrz - n;
> > > +
> > > +        ret = ioctl(fd, BLKREPORTZONE, rep);
> >
> > Does this ioctl() need "do { ... } while (ret == -1 && errno == EINTR)"?
> 
> No? We discussed this before. I guess even EINTR should be propagated
> back to the guest. Maybe Damien can talk more about why.

No, EINTR is an internal error that must be handled by QEMU. It means
the QEMU process' syscall was interrupted by a signal and the syscall
must be retried. The guest shouldn't see EINTR (and there is no
virtio-blk error code defined for it).

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

  reply	other threads:[~2022-08-23 12:52 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-16  6:25 [PATCH v7 0/8] Add support for zoned device Sam Li
2022-08-16  6:25 ` [PATCH v7 1/8] include: add zoned device structs Sam Li
2022-08-16 17:27   ` Damien Le Moal
2022-08-16  6:25 ` [PATCH v7 2/8] file-posix: introduce get_sysfs_str_val for device zoned model Sam Li
2022-08-16 16:11   ` Sam Li
2022-08-16 17:32   ` Damien Le Moal
2022-08-22 23:05   ` Stefan Hajnoczi
2022-08-23  4:31     ` Sam Li
2022-08-16  6:25 ` [PATCH v7 3/8] file-posix: introduce get_sysfs_long_val for the long sysfs attribute Sam Li
2022-08-16 16:13   ` Sam Li
2022-08-16 17:35   ` Damien Le Moal
2022-08-16 17:53     ` Sam Li
2022-08-16 17:55       ` Damien Le Moal
2022-08-16  6:25 ` [PATCH v7 4/8] block: add block layer APIs resembling Linux ZonedBlockDevice ioctls Sam Li
2022-08-16 17:50   ` Damien Le Moal
2022-08-26 12:20     ` Sam Li
2022-08-23  0:49   ` Stefan Hajnoczi
2022-08-23  4:12     ` Sam Li
2022-08-23 12:40       ` Stefan Hajnoczi [this message]
2022-08-24 23:46       ` Damien Le Moal
2022-08-24 23:53         ` Damien Le Moal
2022-08-16  6:25 ` [PATCH v7 5/8] raw-format: add zone operations to pass through requests Sam Li
2022-08-16  6:25 ` [PATCH v7 6/8] config: add check to block layer Sam Li
2022-08-23  0:54   ` Stefan Hajnoczi
2022-08-23  4:25     ` Sam Li
2022-08-23 12:36       ` Stefan Hajnoczi
2022-08-16  6:25 ` [PATCH v7 7/8] qemu-iotests: test new zone operations Sam Li
2022-08-16  6:25 ` [PATCH v7 8/8] docs/zoned-storage: add zoned device documentation Sam Li

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=YwTKtrBdda6xEX2z@fedora \
    --to=stefanha@redhat.com \
    --cc=armbru@redhat.com \
    --cc=damien.lemoal@opensource.wdc.com \
    --cc=dmitry.fomichev@wdc.com \
    --cc=eblake@redhat.com \
    --cc=faithilikerun@gmail.com \
    --cc=fam@euphon.net \
    --cc=hare@suse.de \
    --cc=hreitz@redhat.com \
    --cc=kwolf@redhat.com \
    --cc=qemu-block@nongnu.org \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).