qcow2.c (753d9b82c5a18182294980f4fc1081d7926aae83) qcow2.c (cf8074b3825f7229a20c60e679511592bde41340)
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

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

1647 while (k < nb_clusters && get_refcount(bs, k) == refcount)
1648 k++;
1649 printf("%" PRId64 ": refcount=%d nb=%" PRId64 "\n", k, refcount,
1650 k - k1);
1651 }
1652}
1653#endif
1654
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

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

1647 while (k < nb_clusters && get_refcount(bs, k) == refcount)
1648 k++;
1649 printf("%" PRId64 ": refcount=%d nb=%" PRId64 "\n", k, refcount,
1650 k - k1);
1651 }
1652}
1653#endif
1654
1655static int qcow2_save_vmstate(BlockDriverState *bs, const uint8_t *buf,
1656 int64_t pos, int size)
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;
1657{
1658 BDRVQcowState *s = bs->opaque;
1659 int growable = bs->growable;
1660 int ret;
1661 void *buf;
1661
1662
1663 buf = qemu_blockalign(bs, qiov->size);
1664 qemu_iovec_to_buf(qiov, 0, buf, qiov->size);
1665
1662 BLKDBG_EVENT(bs->file, BLKDBG_VMSTATE_SAVE);
1663 bs->growable = 1;
1666 BLKDBG_EVENT(bs->file, BLKDBG_VMSTATE_SAVE);
1667 bs->growable = 1;
1664 ret = bdrv_pwrite(bs, qcow2_vm_state_offset(s) + pos, buf, size);
1668 ret = bdrv_pwrite(bs, qcow2_vm_state_offset(s) + pos, buf, qiov->size);
1665 bs->growable = growable;
1666
1669 bs->growable = growable;
1670
1671 qemu_vfree(buf);
1672
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 ---
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 ---