block.c (66f82ceed6781261c09e65fb440ca76842fd0500) block.c (f2feebbd93c251ec0098a9ccf808f7cb1da7f67c)
1/*
2 * QEMU System Emulator block driver
3 *
4 * Copyright (c) 2003 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

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

1277 QTAILQ_FOREACH(bs, &bdrv_states, list) {
1278 if (bs->drv && !bdrv_is_read_only(bs) &&
1279 (!bdrv_is_removable(bs) || bdrv_is_inserted(bs))) {
1280 bdrv_flush(bs);
1281 }
1282 }
1283}
1284
1/*
2 * QEMU System Emulator block driver
3 *
4 * Copyright (c) 2003 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

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

1277 QTAILQ_FOREACH(bs, &bdrv_states, list) {
1278 if (bs->drv && !bdrv_is_read_only(bs) &&
1279 (!bdrv_is_removable(bs) || bdrv_is_inserted(bs))) {
1280 bdrv_flush(bs);
1281 }
1282 }
1283}
1284
1285int bdrv_has_zero_init(BlockDriverState *bs)
1286{
1287 assert(bs->drv);
1288
1289 if (bs->drv->no_zero_init) {
1290 return 0;
1291 } else if (bs->file) {
1292 return bdrv_has_zero_init(bs->file);
1293 }
1294
1295 return 1;
1296}
1297
1285/*
1286 * Returns true iff the specified sector is present in the disk image. Drivers
1287 * not implementing the functionality are assumed to not support backing files,
1288 * hence all their sectors are reported as allocated.
1289 *
1290 * 'pnum' is set to the number of sectors (including and immediately following
1291 * the specified sector) that are known to be in the same
1292 * allocated/unallocated state.

--- 1076 unchanged lines hidden ---
1298/*
1299 * Returns true iff the specified sector is present in the disk image. Drivers
1300 * not implementing the functionality are assumed to not support backing files,
1301 * hence all their sectors are reported as allocated.
1302 *
1303 * 'pnum' is set to the number of sectors (including and immediately following
1304 * the specified sector) that are known to be in the same
1305 * allocated/unallocated state.

--- 1076 unchanged lines hidden ---