cloop.c (fe5241bfe3fb61ec3f589ceacd91c1469bfd400f) cloop.c (e2b8247a322cd92945785edf25f09e6b3e8285f9)
1/*
2 * QEMU Block driver for CLOOP 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

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

67 int ret;
68
69 bs->file = bdrv_open_child(NULL, options, "file", bs, &child_file,
70 false, errp);
71 if (!bs->file) {
72 return -EINVAL;
73 }
74
1/*
2 * QEMU Block driver for CLOOP 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

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

67 int ret;
68
69 bs->file = bdrv_open_child(NULL, options, "file", bs, &child_file,
70 false, errp);
71 if (!bs->file) {
72 return -EINVAL;
73 }
74
75 bdrv_set_read_only(bs, true);
75 ret = bdrv_set_read_only(bs, true, errp);
76 if (ret < 0) {
77 return ret;
78 }
76
77 /* read header */
78 ret = bdrv_pread(bs->file, 128, &s->block_size, 4);
79 if (ret < 0) {
80 return ret;
81 }
82 s->block_size = be32_to_cpu(s->block_size);
83 if (s->block_size % 512) {

--- 221 unchanged lines hidden ---
79
80 /* read header */
81 ret = bdrv_pread(bs->file, 128, &s->block_size, 4);
82 if (ret < 0) {
83 return ret;
84 }
85 s->block_size = be32_to_cpu(s->block_size);
86 if (s->block_size % 512) {

--- 221 unchanged lines hidden ---