bochs.c (fe5241bfe3fb61ec3f589ceacd91c1469bfd400f) | bochs.c (e2b8247a322cd92945785edf25f09e6b3e8285f9) |
---|---|
1/* 2 * Block driver for the various disk image formats used by Bochs 3 * Currently only for "growing" type in read-only mode 4 * 5 * Copyright (c) 2005 Alex Beregszaszi 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 --- 96 unchanged lines hidden (view full) --- 105 int ret; 106 107 bs->file = bdrv_open_child(NULL, options, "file", bs, &child_file, 108 false, errp); 109 if (!bs->file) { 110 return -EINVAL; 111 } 112 | 1/* 2 * Block driver for the various disk image formats used by Bochs 3 * Currently only for "growing" type in read-only mode 4 * 5 * Copyright (c) 2005 Alex Beregszaszi 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 --- 96 unchanged lines hidden (view full) --- 105 int ret; 106 107 bs->file = bdrv_open_child(NULL, options, "file", bs, &child_file, 108 false, errp); 109 if (!bs->file) { 110 return -EINVAL; 111 } 112 |
113 bdrv_set_read_only(bs, true); /* no write support yet */ | 113 ret = bdrv_set_read_only(bs, true, errp); /* no write support yet */ 114 if (ret < 0) { 115 return ret; 116 } |
114 115 ret = bdrv_pread(bs->file, 0, &bochs, sizeof(bochs)); 116 if (ret < 0) { 117 return ret; 118 } 119 120 if (strcmp(bochs.magic, HEADER_MAGIC) || 121 strcmp(bochs.type, REDOLOG_TYPE) || --- 186 unchanged lines hidden --- | 117 118 ret = bdrv_pread(bs->file, 0, &bochs, sizeof(bochs)); 119 if (ret < 0) { 120 return ret; 121 } 122 123 if (strcmp(bochs.magic, HEADER_MAGIC) || 124 strcmp(bochs.type, REDOLOG_TYPE) || --- 186 unchanged lines hidden --- |