Revision eb5a3165

b/block.c
684 684
    int64_t i, total_sectors;
685 685
    int n, j, ro, open_flags;
686 686
    int ret = 0, rw_ret = 0;
687
    unsigned char sector[512];
687
    unsigned char sector[BDRV_SECTOR_SIZE];
688 688
    char filename[1024];
689 689
    BlockDriverState *bs_rw, *bs_ro;
690 690

  
......
824 824
static int bdrv_check_request(BlockDriverState *bs, int64_t sector_num,
825 825
                              int nb_sectors)
826 826
{
827
    return bdrv_check_byte_request(bs, sector_num * 512, nb_sectors * 512);
827
    return bdrv_check_byte_request(bs, sector_num * BDRV_SECTOR_SIZE,
828
                                   nb_sectors * BDRV_SECTOR_SIZE);
828 829
}
829 830

  
830 831
/* return < 0 if error. See bdrv_write() for the return codes */
......
1059 1060
static int guess_disk_lchs(BlockDriverState *bs,
1060 1061
                           int *pcylinders, int *pheads, int *psectors)
1061 1062
{
1062
    uint8_t buf[512];
1063
    uint8_t buf[BDRV_SECTOR_SIZE];
1063 1064
    int ret, i, heads, sectors, cylinders;
1064 1065
    struct partition *p;
1065 1066
    uint32_t nr_sects;
......
1535 1536
                             "} }",
1536 1537
                             bs->rd_bytes, bs->wr_bytes,
1537 1538
                             bs->rd_ops, bs->wr_ops,
1538
                             bs->wr_highest_sector * 512);
1539
                             bs->wr_highest_sector * (long)BDRV_SECTOR_SIZE);
1539 1540
    dict  = qobject_to_qdict(res);
1540 1541

  
1541 1542
    if (*bs->device_name) {
......
2197 2198

  
2198 2199
    async_ret = NOT_DONE;
2199 2200
    iov.iov_base = (void *)buf;
2200
    iov.iov_len = nb_sectors * 512;
2201
    iov.iov_len = nb_sectors * BDRV_SECTOR_SIZE;
2201 2202
    qemu_iovec_init_external(&qiov, &iov, 1);
2202 2203
    acb = bdrv_aio_readv(bs, sector_num, &qiov, nb_sectors,
2203 2204
        bdrv_rw_em_cb, &async_ret);
......
2228 2229

  
2229 2230
    async_ret = NOT_DONE;
2230 2231
    iov.iov_base = (void *)buf;
2231
    iov.iov_len = nb_sectors * 512;
2232
    iov.iov_len = nb_sectors * BDRV_SECTOR_SIZE;
2232 2233
    qemu_iovec_init_external(&qiov, &iov, 1);
2233 2234
    acb = bdrv_aio_writev(bs, sector_num, &qiov, nb_sectors,
2234 2235
        bdrv_rw_em_cb, &async_ret);

Also available in: Unified diff