block.c (ca32646d41403adaf179506bca0e0d9418e90aa7) | block.c (038adc2f5850e32019bda06c559d0301be436eae) |
---|---|
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 --- 92 unchanged lines hidden (view full) --- 101 return 0; 102} 103#endif 104 105size_t bdrv_opt_mem_align(BlockDriverState *bs) 106{ 107 if (!bs || !bs->drv) { 108 /* page size or 4k (hdd sector size) should be on the safe side */ | 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 --- 92 unchanged lines hidden (view full) --- 101 return 0; 102} 103#endif 104 105size_t bdrv_opt_mem_align(BlockDriverState *bs) 106{ 107 if (!bs || !bs->drv) { 108 /* page size or 4k (hdd sector size) should be on the safe side */ |
109 return MAX(4096, getpagesize()); | 109 return MAX(4096, qemu_real_host_page_size); |
110 } 111 112 return bs->bl.opt_mem_alignment; 113} 114 115size_t bdrv_min_mem_align(BlockDriverState *bs) 116{ 117 if (!bs || !bs->drv) { 118 /* page size or 4k (hdd sector size) should be on the safe side */ | 110 } 111 112 return bs->bl.opt_mem_alignment; 113} 114 115size_t bdrv_min_mem_align(BlockDriverState *bs) 116{ 117 if (!bs || !bs->drv) { 118 /* page size or 4k (hdd sector size) should be on the safe side */ |
119 return MAX(4096, getpagesize()); | 119 return MAX(4096, qemu_real_host_page_size); |
120 } 121 122 return bs->bl.min_mem_alignment; 123} 124 125/* check if the path starts with "<protocol>:" */ 126int path_has_protocol(const char *path) 127{ --- 6442 unchanged lines hidden --- | 120 } 121 122 return bs->bl.min_mem_alignment; 123} 124 125/* check if the path starts with "<protocol>:" */ 126int path_has_protocol(const char *path) 127{ --- 6442 unchanged lines hidden --- |