qcow2.c (1bd0e2d1c40ef1dbe717728197071e931abe22a4) qcow2.c (c282e1fdf7ec9659c7f320123be397477a359d01)
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

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

1622 * size for any qcow2 image.
1623 */
1624 BlockDriverState* bs;
1625 QCowHeader *header;
1626 uint64_t* refcount_table;
1627 Error *local_err = NULL;
1628 int ret;
1629
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

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

1622 * size for any qcow2 image.
1623 */
1624 BlockDriverState* bs;
1625 QCowHeader *header;
1626 uint64_t* refcount_table;
1627 Error *local_err = NULL;
1628 int ret;
1629
1630 ret = bdrv_create_file(filename, NULL, opts, &local_err);
1630 ret = bdrv_create_file(filename, opts, &local_err);
1631 if (ret < 0) {
1632 error_propagate(errp, local_err);
1633 return ret;
1634 }
1635
1636 bs = NULL;
1637 ret = bdrv_open(&bs, filename, NULL, NULL, BDRV_O_RDWR | BDRV_O_PROTOCOL,
1638 NULL, &local_err);

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

2388
2389static BlockDriver bdrv_qcow2 = {
2390 .format_name = "qcow2",
2391 .instance_size = sizeof(BDRVQcowState),
2392 .bdrv_probe = qcow2_probe,
2393 .bdrv_open = qcow2_open,
2394 .bdrv_close = qcow2_close,
2395 .bdrv_reopen_prepare = qcow2_reopen_prepare,
1631 if (ret < 0) {
1632 error_propagate(errp, local_err);
1633 return ret;
1634 }
1635
1636 bs = NULL;
1637 ret = bdrv_open(&bs, filename, NULL, NULL, BDRV_O_RDWR | BDRV_O_PROTOCOL,
1638 NULL, &local_err);

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

2388
2389static BlockDriver bdrv_qcow2 = {
2390 .format_name = "qcow2",
2391 .instance_size = sizeof(BDRVQcowState),
2392 .bdrv_probe = qcow2_probe,
2393 .bdrv_open = qcow2_open,
2394 .bdrv_close = qcow2_close,
2395 .bdrv_reopen_prepare = qcow2_reopen_prepare,
2396 .bdrv_create2 = qcow2_create,
2396 .bdrv_create = qcow2_create,
2397 .bdrv_has_zero_init = bdrv_has_zero_init_1,
2398 .bdrv_co_get_block_status = qcow2_co_get_block_status,
2399 .bdrv_set_key = qcow2_set_key,
2400
2401 .bdrv_co_readv = qcow2_co_readv,
2402 .bdrv_co_writev = qcow2_co_writev,
2403 .bdrv_co_flush_to_os = qcow2_co_flush_to_os,
2404

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

2420
2421 .bdrv_change_backing_file = qcow2_change_backing_file,
2422
2423 .bdrv_refresh_limits = qcow2_refresh_limits,
2424 .bdrv_invalidate_cache = qcow2_invalidate_cache,
2425
2426 .create_opts = &qcow2_create_opts,
2427 .bdrv_check = qcow2_check,
2397 .bdrv_has_zero_init = bdrv_has_zero_init_1,
2398 .bdrv_co_get_block_status = qcow2_co_get_block_status,
2399 .bdrv_set_key = qcow2_set_key,
2400
2401 .bdrv_co_readv = qcow2_co_readv,
2402 .bdrv_co_writev = qcow2_co_writev,
2403 .bdrv_co_flush_to_os = qcow2_co_flush_to_os,
2404

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

2420
2421 .bdrv_change_backing_file = qcow2_change_backing_file,
2422
2423 .bdrv_refresh_limits = qcow2_refresh_limits,
2424 .bdrv_invalidate_cache = qcow2_invalidate_cache,
2425
2426 .create_opts = &qcow2_create_opts,
2427 .bdrv_check = qcow2_check,
2428 .bdrv_amend_options2 = qcow2_amend_options,
2428 .bdrv_amend_options = qcow2_amend_options,
2429};
2430
2431static void bdrv_qcow2_init(void)
2432{
2433 bdrv_register(&bdrv_qcow2);
2434}
2435
2436block_init(bdrv_qcow2_init);
2429};
2430
2431static void bdrv_qcow2_init(void)
2432{
2433 bdrv_register(&bdrv_qcow2);
2434}
2435
2436block_init(bdrv_qcow2_init);