mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-04 00:03:54 -06:00
hw/ide: drop iov field from IDEState
@iov is used only to initialize @qiov. Let's use new qemu_iovec_init_buf() instead, which simplifies the code. Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com> Reviewed-by: Eric Blake <eblake@redhat.com> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Message-id: 20190218140926.333779-16-vsementsov@virtuozzo.com Message-Id: <20190218140926.333779-16-vsementsov@virtuozzo.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
This commit is contained in:
parent
405d8fe0ba
commit
e5863d49e4
3 changed files with 6 additions and 12 deletions
|
@ -174,16 +174,15 @@ static void cd_read_sector_cb(void *opaque, int ret)
|
|||
|
||||
static int cd_read_sector(IDEState *s)
|
||||
{
|
||||
void *buf;
|
||||
|
||||
if (s->cd_sector_size != 2048 && s->cd_sector_size != 2352) {
|
||||
block_acct_invalid(blk_get_stats(s->blk), BLOCK_ACCT_READ);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
s->iov.iov_base = (s->cd_sector_size == 2352) ?
|
||||
s->io_buffer + 16 : s->io_buffer;
|
||||
|
||||
s->iov.iov_len = ATAPI_SECTOR_SIZE;
|
||||
qemu_iovec_init_external(&s->qiov, &s->iov, 1);
|
||||
buf = (s->cd_sector_size == 2352) ? s->io_buffer + 16 : s->io_buffer;
|
||||
qemu_iovec_init_buf(&s->qiov, buf, ATAPI_SECTOR_SIZE);
|
||||
|
||||
trace_cd_read_sector(s->lba);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue