qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [RFC PATCH 05/19] raw: Probe required direct I/O alignm


From: Kevin Wolf
Subject: Re: [Qemu-devel] [RFC PATCH 05/19] raw: Probe required direct I/O alignment
Date: Mon, 9 Dec 2013 13:58:06 +0100
User-agent: Mutt/1.5.21 (2010-09-15)

Am 06.12.2013 um 18:53 hat Paolo Bonzini geschrieben:
> Il 06/12/2013 18:22, Kevin Wolf ha scritto:
> > @@ -1227,6 +1288,7 @@ static BlockDriver bdrv_file = {
> >      .bdrv_aio_writev = raw_aio_writev,
> >      .bdrv_aio_flush = raw_aio_flush,
> >      .bdrv_aio_discard = raw_aio_discard,
> > +    .bdrv_opt_mem_align = raw_opt_mem_align,
> >  
> >      .bdrv_truncate = raw_truncate,
> >      .bdrv_getlength = raw_getlength,
> > @@ -1582,6 +1644,7 @@ static BlockDriver bdrv_host_device = {
> >      .bdrv_aio_writev       = raw_aio_writev,
> >      .bdrv_aio_flush        = raw_aio_flush,
> >      .bdrv_aio_discard   = hdev_aio_discard,
> > +    .bdrv_opt_mem_align = raw_opt_mem_align,
> 
> Should this rather be a BlockLimits field?

How is BlockLimits supposed with respect to inheritance of values
through the BDS tree? I tried looking at the code, but for example
bl.opt_transfer_length is only forwarded in raw, so for any other format
(or if you ever put a filter there) it simply doesn't work.

I could initialise a new BlockLimits.opt_mem_align field in
bdrv_open_common() with the value of bs->file->bl.opt_mem_align, and in
bdrv_open_backing_file() change it to MAX(bs->bl.opt_mem_align,
bs->backing_hd->bl.opt_mem_align). The block driver could then in
bdrv_open() override the former, but never the latter.

What would happen on bdrv_reopen(), specifically toggling O_DIRECT? The
values would have to change then.

Kevin



reply via email to

[Prev in Thread] Current Thread [Next in Thread]