* [PATCH fio] nbd: Update for libnbd 0.9.8.
@ 2019-08-15 15:30 Richard W.M. Jones
2019-08-15 15:32 ` Richard W.M. Jones
2019-08-15 16:42 ` Jens Axboe
0 siblings, 2 replies; 5+ messages in thread
From: Richard W.M. Jones @ 2019-08-15 15:30 UTC (permalink / raw)
To: fio; +Cc: eblake, axboe
As the libnbd API isn't permanently stable until we reach the 1.0
release (expected soon), some code changes are needed to cope with API
changes between 0.9.6 and 0.9.8. In this case we made changes to
completion handlers after feedback from reviewers. This fix for fio
incorporates all the changes needed and bumps the minimum version to
libnbd >= 0.9.8.
Signed-off-by: Richard W.M. Jones <rjones@redhat.com>
---
configure | 2 +-
engines/nbd.c | 33 ++++++++++++---------------------
2 files changed, 13 insertions(+), 22 deletions(-)
diff --git a/configure b/configure
index b11b2dce..b174a6fc 100755
--- a/configure
+++ b/configure
@@ -2020,7 +2020,7 @@ print_config "iscsi engine" "$libiscsi"
##########################################
# Check if we have libnbd (for NBD support).
-minimum_libnbd=0.9.6
+minimum_libnbd=0.9.8
if test "$libnbd" = "yes" ; then
if $(pkg-config --atleast-version=$minimum_libnbd libnbd); then
libnbd="yes"
diff --git a/engines/nbd.c b/engines/nbd.c
index f8583812..53237929 100644
--- a/engines/nbd.c
+++ b/engines/nbd.c
@@ -152,15 +152,12 @@ static int nbd_init(struct thread_data *td)
}
/* A command in flight has been completed. */
-static int cmd_completed (unsigned valid_flag, void *vp, int *error)
+static int cmd_completed (void *vp, int *error)
{
struct io_u *io_u;
struct nbd_data *nbd_data;
struct io_u **completed;
- if (!(valid_flag & LIBNBD_CALLBACK_VALID))
- return 0;
-
io_u = vp;
nbd_data = io_u->engine_data;
@@ -195,6 +192,8 @@ static enum fio_q_status nbd_queue(struct thread_data *td,
struct io_u *io_u)
{
struct nbd_data *nbd_data = td->io_ops_data;
+ nbd_completion_callback completion = { .callback = cmd_completed,
+ .user_data = io_u };
int r;
fio_ro_check(td, io_u);
@@ -206,32 +205,24 @@ static enum fio_q_status nbd_queue(struct thread_data *td,
switch (io_u->ddir) {
case DDIR_READ:
- r = nbd_aio_pread_callback(nbd_data->nbd,
- io_u->xfer_buf, io_u->xfer_buflen,
- io_u->offset,
- cmd_completed, io_u,
- 0);
+ r = nbd_aio_pread(nbd_data->nbd,
+ io_u->xfer_buf, io_u->xfer_buflen,
+ io_u->offset, completion, 0);
break;
case DDIR_WRITE:
- r = nbd_aio_pwrite_callback(nbd_data->nbd,
- io_u->xfer_buf, io_u->xfer_buflen,
- io_u->offset,
- cmd_completed, io_u,
- 0);
+ r = nbd_aio_pwrite(nbd_data->nbd,
+ io_u->xfer_buf, io_u->xfer_buflen,
+ io_u->offset, completion, 0);
break;
case DDIR_TRIM:
- r = nbd_aio_trim_callback(nbd_data->nbd, io_u->xfer_buflen,
- io_u->offset,
- cmd_completed, io_u,
- 0);
+ r = nbd_aio_trim(nbd_data->nbd, io_u->xfer_buflen,
+ io_u->offset, completion, 0);
break;
case DDIR_SYNC:
/* XXX We could probably also handle
* DDIR_SYNC_FILE_RANGE with a bit of effort.
*/
- r = nbd_aio_flush_callback(nbd_data->nbd,
- cmd_completed, io_u,
- 0);
+ r = nbd_aio_flush(nbd_data->nbd, completion, 0);
break;
default:
io_u->error = EINVAL;
--
2.22.0
^ permalink raw reply related [flat|nested] 5+ messages in thread* Re: [PATCH fio] nbd: Update for libnbd 0.9.8.
2019-08-15 15:30 [PATCH fio] nbd: Update for libnbd 0.9.8 Richard W.M. Jones
@ 2019-08-15 15:32 ` Richard W.M. Jones
2019-08-15 16:42 ` Jens Axboe
1 sibling, 0 replies; 5+ messages in thread
From: Richard W.M. Jones @ 2019-08-15 15:32 UTC (permalink / raw)
To: fio; +Cc: eblake, axboe
Sorry, I realized I reflexively used a period at the end
of the first line of the commit message :-(
Rich.
--
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
Read my programming and virtualization blog: http://rwmj.wordpress.com
virt-df lists disk usage of guests without needing to install any
software inside the virtual machine. Supports Linux and Windows.
http://people.redhat.com/~rjones/virt-df/
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH fio] nbd: Update for libnbd 0.9.8.
2019-08-15 15:30 [PATCH fio] nbd: Update for libnbd 0.9.8 Richard W.M. Jones
2019-08-15 15:32 ` Richard W.M. Jones
@ 2019-08-15 16:42 ` Jens Axboe
2019-08-15 16:57 ` Richard W.M. Jones
1 sibling, 1 reply; 5+ messages in thread
From: Jens Axboe @ 2019-08-15 16:42 UTC (permalink / raw)
To: Richard W.M. Jones, fio; +Cc: eblake
On 8/15/19 9:30 AM, Richard W.M. Jones wrote:
> As the libnbd API isn't permanently stable until we reach the 1.0
> release (expected soon), some code changes are needed to cope with API
> changes between 0.9.6 and 0.9.8. In this case we made changes to
> completion handlers after feedback from reviewers. This fix for fio
> incorporates all the changes needed and bumps the minimum version to
> libnbd >= 0.9.8.
Applied, thanks.
--
Jens Axboe
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH fio] nbd: Update for libnbd 0.9.8.
2019-08-15 16:42 ` Jens Axboe
@ 2019-08-15 16:57 ` Richard W.M. Jones
2019-08-15 17:02 ` Jens Axboe
0 siblings, 1 reply; 5+ messages in thread
From: Richard W.M. Jones @ 2019-08-15 16:57 UTC (permalink / raw)
To: Jens Axboe; +Cc: fio, eblake
On Thu, Aug 15, 2019 at 10:42:17AM -0600, Jens Axboe wrote:
> On 8/15/19 9:30 AM, Richard W.M. Jones wrote:
> > As the libnbd API isn't permanently stable until we reach the 1.0
> > release (expected soon), some code changes are needed to cope with API
> > changes between 0.9.6 and 0.9.8. In this case we made changes to
> > completion handlers after feedback from reviewers. This fix for fio
> > incorporates all the changes needed and bumps the minimum version to
> > libnbd >= 0.9.8.
>
> Applied, thanks.
Thanks - we're really hoping this will be the last time (forever)
that the API changes. Fingers crossed ...
Rich.
--
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
Read my programming and virtualization blog: http://rwmj.wordpress.com
libguestfs lets you edit virtual machines. Supports shell scripting,
bindings from many languages. http://libguestfs.org
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH fio] nbd: Update for libnbd 0.9.8.
2019-08-15 16:57 ` Richard W.M. Jones
@ 2019-08-15 17:02 ` Jens Axboe
0 siblings, 0 replies; 5+ messages in thread
From: Jens Axboe @ 2019-08-15 17:02 UTC (permalink / raw)
To: Richard W.M. Jones; +Cc: fio, eblake
On 8/15/19 10:57 AM, Richard W.M. Jones wrote:
> On Thu, Aug 15, 2019 at 10:42:17AM -0600, Jens Axboe wrote:
>> On 8/15/19 9:30 AM, Richard W.M. Jones wrote:
>>> As the libnbd API isn't permanently stable until we reach the 1.0
>>> release (expected soon), some code changes are needed to cope with API
>>> changes between 0.9.6 and 0.9.8. In this case we made changes to
>>> completion handlers after feedback from reviewers. This fix for fio
>>> incorporates all the changes needed and bumps the minimum version to
>>> libnbd >= 0.9.8.
>>
>> Applied, thanks.
>
> Thanks - we're really hoping this will be the last time (forever)
> that the API changes. Fingers crossed ...
If the versioning proximity to 1.0 is worth anything, hopefully it'll
be pretty close to (if not at) stability :-)
--
Jens Axboe
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2019-08-15 17:02 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-08-15 15:30 [PATCH fio] nbd: Update for libnbd 0.9.8 Richard W.M. Jones
2019-08-15 15:32 ` Richard W.M. Jones
2019-08-15 16:42 ` Jens Axboe
2019-08-15 16:57 ` Richard W.M. Jones
2019-08-15 17:02 ` Jens Axboe
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox