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