Re: [Qemu-block] [PATCH for-2.11 5/5] qcow2: Refuse to get unaligned offsets from cache

2017-11-14 Thread Alberto Garcia
On Tue 14 Nov 2017 04:09:16 PM CET, Max Reitz wrote: >>> +static inline const char *qcow2_cache_get_name(BDRVQcow2State *s, >>> Qcow2Cache *c) >>> +{ >>> +if (c == s->refcount_block_cache) { >>> +return "refcount block"; >>> +} else if (c == s->l2_table_cache) { >>> +return

Re: [Qemu-block] [PATCH for-2.11 5/5] qcow2: Refuse to get unaligned offsets from cache

2017-11-14 Thread Max Reitz
On 2017-11-14 16:06, Alberto Garcia wrote: > On Fri 10 Nov 2017 09:31:11 PM CET, Max Reitz wrote: >> +static inline const char *qcow2_cache_get_name(BDRVQcow2State *s, >> Qcow2Cache *c) >> +{ >> +if (c == s->refcount_block_cache) { >> +return "refcount block"; >> +} else if (c == s

Re: [Qemu-block] [PATCH for-2.11 5/5] qcow2: Refuse to get unaligned offsets from cache

2017-11-14 Thread Alberto Garcia
On Fri 10 Nov 2017 09:31:11 PM CET, Max Reitz wrote: > +static inline const char *qcow2_cache_get_name(BDRVQcow2State *s, Qcow2Cache > *c) > +{ > +if (c == s->refcount_block_cache) { > +return "refcount block"; > +} else if (c == s->l2_table_cache) { > +return "L2 table"; >

[Qemu-block] [PATCH for-2.11 5/5] qcow2: Refuse to get unaligned offsets from cache

2017-11-10 Thread Max Reitz
Instead of using an assertion, it is better to emit a corruption event here. Checking all offsets for correct alignment can be tedious and it is easily possible to forget to do so. qcow2_cache_do_get() is a function every L2 and refblock access has to go through, so this is a good central point t