dmg.c (fe5241bfe3fb61ec3f589ceacd91c1469bfd400f) dmg.c (e2b8247a322cd92945785edf25f09e6b3e8285f9)
1/*
2 * QEMU Block driver for DMG images
3 *
4 * Copyright (c) 2004 Johannes E. Schindelin
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

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

414 int ret;
415
416 bs->file = bdrv_open_child(NULL, options, "file", bs, &child_file,
417 false, errp);
418 if (!bs->file) {
419 return -EINVAL;
420 }
421
1/*
2 * QEMU Block driver for DMG images
3 *
4 * Copyright (c) 2004 Johannes E. Schindelin
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

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

414 int ret;
415
416 bs->file = bdrv_open_child(NULL, options, "file", bs, &child_file,
417 false, errp);
418 if (!bs->file) {
419 return -EINVAL;
420 }
421
422 ret = bdrv_set_read_only(bs, true, errp);
423 if (ret < 0) {
424 return ret;
425 }
426
422 block_module_load_one("dmg-bz2");
427 block_module_load_one("dmg-bz2");
423 bdrv_set_read_only(bs, true);
424
425 s->n_chunks = 0;
426 s->offsets = s->lengths = s->sectors = s->sectorcounts = NULL;
427 /* used by dmg_read_mish_block to keep track of the current I/O position */
428 ds.data_fork_offset = 0;
429 ds.max_compressed_size = 1;
430 ds.max_sectors_per_chunk = 1;
431

--- 279 unchanged lines hidden ---
428
429 s->n_chunks = 0;
430 s->offsets = s->lengths = s->sectors = s->sectorcounts = NULL;
431 /* used by dmg_read_mish_block to keep track of the current I/O position */
432 ds.data_fork_offset = 0;
433 ds.max_compressed_size = 1;
434 ds.max_sectors_per_chunk = 1;
435

--- 279 unchanged lines hidden ---