qemu-img.c (7078dead94a24bc4e5819e4a6448bd5738a2d088) qemu-img.c (b783e409bf17b92f4af8dc5d6bd040d0092f33e0)
1/*
2 * QEMU disk image utility
3 *
4 * Copyright (c) 2003-2008 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

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

879 error("Not enough memory");
880 if (fmt) {
881 drv = bdrv_find_format(fmt);
882 if (!drv)
883 error("Unknown file format '%s'", fmt);
884 } else {
885 drv = NULL;
886 }
1/*
2 * QEMU disk image utility
3 *
4 * Copyright (c) 2003-2008 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

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

879 error("Not enough memory");
880 if (fmt) {
881 drv = bdrv_find_format(fmt);
882 if (!drv)
883 error("Unknown file format '%s'", fmt);
884 } else {
885 drv = NULL;
886 }
887 if (bdrv_open2(bs, filename, BRDV_O_FLAGS, drv) < 0) {
887 if (bdrv_open2(bs, filename, BRDV_O_FLAGS | BDRV_O_NO_BACKING, drv) < 0) {
888 error("Could not open '%s'", filename);
889 }
890 bdrv_get_format(bs, fmt_name, sizeof(fmt_name));
891 bdrv_get_geometry(bs, &total_sectors);
892 get_human_readable_size(size_buf, sizeof(size_buf), total_sectors * 512);
893 allocated_size = get_allocated_file_size(filename);
894 if (allocated_size < 0)
895 snprintf(dsize_buf, sizeof(dsize_buf), "unavailable");

--- 171 unchanged lines hidden ---
888 error("Could not open '%s'", filename);
889 }
890 bdrv_get_format(bs, fmt_name, sizeof(fmt_name));
891 bdrv_get_geometry(bs, &total_sectors);
892 get_human_readable_size(size_buf, sizeof(size_buf), total_sectors * 512);
893 allocated_size = get_allocated_file_size(filename);
894 if (allocated_size < 0)
895 snprintf(dsize_buf, sizeof(dsize_buf), "unavailable");

--- 171 unchanged lines hidden ---