block.c (8b8277cdb05eef79bfe6b14c21dfaa027cebbd08) | block.c (ae23f78646e9635ec9cbf15dbf82a717ea1b0e69) |
---|---|
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 --- 5051 unchanged lines hidden (view full) --- 5060 *nb_sectors_ptr = nb_sectors < 0 ? 0 : nb_sectors; 5061} 5062 5063bool bdrv_is_sg(BlockDriverState *bs) 5064{ 5065 return bs->sg; 5066} 5067 | 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 --- 5051 unchanged lines hidden (view full) --- 5060 *nb_sectors_ptr = nb_sectors < 0 ? 0 : nb_sectors; 5061} 5062 5063bool bdrv_is_sg(BlockDriverState *bs) 5064{ 5065 return bs->sg; 5066} 5067 |
5068/** 5069 * Return whether the given node supports compressed writes. 5070 */ 5071bool bdrv_supports_compressed_writes(BlockDriverState *bs) 5072{ 5073 BlockDriverState *filtered; 5074 5075 if (!bs->drv || !block_driver_can_compress(bs->drv)) { 5076 return false; 5077 } 5078 5079 filtered = bdrv_filter_bs(bs); 5080 if (filtered) { 5081 /* 5082 * Filters can only forward compressed writes, so we have to 5083 * check the child. 5084 */ 5085 return bdrv_supports_compressed_writes(filtered); 5086 } 5087 5088 return true; 5089} 5090 |
|
5068const char *bdrv_get_format_name(BlockDriverState *bs) 5069{ 5070 return bs->drv ? bs->drv->format_name : NULL; 5071} 5072 5073static int qsort_strcmp(const void *a, const void *b) 5074{ 5075 return strcmp(*(char *const *)a, *(char *const *)b); --- 2033 unchanged lines hidden --- | 5091const char *bdrv_get_format_name(BlockDriverState *bs) 5092{ 5093 return bs->drv ? bs->drv->format_name : NULL; 5094} 5095 5096static int qsort_strcmp(const void *a, const void *b) 5097{ 5098 return strcmp(*(char *const *)a, *(char *const *)b); --- 2033 unchanged lines hidden --- |