vmdk.c (668f62ec621e4e2919fb7d4caa5d805764c5852d) | vmdk.c (af175e85f92c870386ad74f466e29537b79611d3) |
---|---|
1/* 2 * Block driver for the VMDK format 3 * 4 * Copyright (c) 2004 Fabrice Bellard 5 * Copyright (c) 2005 Filip Navara 6 * 7 * Permission is hereby granted, free of charge, to any person obtaining a copy 8 * of this software and associated documentation files (the "Software"), to deal --- 2236 unchanged lines hidden (view full) --- 2245 2246static int vmdk_create_extent(const char *filename, int64_t filesize, 2247 bool flat, bool compress, bool zeroed_grain, 2248 BlockBackend **pbb, 2249 QemuOpts *opts, Error **errp) 2250{ 2251 int ret; 2252 BlockBackend *blk = NULL; | 1/* 2 * Block driver for the VMDK format 3 * 4 * Copyright (c) 2004 Fabrice Bellard 5 * Copyright (c) 2005 Filip Navara 6 * 7 * Permission is hereby granted, free of charge, to any person obtaining a copy 8 * of this software and associated documentation files (the "Software"), to deal --- 2236 unchanged lines hidden (view full) --- 2245 2246static int vmdk_create_extent(const char *filename, int64_t filesize, 2247 bool flat, bool compress, bool zeroed_grain, 2248 BlockBackend **pbb, 2249 QemuOpts *opts, Error **errp) 2250{ 2251 int ret; 2252 BlockBackend *blk = NULL; |
2253 Error *local_err = NULL; | |
2254 2255 ret = bdrv_create_file(filename, opts, errp); 2256 if (ret < 0) { 2257 goto exit; 2258 } 2259 2260 blk = blk_new_open(filename, NULL, NULL, 2261 BDRV_O_RDWR | BDRV_O_RESIZE | BDRV_O_PROTOCOL, | 2253 2254 ret = bdrv_create_file(filename, opts, errp); 2255 if (ret < 0) { 2256 goto exit; 2257 } 2258 2259 blk = blk_new_open(filename, NULL, NULL, 2260 BDRV_O_RDWR | BDRV_O_RESIZE | BDRV_O_PROTOCOL, |
2262 &local_err); | 2261 errp); |
2263 if (blk == NULL) { | 2262 if (blk == NULL) { |
2264 error_propagate(errp, local_err); | |
2265 ret = -EIO; 2266 goto exit; 2267 } 2268 2269 blk_set_allow_write_beyond_eof(blk, true); 2270 2271 ret = vmdk_init_extent(blk, filesize, flat, compress, zeroed_grain, errp); 2272exit: --- 824 unchanged lines hidden --- | 2263 ret = -EIO; 2264 goto exit; 2265 } 2266 2267 blk_set_allow_write_beyond_eof(blk, true); 2268 2269 ret = vmdk_init_extent(blk, filesize, flat, compress, zeroed_grain, errp); 2270exit: --- 824 unchanged lines hidden --- |