On Tue, Aug 23, 2022 at 12:12:44PM +0800, Sam Li wrote: > Stefan Hajnoczi <stefa...@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).
signature.asc
Description: PGP signature