qcow2.c (cf8074b3825f7229a20c60e679511592bde41340) qcow2.c (8d3b1a2d0b34a95800c482e1414c63f469ac4973)
1/*
2 * Block driver for the QCOW version 2 format
3 *
4 * Copyright (c) 2004-2006 Fabrice Bellard
5 *
6 * Permission is hereby granted, free of charge, to any person obtaining a copy
7 * of this software and associated documentation files (the "Software"), to deal
8 * in the Software without restriction, including without limitation the rights

--- 1644 unchanged lines hidden (view full) ---

1653#endif
1654
1655static int qcow2_save_vmstate(BlockDriverState *bs, QEMUIOVector *qiov,
1656 int64_t pos)
1657{
1658 BDRVQcowState *s = bs->opaque;
1659 int growable = bs->growable;
1660 int ret;
1/*
2 * Block driver for the QCOW version 2 format
3 *
4 * Copyright (c) 2004-2006 Fabrice Bellard
5 *
6 * Permission is hereby granted, free of charge, to any person obtaining a copy
7 * of this software and associated documentation files (the "Software"), to deal
8 * in the Software without restriction, including without limitation the rights

--- 1644 unchanged lines hidden (view full) ---

1653#endif
1654
1655static int qcow2_save_vmstate(BlockDriverState *bs, QEMUIOVector *qiov,
1656 int64_t pos)
1657{
1658 BDRVQcowState *s = bs->opaque;
1659 int growable = bs->growable;
1660 int ret;
1661 void *buf;
1662
1661
1663 buf = qemu_blockalign(bs, qiov->size);
1664 qemu_iovec_to_buf(qiov, 0, buf, qiov->size);
1665
1666 BLKDBG_EVENT(bs->file, BLKDBG_VMSTATE_SAVE);
1667 bs->growable = 1;
1662 BLKDBG_EVENT(bs->file, BLKDBG_VMSTATE_SAVE);
1663 bs->growable = 1;
1668 ret = bdrv_pwrite(bs, qcow2_vm_state_offset(s) + pos, buf, qiov->size);
1664 ret = bdrv_pwritev(bs, qcow2_vm_state_offset(s) + pos, qiov);
1669 bs->growable = growable;
1670
1665 bs->growable = growable;
1666
1671 qemu_vfree(buf);
1672
1673 return ret;
1674}
1675
1676static int qcow2_load_vmstate(BlockDriverState *bs, uint8_t *buf,
1677 int64_t pos, int size)
1678{
1679 BDRVQcowState *s = bs->opaque;
1680 int growable = bs->growable;

--- 100 unchanged lines hidden ---
1667 return ret;
1668}
1669
1670static int qcow2_load_vmstate(BlockDriverState *bs, uint8_t *buf,
1671 int64_t pos, int size)
1672{
1673 BDRVQcowState *s = bs->opaque;
1674 int growable = bs->growable;

--- 100 unchanged lines hidden ---