Am 27.02.2015 um 18:28 schrieb Max Reitz: > On 2015-02-27 at 12:25, Stefan Weil wrote: >> block/vdi.c was never written for multi-threaded access, see my comment >> in the header of block/vdi.c: >> >> * The code is not thread safe (missing locks for changes in header and >> * block table, no problem with current QEMU). >> >> This was true in the past, but obviously later multi-threaded access was >> introduced for QEMU. Locking was added for qcow2 and other drivers in >> 2012 and 2013, but never for vdi. >> >> I must admit that I don't know which parts of the block filesystem >> drivers potentially run in parallel threads.Ideally there would be one >> or more test cases which test multi-threaded operations and which >> trigger a failure with the current vdi code. >> >> If I had a simple test scenario, I could have a look on the problem. > > I have one for you. See the attached ruby script. > > (If there are no "Pattern verification failed" messages, everything is > good) > >> The VMDK approach is fine as an intermediate work around, but please use >> conditional compilation to allow easy tests without coarse locks (and >> update the comments :-)). > > Will a macro defined in vdi.c be enough?
Yes, that would be fine. vdi.c already has several locally defined CONFIG_VDI_... macros. Stefan