于 2012-9-3 23:18, Paolo Bonzini 写道:
Il 03/09/2012 16:28, Eric Blake ha scritto:
+/* this file contains helper function used internally. */
+#define SECTOR_SIZE (512)
Hard-coding this feels wrong, in this day and age of disks with 4096
sectors.  Why isn't this a per-image property?

In this day and age of disks with 4096 sectors, Linux does not provide a
way to query the required alignment for O_DIRECT...

Paolo

in block.h:
#define BDRV_SECTOR_BITS   9
#define BDRV_SECTOR_SIZE   (1ULL << BDRV_SECTOR_BITS)
#define BDRV_SECTOR_MASK   ~(BDRV_SECTOR_SIZE - 1)
  it seems block size is always 512 in qemu block layer, so I can
ignore the 4096 case, do you think so?
--
Best Regards

Wenchao Xia


Reply via email to