* [Qemu-devel] iSCSI support for QEMU, update
@ 2011-04-21 20:23 ronniesahlberg
2011-04-22 4:08 ` Christoph Hellwig
0 siblings, 1 reply; 7+ messages in thread
From: ronniesahlberg @ 2011-04-21 20:23 UTC (permalink / raw)
To: qemu-devel; +Cc: kwolf, stefanha, hch
iSCSI block driver for QEMU
Please find an updated iSCSI patch.
This patch adds setting FUA on all writes when the bit
BDRV_O_CACHE_WB is not set.
regards
ronnie sahlberg
From: Ronnie Sahlberg <ronniesahlberg@gmail.com>
Subject: iSCSI support for QEMU, update
In-Reply-To:
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [Qemu-devel] iSCSI support for QEMU, update
2011-04-21 20:23 [Qemu-devel] iSCSI support for QEMU, update ronniesahlberg
@ 2011-04-22 4:08 ` Christoph Hellwig
2011-04-22 6:08 ` ronnie sahlberg
0 siblings, 1 reply; 7+ messages in thread
From: Christoph Hellwig @ 2011-04-22 4:08 UTC (permalink / raw)
To: ronniesahlberg; +Cc: kwolf, hch, qemu-devel, stefanha
On Fri, Apr 22, 2011 at 06:23:58AM +1000, ronniesahlberg@gmail.com wrote:
> iSCSI block driver for QEMU
>
> Please find an updated iSCSI patch.
> This patch adds setting FUA on all writes when the bit
> BDRV_O_CACHE_WB is not set.
At this point you need to check for BDRV_O_CACHE_WB and BDRV_O_NOCACHE
as they both have writeback cache semantics. I submitted a patch to clean
that up, but it didn't get merged yet.
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [Qemu-devel] iSCSI support for QEMU, update
2011-04-22 4:08 ` Christoph Hellwig
@ 2011-04-22 6:08 ` ronnie sahlberg
2011-04-22 6:13 ` Christoph Hellwig
0 siblings, 1 reply; 7+ messages in thread
From: ronnie sahlberg @ 2011-04-22 6:08 UTC (permalink / raw)
To: Christoph Hellwig; +Cc: kwolf, qemu-devel, stefanha
Thanks,
On Fri, Apr 22, 2011 at 2:08 PM, Christoph Hellwig <hch@lst.de> wrote:
> On Fri, Apr 22, 2011 at 06:23:58AM +1000, ronniesahlberg@gmail.com wrote:
>> iSCSI block driver for QEMU
>>
>> Please find an updated iSCSI patch.
>> This patch adds setting FUA on all writes when the bit
>> BDRV_O_CACHE_WB is not set.
>
> At this point you need to check for BDRV_O_CACHE_WB and BDRV_O_NOCACHE
> as they both have writeback cache semantics. I submitted a patch to clean
> that up, but it didn't get merged yet.
>
So I should set FUA when
BDRV_O_CACHE_WB==0 or BDRV_O_NOCACHE==1
right?
regards
ronnie sahlberg
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [Qemu-devel] iSCSI support for QEMU, update
2011-04-22 6:08 ` ronnie sahlberg
@ 2011-04-22 6:13 ` Christoph Hellwig
2011-04-22 6:35 ` ronnie sahlberg
0 siblings, 1 reply; 7+ messages in thread
From: Christoph Hellwig @ 2011-04-22 6:13 UTC (permalink / raw)
To: ronnie sahlberg; +Cc: kwolf, Christoph Hellwig, stefanha, qemu-devel
On Fri, Apr 22, 2011 at 04:08:57PM +1000, ronnie sahlberg wrote:
> So I should set FUA when
> BDRV_O_CACHE_WB==0 or BDRV_O_NOCACHE==1
> right?
At this point you need to set it if either the BDRV_O_CACHE_WB and
BDRV_O_NOCACHE flags are set. And yes, the naming of the nocache
flag is rather confusing.
Take a look at block.c:bdrv_open_common():
/*
* Yes, BDRV_O_NOCACHE aka O_DIRECT means we have to present a
* write cache to the guest. We do need the fdatasync to flush
* out transactions for block allocations, and we maybe have a
* volatile write cache in our backing device to deal with.
*/
if (flags & (BDRV_O_CACHE_WB|BDRV_O_NOCACHE))
bs->enable_write_cache = 1;
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [Qemu-devel] iSCSI support for QEMU, update
2011-04-22 6:13 ` Christoph Hellwig
@ 2011-04-22 6:35 ` ronnie sahlberg
2011-04-22 6:38 ` Christoph Hellwig
0 siblings, 1 reply; 7+ messages in thread
From: ronnie sahlberg @ 2011-04-22 6:35 UTC (permalink / raw)
To: Christoph Hellwig; +Cc: kwolf, qemu-devel, stefanha
Ok, I am confused
On Fri, Apr 22, 2011 at 4:13 PM, Christoph Hellwig <hch@lst.de> wrote:
> On Fri, Apr 22, 2011 at 04:08:57PM +1000, ronnie sahlberg wrote:
>> So I should set FUA when
>> BDRV_O_CACHE_WB==0 or BDRV_O_NOCACHE==1
>> right?
>
> At this point you need to set it if either the BDRV_O_CACHE_WB and
> BDRV_O_NOCACHE flags are set. And yes, the naming of the nocache
> flag is rather confusing.
>
> Take a look at block.c:bdrv_open_common():
>
> /*
> * Yes, BDRV_O_NOCACHE aka O_DIRECT means we have to present a
> * write cache to the guest. We do need the fdatasync to flush
> * out transactions for block allocations, and we maybe have a
> * volatile write cache in our backing device to deal with.
> */
> if (flags & (BDRV_O_CACHE_WB|BDRV_O_NOCACHE))
> bs->enable_write_cache = 1;
>
I have to set FUA if the WB(I guessed this meant write-back) flag is set?
Not the opposite (I assume opposite of write-back is write-through) ?
So that would mean
if (flags & (BDRV_O_CACHE_WB|BDRV_O_NOCACHE))
caching is NOT ok, write with FUA=1
else
caching is ok, write with FUA=0
right ?
regards
ronnie sahlberg
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [Qemu-devel] iSCSI support for QEMU, update
2011-04-22 6:35 ` ronnie sahlberg
@ 2011-04-22 6:38 ` Christoph Hellwig
0 siblings, 0 replies; 7+ messages in thread
From: Christoph Hellwig @ 2011-04-22 6:38 UTC (permalink / raw)
To: ronnie sahlberg; +Cc: kwolf, Christoph Hellwig, stefanha, qemu-devel
On Fri, Apr 22, 2011 at 04:35:11PM +1000, ronnie sahlberg wrote:
> Ok, I am confused
And this time it's my fault, sorry.
> I have to set FUA if the WB(I guessed this meant write-back) flag is set?
> Not the opposite (I assume opposite of write-back is write-through) ?
Sorry, I meant exactly the opposite. You do not have to set FUA if either
of those two flags is present, so:
if (flags & (BDRV_O_CACHE_WB|BDRV_O_NOCACHE))
caching is ok, write with FUA=0
else
caching is NOT ok, write with FUA=1
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Qemu-devel] iSCSI support for QEMU, update
@ 2011-05-07 6:17 Ronnie Sahlberg
0 siblings, 0 replies; 7+ messages in thread
From: Ronnie Sahlberg @ 2011-05-07 6:17 UTC (permalink / raw)
To: qemu-devel; +Cc: kwolf, stefanha, hch
This is a patch that adds support for iSCSI to QEMU when QEMU is built against libiscsi (https://github.com/sahlberg/libiscsi)
ISCSI devices are specified using a special iSCSI URL:
-drive file=iscsi://10.1.1.1:3260/iqn.ronnie.test/1
This allows a guest to access iscsi devices without exposing these devices to the host. Which is nice if/when you have a very large number of LUNs that are dedicated for virtual guests.
This patch is updated to set FUA for all writes, unless any of the NOCACHE or CACHE_WB flags are set for the device.
Please review and/or apply.
regards
ronnie sahlberg
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2011-05-07 6:17 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-04-21 20:23 [Qemu-devel] iSCSI support for QEMU, update ronniesahlberg
2011-04-22 4:08 ` Christoph Hellwig
2011-04-22 6:08 ` ronnie sahlberg
2011-04-22 6:13 ` Christoph Hellwig
2011-04-22 6:35 ` ronnie sahlberg
2011-04-22 6:38 ` Christoph Hellwig
2011-05-07 6:17 Ronnie Sahlberg
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.