[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-block] [Qemu-devel] [PATCH v2] block/vdi: Add locking for para

From: Stefan Weil
Subject: Re: [Qemu-block] [Qemu-devel] [PATCH v2] block/vdi: Add locking for parallel requests
Date: Fri, 27 Feb 2015 18:34:58 +0100
User-agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.5.0

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.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]