static void virtio_blk_update_config(VirtIODevice *vdev, uint8_t *config)

{

    VirtIOBlock *s = to_virtio_blk(vdev);

    struct virtio_blk_config blkcfg;

    uint64_t capacity;

    int cylinders, heads, secs;



    bdrv_get_geometry(s->bs, &capacity);

    bdrv_get_geometry_hint(s->bs, &cylinders, &heads, &secs);

    stq_raw(&blkcfg.capacity, capacity);

    stl_raw(&blkcfg.seg_max, 128 - 2);

    stw_raw(&blkcfg.cylinders, cylinders);

    blkcfg.heads = heads;

    blkcfg.sectors = secs;


    memcpy(config, &blkcfg, sizeof(blkcfg));

}
static void virtio_blk_update_config(VirtIODevice *vdev, uint8_t *config)

{

    VirtIOBlock *s = to_virtio_blk(vdev);

    struct virtio_blk_config blkcfg;

    uint64_t capacity;

    int cylinders, heads, secs;



    bdrv_get_geometry(s->bs, &capacity);

    bdrv_get_geometry_hint(s->bs, &cylinders, &heads, &secs);

    stq_raw(&blkcfg.capacity, capacity);

    stl_raw(&blkcfg.seg_max, 128 - 2);

    stw_raw(&blkcfg.cylinders, cylinders);

    blkcfg.heads = heads;

    blkcfg.sectors = secs;


    memcpy(config, &blkcfg, sizeof(blkcfg));

}
static void FUNC_0(VirtIODevice *VAR_0, uint8_t *VAR_1)

{

    VirtIOBlock *s = to_virtio_blk(VAR_0);

    struct virtio_blk_config VAR_2;

    uint64_t capacity;

    int VAR_3, VAR_4, VAR_5;



    bdrv_get_geometry(s->bs, &capacity);

    bdrv_get_geometry_hint(s->bs, &VAR_3, &VAR_4, &VAR_5);

    stq_raw(&VAR_2.capacity, capacity);

    stl_raw(&VAR_2.seg_max, 128 - 2);

    stw_raw(&VAR_2.VAR_3, VAR_3);

    VAR_2.VAR_4 = VAR_4;

    VAR_2.sectors = VAR_5;


    memcpy(VAR_1, &VAR_2, sizeof(VAR_2));

}
static void FUNC_0(VirtIODevice *VAR_0, uint8_t *VAR_1)
{ VirtIOBlock *s = to_virtio_blk(VAR_0); struct virtio_blk_config VAR_2; uint64_t capacity; int VAR_3, VAR_4, VAR_5; bdrv_get_geometry(s->bs, &capacity); bdrv_get_geometry_hint(s->bs, &VAR_3, &VAR_4, &VAR_5); stq_raw(&VAR_2.capacity, capacity); stl_raw(&VAR_2.seg_max, 128 - 2); stw_raw(&VAR_2.VAR_3, VAR_3); VAR_2.VAR_4 = VAR_4; VAR_2.sectors = VAR_5; memcpy(VAR_1, &VAR_2, sizeof(VAR_2)); }