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

--- 3888 unchanged lines hidden ---
121 }
122
123 return bs->bl.min_mem_alignment;
124}
125
126/* check if the path starts with "<protocol>:" */
127int path_has_protocol(const char *path)
128{

--- 3888 unchanged lines hidden ---