From: Kevin Wolf <kwolf@redhat.com>
To: Stefan Hajnoczi <stefanha@gmail.com>
Cc: nick@lupine.me.uk, qemu-devel@nongnu.org,
Laurent Vivier <Laurent@vivier.eu>
Subject: Re: [Qemu-devel] NBD block device backend - 'improvements'
Date: Tue, 15 Feb 2011 12:09:01 +0100 [thread overview]
Message-ID: <4D5A5ECD.7060701@redhat.com> (raw)
In-Reply-To: <AANLkTinWW5bJ8uTbEPcq_yc7Dqg0cSNRcfN-F6xuRueO@mail.gmail.com>
Am 14.02.2011 21:32, schrieb Stefan Hajnoczi:
> On Mon, Feb 14, 2011 at 7:40 PM, Nicholas Thomas <nick@lupine.me.uk> wrote:
>> I've written a patch that changes the behaviour - instead of exiting at
>> startup, we wait for the NBD connection to be established, and we hang
>> on reads and writes until the connection is re-established.
>
> Hi Nick,
> I think reconnect is a useful feature. For more info on submitting
> patches to QEMU, please see
> http://wiki.qemu.org/Contribute/SubmitAPatch. It contains a few
> points like sending patches inline instead of as an attachment (makes
> review easier), using Signed-off-by:, and references to QEMU coding
> style.
>
>> I'm interested in getting the changes merged upstream, so I thought I'd
>> get in early and ask if you'd be interested in the patch, in principle;
>> whether the old behaviour would need to be preserved, making the new
>> behaviour accessible via a config option ("-drive
>> file=nbd:127.0.0.1:5000:retry=forever,..." ?); and whether I'm going
>> about the changes in a sane way (I've attached the current version of
>> the patch).
>
> block/nbd.c needs to be made asynchronous in order for this change to
> work.
And even then it's not free of problem: For example qemu_aio_flush()
will hang. We're having all kinds of fun with NFS servers that go away
and let requests hang indefinitely.
So maybe what we should add is a timeout option which defaults to 0
(fail immediately, like today)
> Otherwise the only thing you can do is to block QEMU and the
> VM, and even that shouldn't be done using sleep(2) because that could
> stop the I/O thread which processes the QEMU monitor and other
> external interfaces. See below for more info.
Unconditionally stopping the VM from a block driver sounds wrong to me.
If you want to have this behaviour, the block driver should return an
error and you should use werror=stop.
>> Another thing I've noticed is that the nbd library ( /nbd.c ) is not
>> IPv6-compatible ( "-drive file=nbd:\:\:1:5000", for instance ) - I don't
>> have a patch for that yet, but I'm going to need to write one :) -
>> presumably you'd like that merging upstream too (and I should make the
>> library use the functions provided in qemu_socket.h) ?
>
> IPv6 would be nice and if you can consolidate that in qemu_socket.h,
> then that's a win for non-nbd socket users too.
Agreed.
Kevin
next prev parent reply other threads:[~2011-02-15 11:07 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-02-14 19:40 [Qemu-devel] NBD block device backend - 'improvements' Nicholas Thomas
2011-02-14 20:32 ` Stefan Hajnoczi
2011-02-15 11:09 ` Kevin Wolf [this message]
2011-02-15 21:26 ` Nicholas Thomas
2011-02-16 12:00 ` Kevin Wolf
2011-02-17 16:27 ` [Qemu-devel] " Nicholas Thomas
2011-02-17 16:34 ` [Qemu-devel] [PATCH 1/3] NBD library: whitespace changes Nicholas Thomas
2011-02-17 16:34 ` [Qemu-devel] [PATCH 2/3] NBD library: add aio-compatible read/write function Nicholas Thomas
2011-02-17 16:34 ` [Qemu-devel] [PATCH 3/3] block/nbd: Make the NBD block device use the AIO interface Nicholas Thomas
2011-02-17 19:28 ` Nicholas Thomas
2011-02-18 12:16 ` [Qemu-devel] [PATCH 3/3 v2] " Nicholas Thomas
2011-02-18 12:23 ` Kevin Wolf
2011-02-18 12:55 ` Nicholas Thomas
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4D5A5ECD.7060701@redhat.com \
--to=kwolf@redhat.com \
--cc=Laurent@vivier.eu \
--cc=nick@lupine.me.uk \
--cc=qemu-devel@nongnu.org \
--cc=stefanha@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.