io.c (1270a3f57c9221080f3205a15964814ff8359ca9) io.c (160a29e2f8b2d100246ab446813409f72d1e0767)
1/*
2 * Block layer I/O functions
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

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

177 return;
178 }
179
180 /* Default alignment based on whether driver has byte interface */
181 bs->bl.request_alignment = (drv->bdrv_co_preadv ||
182 drv->bdrv_aio_preadv ||
183 drv->bdrv_co_preadv_part) ? 1 : 512;
184
1/*
2 * Block layer I/O functions
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

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

177 return;
178 }
179
180 /* Default alignment based on whether driver has byte interface */
181 bs->bl.request_alignment = (drv->bdrv_co_preadv ||
182 drv->bdrv_aio_preadv ||
183 drv->bdrv_co_preadv_part) ? 1 : 512;
184
185 bs->bl.has_variable_length = drv->has_variable_length;
186
185 /* Take some limits from the children as a default */
186 have_limits = false;
187 QLIST_FOREACH(c, &bs->children, next) {
188 if (c->role & (BDRV_CHILD_DATA | BDRV_CHILD_FILTERED | BDRV_CHILD_COW))
189 {
190 bdrv_merge_limits(&bs->bl, &c->bs->bl);
191 have_limits = true;
192 }
187 /* Take some limits from the children as a default */
188 have_limits = false;
189 QLIST_FOREACH(c, &bs->children, next) {
190 if (c->role & (BDRV_CHILD_DATA | BDRV_CHILD_FILTERED | BDRV_CHILD_COW))
191 {
192 bdrv_merge_limits(&bs->bl, &c->bs->bl);
193 have_limits = true;
194 }
195
196 if (c->role & BDRV_CHILD_FILTERED) {
197 bs->bl.has_variable_length |= c->bs->bl.has_variable_length;
198 }
193 }
194
195 if (!have_limits) {
196 bs->bl.min_mem_alignment = 512;
197 bs->bl.opt_mem_alignment = qemu_real_host_page_size();
198
199 /* Safe default since most protocols use readv()/writev()/etc */
200 bs->bl.max_iov = IOV_MAX;

--- 3408 unchanged lines hidden ---
199 }
200
201 if (!have_limits) {
202 bs->bl.min_mem_alignment = 512;
203 bs->bl.opt_mem_alignment = qemu_real_host_page_size();
204
205 /* Safe default since most protocols use readv()/writev()/etc */
206 bs->bl.max_iov = IOV_MAX;

--- 3408 unchanged lines hidden ---