Skip to contentSkip to conversation

block: nbd: Fix dirty bitmap context name

PATCH In review Nir Soffer 5 participants 15 messages Dec 19, 2019 – Dec 25, 2019

lore
Share & tools
lore

Nir Soffer

author
#0 lore raw

PATCH 1/1 block: nbd: Fix dirty bitmap context name

When adding an export with a dirty bitmap, expose the bitmap at:

qemu:dirty-bitmap:export-name

This matches qapi documentation, and user expectations.

Without this, qemu leaks libvirt implementations details to clients by exposing the bitmap using the actual bitmap name:

qemu:dirty-bitmap:bitmap-name

And all clients need to duplicate code like:

meta_context = "qemu:dirty-bitmap:backup-" + export_name

NBD allows exposing multiple bitmaps under "qemu:dirty-bitmap:" namespace, and clients can query the available bitmaps, but it is not clear what a client should do if a server provides multiple bitmaps.

---
 nbd/server.c               |  2 +-
 tests/qemu-iotests/223     | 16 ++++++++--------
 tests/qemu-iotests/223.out |  8 ++++----
 3 files changed, 13 insertions(+), 13 deletions(-)
nbd/server.c +1 -1
index 24ebc1a805..f20f2994c0 100644
@@ -1574,7 +1574,7 @@ NBDExport *nbd_export_new(BlockDriverState *bs, uint64_t dev_offset,
         exp->export_bitmap = bm;
         assert(strlen(bitmap) <= BDRV_BITMAP_MAX_NAME_SIZE);
         exp->export_bitmap_context = g_strdup_printf("qemu:dirty-bitmap:%s",
-                                                     bitmap);
+                                                     name);
         assert(strlen(exp->export_bitmap_context) < NBD_MAX_STRING_SIZE);
     }
 
tests/qemu-iotests/223 +8 -8
index ea69cd4b8b..3068a7c280 100755
@@ -167,7 +167,7 @@ $QEMU_IO -r -c 'r -P 0x22 512 512' -c 'r -P 0 512k 512k' -c 'r -P 0x11 1m 1m' \
 $QEMU_IMG map --output=json --image-opts \
   "$IMG" | _filter_qemu_img_map
 $QEMU_IMG map --output=json --image-opts \
-  "$IMG,x-dirty-bitmap=qemu:dirty-bitmap:b" | _filter_qemu_img_map
+  "$IMG,x-dirty-bitmap=qemu:dirty-bitmap:n" | _filter_qemu_img_map
 
 echo
 echo "=== Contrast to small granularity dirty-bitmap ==="
@@ -175,7 +175,7 @@ echo
 
 IMG="driver=nbd,export=n2,server.type=unix,server.path=$SOCK_DIR/nbd"
 $QEMU_IMG map --output=json --image-opts \
-  "$IMG,x-dirty-bitmap=qemu:dirty-bitmap:b2" | _filter_qemu_img_map
+  "$IMG,x-dirty-bitmap=qemu:dirty-bitmap:n2" | _filter_qemu_img_map
 
 echo
 echo "=== End qemu NBD server ==="
@@ -199,15 +199,15 @@ echo
 echo "=== Use qemu-nbd as server ==="
 echo
 
-nbd_server_start_unix_socket -r -f $IMGFMT -B b "$TEST_IMG"
-IMG="driver=nbd,server.type=unix,server.path=$nbd_unix_socket"
+nbd_server_start_unix_socket -r -f $IMGFMT -x n -B b "$TEST_IMG"
+IMG="driver=nbd,export=n,server.type=unix,server.path=$nbd_unix_socket"
 $QEMU_IMG map --output=json --image-opts \
-  "$IMG,x-dirty-bitmap=qemu:dirty-bitmap:b" | _filter_qemu_img_map
+  "$IMG,x-dirty-bitmap=qemu:dirty-bitmap:n" | _filter_qemu_img_map
 
-nbd_server_start_unix_socket -f $IMGFMT -B b2 "$TEST_IMG"
-IMG="driver=nbd,server.type=unix,server.path=$nbd_unix_socket"
+nbd_server_start_unix_socket -f $IMGFMT -x n -B b2 "$TEST_IMG"
+IMG="driver=nbd,export=n,server.type=unix,server.path=$nbd_unix_socket"
 $QEMU_IMG map --output=json --image-opts \
-  "$IMG,x-dirty-bitmap=qemu:dirty-bitmap:b2" | _filter_qemu_img_map
+  "$IMG,x-dirty-bitmap=qemu:dirty-bitmap:n" | _filter_qemu_img_map
 
 # success, all done
 echo '*** done'
tests/qemu-iotests/223.out +4 -4
index f175598802..9f879add60 100644
@@ -61,7 +61,7 @@ exports available: 2
   max block: 33554432
   available meta contexts: 2
    base:allocation
-   qemu:dirty-bitmap:b
+   qemu:dirty-bitmap:n
  export: 'n2'
   size:  4194304
   flags: 0xced ( flush fua trim zeroes df cache fast-zero )
@@ -70,7 +70,7 @@ exports available: 2
   max block: 33554432
   available meta contexts: 2
    base:allocation
-   qemu:dirty-bitmap:b2
+   qemu:dirty-bitmap:n2
 
 === Contrast normal status to large granularity dirty-bitmap ===
 
@@ -141,7 +141,7 @@ exports available: 2
   max block: 33554432
   available meta contexts: 2
    base:allocation
-   qemu:dirty-bitmap:b
+   qemu:dirty-bitmap:n
  export: 'n2'
   size:  4194304
   flags: 0xced ( flush fua trim zeroes df cache fast-zero )
@@ -150,7 +150,7 @@ exports available: 2
   max block: 33554432
   available meta contexts: 2
    base:allocation
-   qemu:dirty-bitmap:b2
+   qemu:dirty-bitmap:n2
 
 === Contrast normal status to large granularity dirty-bitmap ===
 
Signature · 1 line
2.21.0
#1 lore raw

I'd not call it a "fix".. As it implies something broken.

[edit: OK, now I see that something is broken, and why you called it "fix",
see below]

Quoted 3 lines · Nir Soffer

When adding an export with a dirty bitmap, expose the bitmap at:

qemu:dirty-bitmap:export-name

export-name? But it would be extra information, as client already knows with which export it works.

NBD commands NBD_OPT_GET/SET_META_CONTEXT includes export name as a parameter, so, any queried metadata (bitmaps, etc) is always bound to specified export.

Quoted 2 lines

This matches qapi documentation, and user expectations.

Hmmm,
"qemu" namespace is documented in docs/interop/nbd.txt, not in Qapi, which is also mention in official NBD spec.

Ahh, I see, it's documented as

+# @bitmap: Also export the dirty bitmap reachable from @device, so the
+# NBD client can use NBD_OPT_SET_META_CONTEXT with
+# "qemu:dirty-bitmap:NAME" to inspect the bitmap. (since 4.0)

and it is logical to assume that export name (which is @name argument) is mentioned. But we never mentioned it. This is just documented after removed experimenatl command x-nbd-server-add-bitmap,

look at

commit 7dc570b3806e5b0a4c9219061556ed5a4a0de80c

Author: Eric Blake <[email protected]>
Date:   Fri Jan 11 13:47:18 2019 -0600

nbd: Remove x-nbd-server-add-bitmap

...

-# @bitmap-export-name: How the bitmap will be seen by nbd clients
-# (default @bitmap)
-#
-# Note: the client must use NBD_OPT_SET_META_CONTEXT with a query of -# "qemu:dirty-bitmap:NAME" (where NAME matches @bitmap-export-name) to access -# the exposed bitmap.

So, this "NAME" is saved and now looks incorrect. What should be fixed, is Qapi documentation.

Quoted 5 lines

Without this, qemu leaks libvirt implementations details to clients by exposing the bitmap using the actual bitmap name:

qemu:dirty-bitmap:bitmap-name

Yes, "qemu" namespace specification says:
qemu:dirty-bitmap:<dirty-bitmap-export-name>

so, <dirty-bitmap-export-name> may be exact bitmap name or may be something other.

We just don't have an interface to set such name. It was in removed x-nbd-server-add-bitmap

So, if you need this possibility now, the correct way is to add 'export-bitmap-name' optional parameter to nbd-server-add, like it was in x-nbd-server-add-bitmap

Quoted 19 lines

And all clients need to duplicate code like:

meta_context = "qemu:dirty-bitmap:backup-" + export_name

NBD allows exposing multiple bitmaps under "qemu:dirty-bitmap:" namespace, and clients can query the available bitmaps, but it is not clear what a client should do if a server provides multiple bitmaps.

---
  nbd/server.c               |  2 +-
  tests/qemu-iotests/223     | 16 ++++++++--------
  tests/qemu-iotests/223.out |  8 ++++----
  3 files changed, 13 insertions(+), 13 deletions(-)
nbd/server.c +0 -0
index 24ebc1a805..f20f2994c0 100644

nbd/server.c NBDExport *nbd_export_new(BlockDriverState *bs, uint64_t dev_offset, · line 1577

Quoted 5 lines
nbd/server.c +1 -1
@@ -1574,7 +1574,7 @@ NBDExport *nbd_export_new(BlockDriverState *bs, uint64_t dev_offset,
          exp->export_bitmap = bm;
          assert(strlen(bitmap) <= BDRV_BITMAP_MAX_NAME_SIZE);
          exp->export_bitmap_context = g_strdup_printf("qemu:dirty-bitmap:%s",
-                                                     bitmap);
+                                                     name);

I think it's a bad idea to automatically name bitmap after export. Actually export may have several bitmaps (we just don't support it). "NAME" in Qapi spec is a mistake.

Quoted 88 lines
nbd/server.c +0 -0
          assert(strlen(exp->export_bitmap_context) < NBD_MAX_STRING_SIZE);
      }
 
tests/qemu-iotests/223 +8 -8
index ea69cd4b8b..3068a7c280 100755
@@ -167,7 +167,7 @@ $QEMU_IO -r -c 'r -P 0x22 512 512' -c 'r -P 0 512k 512k' -c 'r -P 0x11 1m 1m' \
  $QEMU_IMG map --output=json --image-opts \
    "$IMG" | _filter_qemu_img_map
  $QEMU_IMG map --output=json --image-opts \
-  "$IMG,x-dirty-bitmap=qemu:dirty-bitmap:b" | _filter_qemu_img_map
+  "$IMG,x-dirty-bitmap=qemu:dirty-bitmap:n" | _filter_qemu_img_map
 
  echo
  echo "=== Contrast to small granularity dirty-bitmap ==="
@@ -175,7 +175,7 @@ echo
 
  IMG="driver=nbd,export=n2,server.type=unix,server.path=$SOCK_DIR/nbd"
  $QEMU_IMG map --output=json --image-opts \
-  "$IMG,x-dirty-bitmap=qemu:dirty-bitmap:b2" | _filter_qemu_img_map
+  "$IMG,x-dirty-bitmap=qemu:dirty-bitmap:n2" | _filter_qemu_img_map
 
  echo
  echo "=== End qemu NBD server ==="
@@ -199,15 +199,15 @@ echo
  echo "=== Use qemu-nbd as server ==="
  echo
 
-nbd_server_start_unix_socket -r -f $IMGFMT -B b "$TEST_IMG"
-IMG="driver=nbd,server.type=unix,server.path=$nbd_unix_socket"
+nbd_server_start_unix_socket -r -f $IMGFMT -x n -B b "$TEST_IMG"
+IMG="driver=nbd,export=n,server.type=unix,server.path=$nbd_unix_socket"
  $QEMU_IMG map --output=json --image-opts \
-  "$IMG,x-dirty-bitmap=qemu:dirty-bitmap:b" | _filter_qemu_img_map
+  "$IMG,x-dirty-bitmap=qemu:dirty-bitmap:n" | _filter_qemu_img_map
 
-nbd_server_start_unix_socket -f $IMGFMT -B b2 "$TEST_IMG"
-IMG="driver=nbd,server.type=unix,server.path=$nbd_unix_socket"
+nbd_server_start_unix_socket -f $IMGFMT -x n -B b2 "$TEST_IMG"
+IMG="driver=nbd,export=n,server.type=unix,server.path=$nbd_unix_socket"
  $QEMU_IMG map --output=json --image-opts \
-  "$IMG,x-dirty-bitmap=qemu:dirty-bitmap:b2" | _filter_qemu_img_map
+  "$IMG,x-dirty-bitmap=qemu:dirty-bitmap:n" | _filter_qemu_img_map
 
  # success, all done
  echo '*** done'
tests/qemu-iotests/223.out +4 -4
index f175598802..9f879add60 100644
@@ -61,7 +61,7 @@ exports available: 2
    max block: 33554432
    available meta contexts: 2
     base:allocation
-   qemu:dirty-bitmap:b
+   qemu:dirty-bitmap:n
   export: 'n2'
    size:  4194304
    flags: 0xced ( flush fua trim zeroes df cache fast-zero )
@@ -70,7 +70,7 @@ exports available: 2
    max block: 33554432
    available meta contexts: 2
     base:allocation
-   qemu:dirty-bitmap:b2
+   qemu:dirty-bitmap:n2
 
  === Contrast normal status to large granularity dirty-bitmap ===
 
@@ -141,7 +141,7 @@ exports available: 2
    max block: 33554432
    available meta contexts: 2
     base:allocation
-   qemu:dirty-bitmap:b
+   qemu:dirty-bitmap:n
   export: 'n2'
    size:  4194304
    flags: 0xced ( flush fua trim zeroes df cache fast-zero )
@@ -150,7 +150,7 @@ exports available: 2
    max block: 33554432
    available meta contexts: 2
     base:allocation
-   qemu:dirty-bitmap:b2
+   qemu:dirty-bitmap:n2
 
  === Contrast normal status to large granularity dirty-bitmap ===
 
Signature · 2 lines
Best regards,
Vladimir
#2 lore raw

Am 19.12.2019 um 14:41 hat Vladimir Sementsov-Ogievskiy geschrieben:

Quoted 28 lines

Ahh, I see, it's documented as

(quoted diff) +3 -0
+# @bitmap: Also export the dirty bitmap reachable from @device, so the
+#          NBD client can use NBD_OPT_SET_META_CONTEXT with
+#          "qemu:dirty-bitmap:NAME" to inspect the bitmap. (since 4.0)

and it is logical to assume that export name (which is @name argument) is mentioned. But we never mentioned it. This is just documented after removed experimenatl command x-nbd-server-add-bitmap,

look at

commit 7dc570b3806e5b0a4c9219061556ed5a4a0de80c

Author: Eric Blake <[email protected]>
Date:   Fri Jan 11 13:47:18 2019 -0600

nbd: Remove x-nbd-server-add-bitmap

...

(quoted diff) +0 -6
-# @bitmap-export-name: How the bitmap will be seen by nbd clients
-#                      (default @bitmap)
-#
-# Note: the client must use NBD_OPT_SET_META_CONTEXT with a query of
-# "qemu:dirty-bitmap:NAME" (where NAME matches @bitmap-export-name) to access
-# the exposed bitmap.
Quoted 2 lines

So, this "NAME" is saved and now looks incorrect. What should be fixed, is Qapi documentation.

Hm, I don't know these interfaces very well, but from you explanation it looks to me as if having a bitmap name made sense with x-nbd-server-add-bitmap because it could be called more than once for exporting multiple bitmaps.

But now, we have only nbd-server-add, which takes a single bitmap name. As we don't have to distinguish multiple bitmaps any more, wouldn't it make more sense to use "qemu:dirty-bitmap" without any other information? Both export name and bitmap name are already identified by the connection.

But if we have to have something there, using the bitmap name (which may or may not be the same as used in the image file) makes a little more sense because it makes the interface extensible for the case that we ever want to re-introduce an nbd-server-add-bitmap.

(By the way, even if the patch were correct, it lacks a Signed-off-by.)

Kevin

#3 lore raw
Quoted 37 lines · Kevin Wolf

Am 19.12.2019 um 14:41 hat Vladimir Sementsov-Ogievskiy geschrieben:

Quoted 28 lines

Ahh, I see, it's documented as

(quoted diff) +3 -0
+# @bitmap: Also export the dirty bitmap reachable from @device, so the
+#          NBD client can use NBD_OPT_SET_META_CONTEXT with
+#          "qemu:dirty-bitmap:NAME" to inspect the bitmap. (since 4.0)

and it is logical to assume that export name (which is @name argument) is mentioned. But we never mentioned it. This is just documented after removed experimenatl command x-nbd-server-add-bitmap,

look at

commit 7dc570b3806e5b0a4c9219061556ed5a4a0de80c

Author: Eric Blake <[email protected]>
Date:   Fri Jan 11 13:47:18 2019 -0600

nbd: Remove x-nbd-server-add-bitmap

...

(quoted diff) +0 -6
-# @bitmap-export-name: How the bitmap will be seen by nbd clients
-#                      (default @bitmap)
-#
-# Note: the client must use NBD_OPT_SET_META_CONTEXT with a query of
-# "qemu:dirty-bitmap:NAME" (where NAME matches @bitmap-export-name) to access
-# the exposed bitmap.
Quoted 2 lines

So, this "NAME" is saved and now looks incorrect. What should be fixed, is Qapi documentation.

Hm, I don't know these interfaces very well, but from you explanation it looks to me as if having a bitmap name made sense with x-nbd-server-add-bitmap because it could be called more than once for exporting multiple bitmaps.

Quoted 5 lines

But now, we have only nbd-server-add, which takes a single bitmap name. As we don't have to distinguish multiple bitmaps any more, wouldn't it make more sense to use "qemu:dirty-bitmap" without any other information? Both export name and bitmap name are already identified by the connection.

I think, it will a bit in conflict with already documented

* "qemu:dirty-bitmap:" - returns list of all available dirty-bitmap metadata contexts.

So, if we want some "default dirty bitmap", we'd better use something different from just dirty-bitmap. For example,

"qemu:default-dirty-bitmap"

Quoted 4 lines

But if we have to have something there, using the bitmap name (which may or may not be the same as used in the image file) makes a little more sense because it makes the interface extensible for the case that we ever want to re-introduce an nbd-server-add-bitmap.

Agree

Quoted 5 lines

(By the way, even if the patch were correct, it lacks a Signed-off-by.)

Kevin

Signature · 2 lines
Best regards,
Vladimir
#4 lore raw
In reply to Kevin Wolf
Quoted 38 lines · Kevin Wolf

Am 19.12.2019 um 14:41 hat Vladimir Sementsov-Ogievskiy geschrieben:

Quoted 28 lines

Ahh, I see, it's documented as

(quoted diff) +3 -0
+# @bitmap: Also export the dirty bitmap reachable from @device, so the
+#          NBD client can use NBD_OPT_SET_META_CONTEXT with
+#          "qemu:dirty-bitmap:NAME" to inspect the bitmap. (since 4.0)

and it is logical to assume that export name (which is @name argument) is mentioned. But we never mentioned it. This is just documented after removed experimenatl command x-nbd-server-add-bitmap,

look at

commit 7dc570b3806e5b0a4c9219061556ed5a4a0de80c

Author: Eric Blake <[email protected]>
Date:   Fri Jan 11 13:47:18 2019 -0600

nbd: Remove x-nbd-server-add-bitmap

...

(quoted diff) +0 -6
-# @bitmap-export-name: How the bitmap will be seen by nbd clients
-#                      (default @bitmap)
-#
-# Note: the client must use NBD_OPT_SET_META_CONTEXT with a query of
-# "qemu:dirty-bitmap:NAME" (where NAME matches @bitmap-export-name) to access
-# the exposed bitmap.
Quoted 2 lines

So, this "NAME" is saved and now looks incorrect. What should be fixed, is Qapi documentation.

Hm, I don't know these interfaces very well, but from you explanation it looks to me as if having a bitmap name made sense with x-nbd-server-add-bitmap because it could be called more than once for exporting multiple bitmaps.

Quoted 5 lines

But now, we have only nbd-server-add, which takes a single bitmap name. As we don't have to distinguish multiple bitmaps any more, wouldn't it make more sense to use "qemu:dirty-bitmap" without any other information? Both export name and bitmap name are already identified by the connection.

We can use empty string (like the default export name), so the bitmap would be exposed as:

"qemu:dirty-bitmap:"

This would solve the issue for users, and keep the API extensible.

Quoted 4 lines

But if we have to have something there, using the bitmap name (which may or may not be the same as used in the image file) makes a little more sense because it makes the interface extensible for the case that we ever want to re-introduce an nbd-server-add-bitmap.

But using the bitmap name means user of the NBD server need to know this name.

One option is that libvirt would publish the name of the bitmap in the xml describing
the backup, and oVirt will have to propagate this name to the actual program accessing
the NBD server, which may be a user program in the case when we expose the NBD URL to users (planned for future version).

Another option is that the user will control this name, and libvirt will use the name specified
by the user. This means oVirt will have to provide API to set this name and pass it to libvirt.

Both cases require lot of effort which does not help anyone in the task of getting dirty
extents from an image - which is our current goal. We need to have good defaults that
save unneeded effort in the entire stack.

Quoted 1 line

(By the way, even if the patch were correct,

I don't think this is about correctness, but having better default for users.

Nir

#5 lore raw
Quoted 45 lines · Nir Soffer
Quoted 38 lines · Kevin Wolf

Am 19.12.2019 um 14:41 hat Vladimir Sementsov-Ogievskiy geschrieben:

Quoted 28 lines

Ahh, I see, it's documented as

(quoted diff) +3 -0
+# @bitmap: Also export the dirty bitmap reachable from @device, so the
+#          NBD client can use NBD_OPT_SET_META_CONTEXT with
+#          "qemu:dirty-bitmap:NAME" to inspect the bitmap. (since 4.0)

and it is logical to assume that export name (which is @name argument) is mentioned. But we never mentioned it. This is just documented after removed experimenatl command x-nbd-server-add-bitmap,

look at

commit 7dc570b3806e5b0a4c9219061556ed5a4a0de80c

Author: Eric Blake <[email protected]>
Date:   Fri Jan 11 13:47:18 2019 -0600

nbd: Remove x-nbd-server-add-bitmap

...

(quoted diff) +0 -6
-# @bitmap-export-name: How the bitmap will be seen by nbd clients
-#                      (default @bitmap)
-#
-# Note: the client must use NBD_OPT_SET_META_CONTEXT with a query of
-# "qemu:dirty-bitmap:NAME" (where NAME matches @bitmap-export-name) to access
-# the exposed bitmap.
Quoted 2 lines

So, this "NAME" is saved and now looks incorrect. What should be fixed, is Qapi documentation.

Hm, I don't know these interfaces very well, but from you explanation it looks to me as if having a bitmap name made sense with x-nbd-server-add-bitmap because it could be called more than once for exporting multiple bitmaps.

Quoted 5 lines

But now, we have only nbd-server-add, which takes a single bitmap name. As we don't have to distinguish multiple bitmaps any more, wouldn't it make more sense to use "qemu:dirty-bitmap" without any other information? Both export name and bitmap name are already identified by the connection.

Quoted 6 lines

We can use empty string (like the default export name), so the bitmap would be exposed as:

"qemu:dirty-bitmap:"

This would solve the issue for users, and keep the API extensible.

As I already said, we can not. If we really wont such thing, use another name, likq qemu:default-dirty-bitmap..

Or call bitmap export "default", to produce
"qemu:dirty-bitmaps:default"

But don't change default behavior of nbd-server-add

Quoted 7 lines
Quoted 5 lines

But if we have to have something there, using the bitmap name (which may or may not be the same as used in the image file) makes a little more sense because it makes the interface extensible for the case that we ever want to re-introduce an nbd-server-add-bitmap.

But using the bitmap name means user of the NBD server need to know this name.

Why not? What is your case exactly? User knows, what kind of bitmap you are exporting, so user is in some relation with exporting process anyway. Why shouldn't it know the name?

This name may be defined in you exporting protocol.. What are you exporting?

Note also, that client may use NBD_OPT_LIST_META_CONTEXT with query "qemu:dirty-bitmap:", to get list of all exported bitmaps.

Quoted 13 lines

One option is that libvirt would publish the name of the bitmap in the xml describing
the backup, and oVirt will have to propagate this name to the actual program accessing
the NBD server, which may be a user program in the case when we expose the NBD URL to users (planned for future version).

Another option is that the user will control this name, and libvirt will use the name specified
by the user. This means oVirt will have to provide API to set this name and pass it to libvirt.

Quoted 5 lines

Both cases require lot of effort which does not help anyone in the task of getting dirty
extents from an image - which is our current goal. We need to have good defaults that
save unneeded effort in the entire stack.

So, you implementing some protocol, and need to export only one bitmap for your specified scenario. Why not just give a constant name? Like ovirt-bitmap, or something like this?

(of course, we need new optional paramter export-bitmap-name for nbd-server-add, as I proposes, or reimplement nbd-server-add-bitmap)

Quoted 5 lines
Quoted 2 lines

(By the way, even if the patch were correct,

I don't think this is about correctness, but having better default for users.

Changing defaults always breaks existing users. For example Virtuozzo. We live with these defaults, you can't just change it without any new option.. I hope.

Signature · 2 lines
Best regards,
Vladimir
#6 lore raw
Quoted 68 lines · Vladimir Sementsov-Ogievskiy
Quoted 45 lines · Nir Soffer
Quoted 38 lines · Kevin Wolf

Am 19.12.2019 um 14:41 hat Vladimir Sementsov-Ogievskiy geschrieben:

Quoted 28 lines

Ahh, I see, it's documented as

(quoted diff) +3 -0
+# @bitmap: Also export the dirty bitmap reachable from @device, so the
+#          NBD client can use NBD_OPT_SET_META_CONTEXT with
+#          "qemu:dirty-bitmap:NAME" to inspect the bitmap. (since 4.0)

and it is logical to assume that export name (which is @name argument) is mentioned. But we never mentioned it. This is just documented after removed experimenatl command x-nbd-server-add-bitmap,

look at

commit 7dc570b3806e5b0a4c9219061556ed5a4a0de80c

Author: Eric Blake <[email protected]>
Date:   Fri Jan 11 13:47:18 2019 -0600

nbd: Remove x-nbd-server-add-bitmap

...

(quoted diff) +0 -6
-# @bitmap-export-name: How the bitmap will be seen by nbd clients
-#                      (default @bitmap)
-#
-# Note: the client must use NBD_OPT_SET_META_CONTEXT with a query of
-# "qemu:dirty-bitmap:NAME" (where NAME matches @bitmap-export-name) to access
-# the exposed bitmap.
Quoted 2 lines

So, this "NAME" is saved and now looks incorrect. What should be fixed, is Qapi documentation.

Hm, I don't know these interfaces very well, but from you explanation it looks to me as if having a bitmap name made sense with x-nbd-server-add-bitmap because it could be called more than once for exporting multiple bitmaps.

Quoted 5 lines

But now, we have only nbd-server-add, which takes a single bitmap name. As we don't have to distinguish multiple bitmaps any more, wouldn't it make more sense to use "qemu:dirty-bitmap" without any other information? Both export name and bitmap name are already identified by the connection.

Quoted 6 lines

We can use empty string (like the default export name), so the bitmap would be exposed as:

"qemu:dirty-bitmap:"

This would solve the issue for users, and keep the API extensible.

As I already said, we can not. If we really wont such thing, use another name, likq qemu:default-dirty-bitmap..

Or call bitmap export "default", to produce
"qemu:dirty-bitmaps:default"

But don't change default behavior of nbd-server-add

Quoted 6 lines
Quoted 5 lines

But if we have to have something there, using the bitmap name (which may or may not be the same as used in the image file) makes a little more sense because it makes the interface extensible for the case that we ever want to re-introduce an nbd-server-add-bitmap.

Quoted 5 lines
Quoted 1 line

But using the bitmap name means user of the NBD server need to know this name.

Why not? What is your case exactly? User knows, what kind of bitmap you are exporting, so user is in some relation with exporting process anyway. Why shouldn't it know the name?

Because the user configuring qemu (libvirt) is not the same user accessing qemu NBD
server (ovirt, or some backup application).

Quoted 1 line

This name may be defined in you exporting protocol.. What are you exporting?

We export HTTP API, allowing getting dirty extents and reading data:
https://www.ovirt.org/develop/release-management/features/storage/incremental-backup.html#map-request
(this document is outdated, but it gives the general idea)

Or provide the NBD URL directly to user (future).

Quoted 2 lines

Note also, that client may use NBD_OPT_LIST_META_CONTEXT with query "qemu:dirty-bitmap:", to get list of all exported bitmaps.

This is another option, I did not try to use this yet. We can use the single exported bitmap and fail if we get more than one. This is probably better than changing the entire stack to support bitmap name.

Quoted 18 lines
Quoted 12 lines

One option is that libvirt would publish the name of the bitmap in the xml describing
the backup, and oVirt will have to propagate this name to the actual program accessing
the NBD server, which may be a user program in the case when we expose the NBD URL to users (planned for future version).

Another option is that the user will control this name, and libvirt will use the name specified
by the user. This means oVirt will have to provide API to set this name and pass it to libvirt.

Quoted 5 lines

Both cases require lot of effort which does not help anyone in the task of getting dirty
extents from an image - which is our current goal. We need to have good defaults that
save unneeded effort in the entire stack.

Quoted 3 lines

So, you implementing some protocol, and need to export only one bitmap for your specified scenario. Why not just give a constant name? Like ovirt-bitmap, or something like this?

But we don't use qemu directly. We use libvirt, and libvirt does not expose the name of the bitmap, or let use control this name.

This is a simplified flow:
1. libvirt starts a backup, creating the "backup-exportname" bitmap
2. oVirt host agent reports the nbd url for the disk
3. oVirt manager configures nbd/http proxy with nbd url
4. User (e.g. backup application) access the http/nbd proxy to get the dirty extents

Alternatively, oVirt mangaer would provide the NBD url directly to the user, and it will access it directly with some NBD client.

To make this work we need to pass more information between the different programs
and change APIs to publish or accept bitmap names. This is a lot of work that does
not help the current use case, accessing a single dirty bitmap.

We can solve it in libvirt if we don't have another choice.

Quoted 11 lines

(of course, we need new optional paramter export-bitmap-name for nbd-server-add, as I proposes, or reimplement nbd-server-add-bitmap)

Quoted 5 lines
Quoted 2 lines

(By the way, even if the patch were correct,

I don't think this is about correctness, but having better default for users.

Changing defaults always breaks existing users. For example Virtuozzo. We live with these defaults, you can't just change it without any new option.. I hope.

That's a good point, we should not break existing usage.

Nir

#7 lore raw
Quoted 117 lines · Nir Soffer
Quoted 68 lines · Vladimir Sementsov-Ogievskiy
Quoted 45 lines · Nir Soffer
Quoted 38 lines · Kevin Wolf

Am 19.12.2019 um 14:41 hat Vladimir Sementsov-Ogievskiy geschrieben:

Quoted 28 lines

Ahh, I see, it's documented as

(quoted diff) +3 -0
+# @bitmap: Also export the dirty bitmap reachable from @device, so the
+#          NBD client can use NBD_OPT_SET_META_CONTEXT with
+#          "qemu:dirty-bitmap:NAME" to inspect the bitmap. (since 4.0)

and it is logical to assume that export name (which is @name argument) is mentioned. But we never mentioned it. This is just documented after removed experimenatl command x-nbd-server-add-bitmap,

look at

commit 7dc570b3806e5b0a4c9219061556ed5a4a0de80c

Author: Eric Blake <[email protected]>
Date:   Fri Jan 11 13:47:18 2019 -0600

nbd: Remove x-nbd-server-add-bitmap

...

(quoted diff) +0 -6
-# @bitmap-export-name: How the bitmap will be seen by nbd clients
-#                      (default @bitmap)
-#
-# Note: the client must use NBD_OPT_SET_META_CONTEXT with a query of
-# "qemu:dirty-bitmap:NAME" (where NAME matches @bitmap-export-name) to access
-# the exposed bitmap.
Quoted 2 lines

So, this "NAME" is saved and now looks incorrect. What should be fixed, is Qapi documentation.

Hm, I don't know these interfaces very well, but from you explanation it looks to me as if having a bitmap name made sense with x-nbd-server-add-bitmap because it could be called more than once for exporting multiple bitmaps.

Quoted 5 lines

But now, we have only nbd-server-add, which takes a single bitmap name. As we don't have to distinguish multiple bitmaps any more, wouldn't it make more sense to use "qemu:dirty-bitmap" without any other information? Both export name and bitmap name are already identified by the connection.

Quoted 6 lines

We can use empty string (like the default export name), so the bitmap would be exposed as:

"qemu:dirty-bitmap:"

This would solve the issue for users, and keep the API extensible.

As I already said, we can not. If we really wont such thing, use another name, likq qemu:default-dirty-bitmap..

Or call bitmap export "default", to produce
"qemu:dirty-bitmaps:default"

But don't change default behavior of nbd-server-add

Quoted 6 lines
Quoted 5 lines

But if we have to have something there, using the bitmap name (which may or may not be the same as used in the image file) makes a little more sense because it makes the interface extensible for the case that we ever want to re-introduce an nbd-server-add-bitmap.

Quoted 5 lines
Quoted 1 line

But using the bitmap name means user of the NBD server need to know this name.

Why not? What is your case exactly? User knows, what kind of bitmap you are exporting, so user is in some relation with exporting process anyway. Why shouldn't it know the name?

Because the user configuring qemu (libvirt) is not the same user accessing qemu NBD
server (ovirt, or some backup application).

Quoted 1 line

This name may be defined in you exporting protocol.. What are you exporting?

We export HTTP API, allowing getting dirty extents and reading data:
https://www.ovirt.org/develop/release-management/features/storage/incremental-backup.html#map-request
(this document is outdated, but it gives the general idea)

Or provide the NBD URL directly to user (future).

Quoted 2 lines

Note also, that client may use NBD_OPT_LIST_META_CONTEXT with query "qemu:dirty-bitmap:", to get list of all exported bitmaps.

This is another option, I did not try to use this yet. We can use the single exported bitmap and fail if we get more than one. This is probably better than changing the entire stack to support bitmap name.

Quoted 18 lines
Quoted 12 lines

One option is that libvirt would publish the name of the bitmap in the xml describing
the backup, and oVirt will have to propagate this name to the actual program accessing
the NBD server, which may be a user program in the case when we expose the NBD URL to users (planned for future version).

Another option is that the user will control this name, and libvirt will use the name specified
by the user. This means oVirt will have to provide API to set this name and pass it to libvirt.

Quoted 5 lines

Both cases require lot of effort which does not help anyone in the task of getting dirty
extents from an image - which is our current goal. We need to have good defaults that
save unneeded effort in the entire stack.

Quoted 3 lines

So, you implementing some protocol, and need to export only one bitmap for your specified scenario. Why not just give a constant name? Like ovirt-bitmap, or something like this?

Quoted 5 lines

But we don't use qemu directly. We use libvirt, and libvirt does not expose the name of the bitmap, or let use control this name.

This is a simplified flow:
1. libvirt starts a backup, creating the "backup-exportname" bitmap

But do you manage exportname, or not?

Quoted 8 lines

2. oVirt host agent reports the nbd url for the disk
3. oVirt manager configures nbd/http proxy with nbd url
4. User (e.g. backup application) access the http/nbd proxy to get the dirty extents

Alternatively, oVirt mangaer would provide the NBD url directly to the user, and it will access it directly with some NBD client.

Quoted 7 lines

To make this work we need to pass more information between the different programs
and change APIs to publish or accept bitmap names. This is a lot of work that does
not help the current use case, accessing a single dirty bitmap.

We can solve it in libvirt if we don't have another choice.

Aha. So, the actual problem is that you use libvirt feature, which on the output gives you bitmap, with some name chosen by libvirt, and it is not comfortable.

Then may be correct way is to make in libvirt an option to chose export-bitmap-name, backed in Qemu by corresponding option in nbd-server-add (or nbd-server-add-bitmap)?

Then you just chose some name, like __org_ovirt_bitmap, which would be additional check for nbd client, that this is the correct bitmap to use, and everything is good?

Quoted 17 lines
Quoted 5 lines

(of course, we need new optional paramter export-bitmap-name for nbd-server-add, as I proposes, or reimplement nbd-server-add-bitmap)

Quoted 1 line
Quoted 7 lines
Quoted 4 lines
Quoted 1 line

(By the way, even if the patch were correct,

I don't think this is about correctness, but having better default for users.

Changing defaults always breaks existing users. For example Virtuozzo. We live with these defaults, you can't just change it without any new option.. I hope.

That's a good point, we should not break existing usage.

Nir

Signature · 2 lines
Best regards,
Vladimir
#8 lore raw
Quoted 118 lines · Vladimir Sementsov-Ogievskiy
Quoted 117 lines · Nir Soffer
Quoted 68 lines · Vladimir Sementsov-Ogievskiy
Quoted 45 lines · Nir Soffer
Quoted 38 lines · Kevin Wolf

Am 19.12.2019 um 14:41 hat Vladimir Sementsov-Ogievskiy geschrieben:

Quoted 28 lines

Ahh, I see, it's documented as

(quoted diff) +3 -0
+# @bitmap: Also export the dirty bitmap reachable from @device, so the
+#          NBD client can use NBD_OPT_SET_META_CONTEXT with
+#          "qemu:dirty-bitmap:NAME" to inspect the bitmap. (since 4.0)

and it is logical to assume that export name (which is @name argument) is mentioned. But we never mentioned it. This is just documented after removed experimenatl command x-nbd-server-add-bitmap,

look at

commit 7dc570b3806e5b0a4c9219061556ed5a4a0de80c

Author: Eric Blake <[email protected]>
Date:   Fri Jan 11 13:47:18 2019 -0600

nbd: Remove x-nbd-server-add-bitmap

...

(quoted diff) +0 -6
-# @bitmap-export-name: How the bitmap will be seen by nbd clients
-#                      (default @bitmap)
-#
-# Note: the client must use NBD_OPT_SET_META_CONTEXT with a query of
-# "qemu:dirty-bitmap:NAME" (where NAME matches @bitmap-export-name) to access
-# the exposed bitmap.
Quoted 2 lines

So, this "NAME" is saved and now looks incorrect. What should be fixed, is Qapi documentation.

Hm, I don't know these interfaces very well, but from you explanation it looks to me as if having a bitmap name made sense with x-nbd-server-add-bitmap because it could be called more than once for exporting multiple bitmaps.

Quoted 5 lines

But now, we have only nbd-server-add, which takes a single bitmap name. As we don't have to distinguish multiple bitmaps any more, wouldn't it make more sense to use "qemu:dirty-bitmap" without any other information? Both export name and bitmap name are already identified by the connection.

Quoted 6 lines

We can use empty string (like the default export name), so the bitmap would be exposed as:

"qemu:dirty-bitmap:"

This would solve the issue for users, and keep the API extensible.

As I already said, we can not. If we really wont such thing, use another name, likq qemu:default-dirty-bitmap..

Or call bitmap export "default", to produce
"qemu:dirty-bitmaps:default"

But don't change default behavior of nbd-server-add

Quoted 6 lines
Quoted 5 lines

But if we have to have something there, using the bitmap name (which may or may not be the same as used in the image file) makes a little more sense because it makes the interface extensible for the case that we ever want to re-introduce an nbd-server-add-bitmap.

Quoted 5 lines
Quoted 1 line

But using the bitmap name means user of the NBD server need to know this name.

Why not? What is your case exactly? User knows, what kind of bitmap you are exporting, so user is in some relation with exporting process anyway. Why shouldn't it know the name?

Because the user configuring qemu (libvirt) is not the same user accessing qemu NBD
server (ovirt, or some backup application).

Quoted 1 line

This name may be defined in you exporting protocol.. What are you exporting?

We export HTTP API, allowing getting dirty extents and reading data:
https://www.ovirt.org/develop/release-management/features/storage/incremental-backup.html#map-request
(this document is outdated, but it gives the general idea)

Or provide the NBD URL directly to user (future).

Quoted 2 lines

Note also, that client may use NBD_OPT_LIST_META_CONTEXT with query "qemu:dirty-bitmap:", to get list of all exported bitmaps.

This is another option, I did not try to use this yet. We can use the single exported bitmap and fail if we get more than one. This is probably better than changing the entire stack to support bitmap name.

Quoted 21 lines
Quoted 12 lines

One option is that libvirt would publish the name of the bitmap in the xml describing
the backup, and oVirt will have to propagate this name to the actual program accessing
the NBD server, which may be a user program in the case when we expose the NBD URL to users (planned for future version).

Another option is that the user will control this name, and libvirt will use the name specified
by the user. This means oVirt will have to provide API to set this name and pass it to libvirt.

Quoted 5 lines

Both cases require lot of effort which does not help anyone in the task of getting dirty
extents from an image - which is our current goal. We need to have good defaults that
save unneeded effort in the entire stack.

So, you implementing some protocol, and need to export only one bitmap for your specified scenario. Why not just give a constant name? Like ovirt-bitmap, or something like this?

Quoted 7 lines
Quoted 5 lines

But we don't use qemu directly. We use libvirt, and libvirt does not expose the name of the bitmap, or let use control this name.

This is a simplified flow:
1. libvirt starts a backup, creating the "backup-exportname" bitmap

But do you manage exportname, or not?

They can't manage the export name either, but apparently the default that libvirt uses suits them.

I can add possibility to name the actual backup output bitmap arbitrarily. Obviously the user then has to pass a sensible name of a non existant bitmap to proceed.

Making both configurable at the same time may be worth doing as it will be basically the same code.

#9 lore raw
Quoted 130 lines · Peter Krempa
Quoted 118 lines · Vladimir Sementsov-Ogievskiy
Quoted 117 lines · Nir Soffer
Quoted 68 lines · Vladimir Sementsov-Ogievskiy
Quoted 45 lines · Nir Soffer
Quoted 38 lines · Kevin Wolf

Am 19.12.2019 um 14:41 hat Vladimir Sementsov-Ogievskiy geschrieben:

Quoted 28 lines

Ahh, I see, it's documented as

(quoted diff) +3 -0
+# @bitmap: Also export the dirty bitmap reachable from @device, so the
+#          NBD client can use NBD_OPT_SET_META_CONTEXT with
+#          "qemu:dirty-bitmap:NAME" to inspect the bitmap. (since 4.0)

and it is logical to assume that export name (which is @name argument) is mentioned. But we never mentioned it. This is just documented after removed experimenatl command x-nbd-server-add-bitmap,

look at

commit 7dc570b3806e5b0a4c9219061556ed5a4a0de80c

Author: Eric Blake <[email protected]>
Date:   Fri Jan 11 13:47:18 2019 -0600

nbd: Remove x-nbd-server-add-bitmap

...

(quoted diff) +0 -6
-# @bitmap-export-name: How the bitmap will be seen by nbd clients
-#                      (default @bitmap)
-#
-# Note: the client must use NBD_OPT_SET_META_CONTEXT with a query of
-# "qemu:dirty-bitmap:NAME" (where NAME matches @bitmap-export-name) to access
-# the exposed bitmap.
Quoted 2 lines

So, this "NAME" is saved and now looks incorrect. What should be fixed, is Qapi documentation.

Hm, I don't know these interfaces very well, but from you explanation it looks to me as if having a bitmap name made sense with x-nbd-server-add-bitmap because it could be called more than once for exporting multiple bitmaps.

Quoted 5 lines

But now, we have only nbd-server-add, which takes a single bitmap name. As we don't have to distinguish multiple bitmaps any more, wouldn't it make more sense to use "qemu:dirty-bitmap" without any other information? Both export name and bitmap name are already identified by the connection.

Quoted 6 lines

We can use empty string (like the default export name), so the bitmap would be exposed as:

"qemu:dirty-bitmap:"

This would solve the issue for users, and keep the API extensible.

As I already said, we can not. If we really wont such thing, use another name, likq qemu:default-dirty-bitmap..

Or call bitmap export "default", to produce
"qemu:dirty-bitmaps:default"

But don't change default behavior of nbd-server-add

Quoted 6 lines
Quoted 5 lines

But if we have to have something there, using the bitmap name (which may or may not be the same as used in the image file) makes a little more sense because it makes the interface extensible for the case that we ever want to re-introduce an nbd-server-add-bitmap.

Quoted 5 lines
Quoted 1 line

But using the bitmap name means user of the NBD server need to know this name.

Why not? What is your case exactly? User knows, what kind of bitmap you are exporting, so user is in some relation with exporting process anyway. Why shouldn't it know the name?

Because the user configuring qemu (libvirt) is not the same user accessing qemu NBD
server (ovirt, or some backup application).

Quoted 1 line

This name may be defined in you exporting protocol.. What are you exporting?

We export HTTP API, allowing getting dirty extents and reading data:
https://www.ovirt.org/develop/release-management/features/storage/incremental-backup.html#map-request
(this document is outdated, but it gives the general idea)

Or provide the NBD URL directly to user (future).

Quoted 2 lines

Note also, that client may use NBD_OPT_LIST_META_CONTEXT with query "qemu:dirty-bitmap:", to get list of all exported bitmaps.

This is another option, I did not try to use this yet. We can use the single exported bitmap and fail if we get more than one. This is probably better than changing the entire stack to support bitmap name.

Quoted 21 lines
Quoted 12 lines

One option is that libvirt would publish the name of the bitmap in the xml describing
the backup, and oVirt will have to propagate this name to the actual program accessing
the NBD server, which may be a user program in the case when we expose the NBD URL to users (planned for future version).

Another option is that the user will control this name, and libvirt will use the name specified
by the user. This means oVirt will have to provide API to set this name and pass it to libvirt.

Quoted 5 lines

Both cases require lot of effort which does not help anyone in the task of getting dirty
extents from an image - which is our current goal. We need to have good defaults that
save unneeded effort in the entire stack.

So, you implementing some protocol, and need to export only one bitmap for your specified scenario. Why not just give a constant name? Like ovirt-bitmap, or something like this?

Quoted 7 lines
Quoted 5 lines

But we don't use qemu directly. We use libvirt, and libvirt does not expose the name of the bitmap, or let use control this name.

This is a simplified flow:
1. libvirt starts a backup, creating the "backup-exportname" bitmap

But do you manage exportname, or not?

They can't manage the export name either, but apparently the default that libvirt uses suits them.

Quoted 7 lines

I can add possibility to name the actual backup output bitmap arbitrarily. Obviously the user then has to pass a sensible name of a non existant bitmap to proceed.

Making both configurable at the same time may be worth doing as it will be basically the same code.

Intuitively, I think it's better leave bitmap name as is: libvirt manages bitmaps, so let it manage their names as it wants. And I don't think that Nir want to care about existing bitmaps.

But bitmap-export-name is the other thing. It's a bitmap name, as it represented to NBD client. And it may be something other. By default Qemu uses name of the bitmap as this name, but we can add an option to alter this behavior (actually we had such option in experimental x-nbd-server-add-bitmap, which was dropped).

Then, for this "nbd bitmap name" or "export bitmap name", Nir will be able to use some constant name, which will never conflict with other bitmaps, as it is the other thing (part of NBD metadata context name)

Signature · 2 lines
Best regards,
Vladimir
#10 lore raw
Quoted 135 lines · Vladimir Sementsov-Ogievskiy
Quoted 134 lines · Peter Krempa
Quoted 118 lines · Vladimir Sementsov-Ogievskiy
Quoted 117 lines · Nir Soffer
Quoted 68 lines · Vladimir Sementsov-Ogievskiy
Quoted 45 lines · Nir Soffer
Quoted 38 lines · Kevin Wolf

Am 19.12.2019 um 14:41 hat Vladimir Sementsov-Ogievskiy geschrieben:

Quoted 28 lines

Ahh, I see, it's documented as

(quoted diff) +3 -0
+# @bitmap: Also export the dirty bitmap reachable from @device, so the
+#          NBD client can use NBD_OPT_SET_META_CONTEXT with
+#          "qemu:dirty-bitmap:NAME" to inspect the bitmap. (since 4.0)

and it is logical to assume that export name (which is @name argument) is mentioned. But we never mentioned it. This is just documented after removed experimenatl command x-nbd-server-add-bitmap,

look at

commit 7dc570b3806e5b0a4c9219061556ed5a4a0de80c

Author: Eric Blake <[email protected]>
Date:   Fri Jan 11 13:47:18 2019 -0600

nbd: Remove x-nbd-server-add-bitmap

...

(quoted diff) +0 -6
-# @bitmap-export-name: How the bitmap will be seen by nbd clients
-#                      (default @bitmap)
-#
-# Note: the client must use NBD_OPT_SET_META_CONTEXT with a query of
-# "qemu:dirty-bitmap:NAME" (where NAME matches @bitmap-export-name) to access
-# the exposed bitmap.
Quoted 2 lines

So, this "NAME" is saved and now looks incorrect. What should be fixed, is Qapi documentation.

Hm, I don't know these interfaces very well, but from you explanation it looks to me as if having a bitmap name made sense with x-nbd-server-add-bitmap because it could be called more than once for exporting multiple bitmaps.

Quoted 5 lines

But now, we have only nbd-server-add, which takes a single bitmap name. As we don't have to distinguish multiple bitmaps any more, wouldn't it make more sense to use "qemu:dirty-bitmap" without any other information? Both export name and bitmap name are already identified by the connection.

Quoted 6 lines

We can use empty string (like the default export name), so the bitmap would be exposed as:

"qemu:dirty-bitmap:"

This would solve the issue for users, and keep the API extensible.

As I already said, we can not. If we really wont such thing, use another name, likq qemu:default-dirty-bitmap..

Or call bitmap export "default", to produce
"qemu:dirty-bitmaps:default"

But don't change default behavior of nbd-server-add

Quoted 6 lines
Quoted 5 lines

But if we have to have something there, using the bitmap name (which may or may not be the same as used in the image file) makes a little more sense because it makes the interface extensible for the case that we ever want to re-introduce an nbd-server-add-bitmap.

Quoted 5 lines
Quoted 1 line

But using the bitmap name means user of the NBD server need to know this name.

Why not? What is your case exactly? User knows, what kind of bitmap you are exporting, so user is in some relation with exporting process anyway. Why shouldn't it know the name?

Because the user configuring qemu (libvirt) is not the same user accessing qemu NBD
server (ovirt, or some backup application).

Quoted 1 line

This name may be defined in you exporting protocol.. What are you exporting?

We export HTTP API, allowing getting dirty extents and reading data:
https://www.ovirt.org/develop/release-management/features/storage/incremental-backup.html#map-request
(this document is outdated, but it gives the general idea)

Or provide the NBD URL directly to user (future).

Quoted 2 lines

Note also, that client may use NBD_OPT_LIST_META_CONTEXT with query "qemu:dirty-bitmap:", to get list of all exported bitmaps.

This is another option, I did not try to use this yet. We can use the single exported bitmap and fail if we get more than one. This is probably better than changing the entire stack to support bitmap name.

Quoted 21 lines
Quoted 12 lines

One option is that libvirt would publish the name of the bitmap in the xml describing
the backup, and oVirt will have to propagate this name to the actual program accessing
the NBD server, which may be a user program in the case when we expose the NBD URL to users (planned for future version).

Another option is that the user will control this name, and libvirt will use the name specified
by the user. This means oVirt will have to provide API to set this name and pass it to libvirt.

Quoted 5 lines

Both cases require lot of effort which does not help anyone in the task of getting dirty
extents from an image - which is our current goal. We need to have good defaults that
save unneeded effort in the entire stack.

So, you implementing some protocol, and need to export only one bitmap for your specified scenario. Why not just give a constant name? Like ovirt-bitmap, or something like this?

Quoted 7 lines
Quoted 5 lines

But we don't use qemu directly. We use libvirt, and libvirt does not expose the name of the bitmap, or let use control this name.

This is a simplified flow:
1. libvirt starts a backup, creating the "backup-exportname" bitmap

But do you manage exportname, or not?

They can't manage the export name either, but apparently the default that libvirt uses suits them.

I can add possibility to name the actual backup output bitmap arbitrarily. Obviously the user then has to pass a sensible name of a non existant bitmap to proceed.

Quoted 7 lines
Quoted 3 lines

Making both configurable at the same time may be worth doing as it will be basically the same code.

Intuitively, I think it's better leave bitmap name as is: libvirt manages bitmaps, so let it manage their names as it wants. And I don't think that Nir want to care about existing bitmaps.

Actually for an incremental backup we are creating a new bitmap which is used for merging all the appropriate bitmaps for the expected backup range. This is done also when only one bitmap would be selected this way as there's no point in optimizing this algorithm.

This means we can name the new bitmap arbitrarily (if it doesn't clash with existing bitmap) and since that name will be also exported it's the same they request.

#11 lore raw
Quoted 144 lines · Peter Krempa
Quoted 135 lines · Vladimir Sementsov-Ogievskiy
Quoted 134 lines · Peter Krempa
Quoted 118 lines · Vladimir Sementsov-Ogievskiy
Quoted 117 lines · Nir Soffer
Quoted 68 lines · Vladimir Sementsov-Ogievskiy
Quoted 45 lines · Nir Soffer
Quoted 38 lines · Kevin Wolf

Am 19.12.2019 um 14:41 hat Vladimir Sementsov-Ogievskiy geschrieben:

Quoted 28 lines

Ahh, I see, it's documented as

(quoted diff) +3 -0
+# @bitmap: Also export the dirty bitmap reachable from @device, so the
+#          NBD client can use NBD_OPT_SET_META_CONTEXT with
+#          "qemu:dirty-bitmap:NAME" to inspect the bitmap. (since 4.0)

and it is logical to assume that export name (which is @name argument) is mentioned. But we never mentioned it. This is just documented after removed experimenatl command x-nbd-server-add-bitmap,

look at

commit 7dc570b3806e5b0a4c9219061556ed5a4a0de80c

Author: Eric Blake <[email protected]>
Date:   Fri Jan 11 13:47:18 2019 -0600

nbd: Remove x-nbd-server-add-bitmap

...

(quoted diff) +0 -6
-# @bitmap-export-name: How the bitmap will be seen by nbd clients
-#                      (default @bitmap)
-#
-# Note: the client must use NBD_OPT_SET_META_CONTEXT with a query of
-# "qemu:dirty-bitmap:NAME" (where NAME matches @bitmap-export-name) to access
-# the exposed bitmap.
Quoted 2 lines

So, this "NAME" is saved and now looks incorrect. What should be fixed, is Qapi documentation.

Hm, I don't know these interfaces very well, but from you explanation it looks to me as if having a bitmap name made sense with x-nbd-server-add-bitmap because it could be called more than once for exporting multiple bitmaps.

Quoted 5 lines

But now, we have only nbd-server-add, which takes a single bitmap name. As we don't have to distinguish multiple bitmaps any more, wouldn't it make more sense to use "qemu:dirty-bitmap" without any other information? Both export name and bitmap name are already identified by the connection.

Quoted 6 lines

We can use empty string (like the default export name), so the bitmap would be exposed as:

"qemu:dirty-bitmap:"

This would solve the issue for users, and keep the API extensible.

As I already said, we can not. If we really wont such thing, use another name, likq qemu:default-dirty-bitmap..

Or call bitmap export "default", to produce
"qemu:dirty-bitmaps:default"

But don't change default behavior of nbd-server-add

Quoted 6 lines
Quoted 5 lines

But if we have to have something there, using the bitmap name (which may or may not be the same as used in the image file) makes a little more sense because it makes the interface extensible for the case that we ever want to re-introduce an nbd-server-add-bitmap.

Quoted 5 lines
Quoted 1 line

But using the bitmap name means user of the NBD server need to know this name.

Why not? What is your case exactly? User knows, what kind of bitmap you are exporting, so user is in some relation with exporting process anyway. Why shouldn't it know the name?

Because the user configuring qemu (libvirt) is not the same user accessing qemu NBD
server (ovirt, or some backup application).

Quoted 1 line

This name may be defined in you exporting protocol.. What are you exporting?

We export HTTP API, allowing getting dirty extents and reading data:
https://www.ovirt.org/develop/release-management/features/storage/incremental-backup.html#map-request
(this document is outdated, but it gives the general idea)

Or provide the NBD URL directly to user (future).

Quoted 2 lines

Note also, that client may use NBD_OPT_LIST_META_CONTEXT with query "qemu:dirty-bitmap:", to get list of all exported bitmaps.

This is another option, I did not try to use this yet. We can use the single exported bitmap and fail if we get more than one. This is probably better than changing the entire stack to support bitmap name.

Quoted 21 lines
Quoted 12 lines

One option is that libvirt would publish the name of the bitmap in the xml describing
the backup, and oVirt will have to propagate this name to the actual program accessing
the NBD server, which may be a user program in the case when we expose the NBD URL to users (planned for future version).

Another option is that the user will control this name, and libvirt will use the name specified
by the user. This means oVirt will have to provide API to set this name and pass it to libvirt.

Quoted 5 lines

Both cases require lot of effort which does not help anyone in the task of getting dirty
extents from an image - which is our current goal. We need to have good defaults that
save unneeded effort in the entire stack.

So, you implementing some protocol, and need to export only one bitmap for your specified scenario. Why not just give a constant name? Like ovirt-bitmap, or something like this?

Quoted 7 lines
Quoted 5 lines

But we don't use qemu directly. We use libvirt, and libvirt does not expose the name of the bitmap, or let use control this name.

This is a simplified flow:
1. libvirt starts a backup, creating the "backup-exportname" bitmap

But do you manage exportname, or not?

They can't manage the export name either, but apparently the default that libvirt uses suits them.

I can add possibility to name the actual backup output bitmap arbitrarily. Obviously the user then has to pass a sensible name of a non existant bitmap to proceed.

Quoted 7 lines
Quoted 3 lines

Making both configurable at the same time may be worth doing as it will be basically the same code.

Intuitively, I think it's better leave bitmap name as is: libvirt manages bitmaps, so let it manage their names as it wants. And I don't think that Nir want to care about existing bitmaps.

Quoted 9 lines

Actually for an incremental backup we are creating a new bitmap which is used for merging all the appropriate bitmaps for the expected backup range. This is done also when only one bitmap would be selected this way as there's no point in optimizing this algorithm.

This means we can name the new bitmap arbitrarily (if it doesn't clash with existing bitmap) and since that name will be also exported it's the same they request.

Hm, clear. Then it should work too.

Signature · 2 lines
Best regards,
Vladimir
#12 lore raw
In reply to Nir Soffer
Quoted 3 lines · Nir Soffer

On Thu, Dec 19, 2019 at 5:17 PM Vladimir Sementsov-Ogievskiy <[email protected]> wrote:

...

Quoted 6 lines
Quoted 2 lines

Note also, that client may use NBD_OPT_LIST_META_CONTEXT with query "qemu:dirty-bitmap:", to get list of all exported bitmaps.

This is another option, I did not try to use this yet. We can use the single exported bitmap and fail if we get more than one. This is probably better than changing the entire stack to support bitmap name.

I went with this option for now, getting the single bitmap published by qemu.
https://gerrit.ovirt.org/c/105861/2/common/ovirt_imageio_common/nbd.py

This way I can work with current libvirt, and I don't care about the name of the bitmap.

Practically this will break if libvirt will configure another dirty bitmap, but it is fine.
Using API that promise list with unknown bitmap name is the same as API returning only one bitmap. Libvirt cannot change it now since it will break existing users :-)

#13 lore raw
In reply to Vladimir Sementsov-Ogievskiy
Quoted 6 lines · Vladimir Sementsov-Ogievskiy

I'd not call it a "fix".. As it implies something broken.

[edit: OK, now I see that something is broken, and why you called it "fix",
see below]

Quoted 7 lines
Quoted 3 lines · Nir Soffer

When adding an export with a dirty bitmap, expose the bitmap at:

qemu:dirty-bitmap:export-name

export-name? But it would be extra information, as client already knows with which export it works.

Right, using empty string would be good as well.

Quoted 53 lines

NBD commands NBD_OPT_GET/SET_META_CONTEXT includes export name as a parameter, so, any queried metadata (bitmaps, etc) is always bound to specified export.

Quoted 2 lines

This matches qapi documentation, and user expectations.

Hmmm,
"qemu" namespace is documented in docs/interop/nbd.txt, not in Qapi, which is also mention in official NBD spec.

Ahh, I see, it's documented as

(quoted diff) +3 -0
+# @bitmap: Also export the dirty bitmap reachable from @device, so the
+#          NBD client can use NBD_OPT_SET_META_CONTEXT with
+#          "qemu:dirty-bitmap:NAME" to inspect the bitmap. (since 4.0)

and it is logical to assume that export name (which is @name argument) is mentioned. But we never mentioned it. This is just documented after removed experimenatl command x-nbd-server-add-bitmap,

look at

commit 7dc570b3806e5b0a4c9219061556ed5a4a0de80c

Author: Eric Blake <[email protected]>
Date:   Fri Jan 11 13:47:18 2019 -0600

nbd: Remove x-nbd-server-add-bitmap

...

(quoted diff) +0 -6
-# @bitmap-export-name: How the bitmap will be seen by nbd clients
-#                      (default @bitmap)
-#
-# Note: the client must use NBD_OPT_SET_META_CONTEXT with a query of
-# "qemu:dirty-bitmap:NAME" (where NAME matches @bitmap-export-name) to access
-# the exposed bitmap.

So, this "NAME" is saved and now looks incorrect. What should be fixed, is Qapi documentation.

Quoted 5 lines

Without this, qemu leaks libvirt implementations details to clients by exposing the bitmap using the actual bitmap name:

qemu:dirty-bitmap:bitmap-name

Yes, "qemu" namespace specification says:
qemu:dirty-bitmap:<dirty-bitmap-export-name>

Quoted 7 lines

so, <dirty-bitmap-export-name> may be exact bitmap name or may be something other.

We just don't have an interface to set such name. It was in removed x-nbd-server-add-bitmap

So, if you need this possibility now, the correct way is to add 'export-bitmap-name' optional parameter to nbd-server-add, like it was in x-nbd-server-add-bitmap

I don't think we need such API. How would it help users trying to get dirty extents
from an image?

Quoted 13 lines
Quoted 13 lines

And all clients need to duplicate code like:

meta_context = "qemu:dirty-bitmap:backup-" + export_name

NBD allows exposing multiple bitmaps under "qemu:dirty-bitmap:" namespace, and clients can query the available bitmaps, but it is not clear what a client should do if a server provides multiple bitmaps.

---
  nbd/server.c               |  2 +-
  tests/qemu-iotests/223     | 16 ++++++++--------
  tests/qemu-iotests/223.out |  8 ++++----
  3 files changed, 13 insertions(+), 13 deletions(-)
Quoted 13 lines

nbd/server.c NBDExport *nbd_export_new(BlockDriverState *bs, uint64_t dev_offset, · line 1577

Quoted 10 lines
nbd/server.c +1 -1
index 24ebc1a805..f20f2994c0 100644
@@ -1574,7 +1574,7 @@ NBDExport *nbd_export_new(BlockDriverState *bs, uint64_t dev_offset,
          exp->export_bitmap = bm;
          assert(strlen(bitmap) <= BDRV_BITMAP_MAX_NAME_SIZE);
          exp->export_bitmap_context = g_strdup_printf("qemu:dirty-bitmap:%s",
-                                                     bitmap);
+                                                     name);

I think it's a bad idea to automatically name bitmap after export. Actually export may have several bitmaps (we just don't support it).

What are the semantics of multiple dirty bitmaps for same export? How users are going
to use this?

Quoted 95 lines

"NAME" in Qapi spec is a mistake.

Quoted 80 lines
nbd/server.c +0 -0
          assert(strlen(exp->export_bitmap_context) < NBD_MAX_STRING_SIZE);
      }
 
tests/qemu-iotests/223 +8 -8
index ea69cd4b8b..3068a7c280 100755
@@ -167,7 +167,7 @@ $QEMU_IO -r -c 'r -P 0x22 512 512' -c 'r -P 0 512k 512k' -c 'r -P 0x11 1m 1m' \
  $QEMU_IMG map --output=json --image-opts \
    "$IMG" | _filter_qemu_img_map
  $QEMU_IMG map --output=json --image-opts \
-  "$IMG,x-dirty-bitmap=qemu:dirty-bitmap:b" | _filter_qemu_img_map
+  "$IMG,x-dirty-bitmap=qemu:dirty-bitmap:n" | _filter_qemu_img_map
 
  echo
  echo "=== Contrast to small granularity dirty-bitmap ==="
@@ -175,7 +175,7 @@ echo
 
  IMG="driver=nbd,export=n2,server.type=unix,server.path=$SOCK_DIR/nbd"
  $QEMU_IMG map --output=json --image-opts \
-  "$IMG,x-dirty-bitmap=qemu:dirty-bitmap:b2" | _filter_qemu_img_map
+  "$IMG,x-dirty-bitmap=qemu:dirty-bitmap:n2" | _filter_qemu_img_map
 
  echo
  echo "=== End qemu NBD server ==="
@@ -199,15 +199,15 @@ echo
  echo "=== Use qemu-nbd as server ==="
  echo
 
-nbd_server_start_unix_socket -r -f $IMGFMT -B b "$TEST_IMG"
-IMG="driver=nbd,server.type=unix,server.path=$nbd_unix_socket"
+nbd_server_start_unix_socket -r -f $IMGFMT -x n -B b "$TEST_IMG"
+IMG="driver=nbd,export=n,server.type=unix,server.path=$nbd_unix_socket"
  $QEMU_IMG map --output=json --image-opts \
-  "$IMG,x-dirty-bitmap=qemu:dirty-bitmap:b" | _filter_qemu_img_map
+  "$IMG,x-dirty-bitmap=qemu:dirty-bitmap:n" | _filter_qemu_img_map
 
-nbd_server_start_unix_socket -f $IMGFMT -B b2 "$TEST_IMG"
-IMG="driver=nbd,server.type=unix,server.path=$nbd_unix_socket"
+nbd_server_start_unix_socket -f $IMGFMT -x n -B b2 "$TEST_IMG"
+IMG="driver=nbd,export=n,server.type=unix,server.path=$nbd_unix_socket"
  $QEMU_IMG map --output=json --image-opts \
-  "$IMG,x-dirty-bitmap=qemu:dirty-bitmap:b2" | _filter_qemu_img_map
+  "$IMG,x-dirty-bitmap=qemu:dirty-bitmap:n" | _filter_qemu_img_map
 
  # success, all done
  echo '*** done'
tests/qemu-iotests/223.out +3 -3
index f175598802..9f879add60 100644
@@ -61,7 +61,7 @@ exports available: 2
    max block: 33554432
    available meta contexts: 2
     base:allocation
-   qemu:dirty-bitmap:b
+   qemu:dirty-bitmap:n
   export: 'n2'
    size:  4194304
    flags: 0xced ( flush fua trim zeroes df cache fast-zero )
@@ -70,7 +70,7 @@ exports available: 2
    max block: 33554432
    available meta contexts: 2
     base:allocation
-   qemu:dirty-bitmap:b2
+   qemu:dirty-bitmap:n2
 
  === Contrast normal status to large granularity dirty-bitmap ===
 
@@ -141,7 +141,7 @@ exports available: 2
    max block: 33554432
    available meta contexts: 2
     base:allocation
-   qemu:dirty-bitmap:b
+   qemu:dirty-bitmap:n
   export: 'n2'
    size:  4194304
    flags: 0xced ( flush fua trim zeroes df cache fast-zero )

tests/qemu-iotests/223.out exports available: 2 · line 156

Quoted 8 lines
tests/qemu-iotests/223.out +1 -1
@@ -150,7 +150,7 @@ exports available: 2
    max block: 33554432
    available meta contexts: 2
     base:allocation
-   qemu:dirty-bitmap:b2
+   qemu:dirty-bitmap:n2
 
  === Contrast normal status to large granularity dirty-bitmap ===
 

--
Best regards,
Vladimir

#14 lore raw
Quoted 9 lines · Nir Soffer
Quoted 7 lines · Vladimir Sementsov-Ogievskiy

I'd not call it a "fix".. As it implies something broken.

[edit: OK, now I see that something is broken, and why you called it "fix",
see below]

19.12.2019 15:51, Nir Soffer wrote:

Quoted 8 lines
Quoted 6 lines
Quoted 3 lines

When adding an export with a dirty bitmap, expose the bitmap at:

qemu:dirty-bitmap:export-name

export-name? But it would be extra information, as client already knows with which export it works.

Right, using empty string would be good as well.

It will conflict with already documented in docs/interop/nbd.txt:

* "qemu:dirty-bitmap:" - returns list of all available dirty-bitmap metadata contexts.

Quoted 59 lines
Quoted 59 lines

NBD commands NBD_OPT_GET/SET_META_CONTEXT includes export name as a parameter, so, any queried metadata (bitmaps, etc) is always bound to specified export.

Quoted 2 lines

This matches qapi documentation, and user expectations.

Hmmm,
"qemu" namespace is documented in docs/interop/nbd.txt, not in Qapi, which is also mention in official NBD spec.

Ahh, I see, it's documented as

(quoted diff) +3 -0
+# @bitmap: Also export the dirty bitmap reachable from @device, so the
+#          NBD client can use NBD_OPT_SET_META_CONTEXT with
+#          "qemu:dirty-bitmap:NAME" to inspect the bitmap. (since 4.0)

and it is logical to assume that export name (which is @name argument) is mentioned. But we never mentioned it. This is just documented after removed experimenatl command x-nbd-server-add-bitmap,

look at

commit 7dc570b3806e5b0a4c9219061556ed5a4a0de80c

Author: Eric Blake <[email protected]>
Date:   Fri Jan 11 13:47:18 2019 -0600

nbd: Remove x-nbd-server-add-bitmap

...

(quoted diff) +0 -6
-# @bitmap-export-name: How the bitmap will be seen by nbd clients
-#                      (default @bitmap)
-#
-# Note: the client must use NBD_OPT_SET_META_CONTEXT with a query of
-# "qemu:dirty-bitmap:NAME" (where NAME matches @bitmap-export-name) to access
-# the exposed bitmap.

So, this "NAME" is saved and now looks incorrect. What should be fixed, is Qapi documentation.

Quoted 5 lines

Without this, qemu leaks libvirt implementations details to clients by exposing the bitmap using the actual bitmap name:

qemu:dirty-bitmap:bitmap-name

Yes, "qemu" namespace specification says:
qemu:dirty-bitmap:<dirty-bitmap-export-name>

so, <dirty-bitmap-export-name> may be exact bitmap name or may be something other.

We just don't have an interface to set such name. It was in removed x-nbd-server-add-bitmap

Quoted 6 lines
Quoted 2 lines

So, if you need this possibility now, the correct way is to add 'export-bitmap-name' optional parameter to nbd-server-add, like it was in x-nbd-server-add-bitmap

I don't think we need such API. How would it help users trying to get dirty extents
from an image?

It will solve the issue, which you mentioned in your commit message:
"qemu leaks libvirt implementations details"

Quoted 28 lines
Quoted 14 lines
Quoted 14 lines

And all clients need to duplicate code like:

meta_context = "qemu:dirty-bitmap:backup-" + export_name

NBD allows exposing multiple bitmaps under "qemu:dirty-bitmap:" namespace, and clients can query the available bitmaps, but it is not clear what a client should do if a server provides multiple bitmaps.

---
   nbd/server.c               |  2 +-
   tests/qemu-iotests/223     | 16 ++++++++--------
   tests/qemu-iotests/223.out |  8 ++++----
   3 files changed, 13 insertions(+), 13 deletions(-)
Quoted 13 lines

nbd/server.c NBDExport *nbd_export_new(BlockDriverState *bs, uint64_t dev_offset, · line 1577

Quoted 10 lines
nbd/server.c +1 -1
index 24ebc1a805..f20f2994c0 100644
@@ -1574,7 +1574,7 @@ NBDExport *nbd_export_new(BlockDriverState *bs, uint64_t dev_offset,
           exp->export_bitmap = bm;
           assert(strlen(bitmap) <= BDRV_BITMAP_MAX_NAME_SIZE);
           exp->export_bitmap_context = g_strdup_printf("qemu:dirty-bitmap:%s",
-                                                     bitmap);
+                                                     name);

I think it's a bad idea to automatically name bitmap after export. Actually export may have several bitmaps (we just don't support it).

Quoted 3 lines

What are the semantics of multiple dirty bitmaps for same export? How users are going
to use this?

semantic of the protocol defined in docs/interop/nbd.txt:

...
The "qemu" namespace currently contains only one type of context, related to exposing the contents of a dirty bitmap alongside the associated disk contents. That context has the following form:

qemu:dirty-bitmap:<dirty-bitmap-export-name>

...

We may export several bitmaps. Still, currently Qemu can export only one bitmap.

Quoted 97 lines
Quoted 96 lines

"NAME" in Qapi spec is a mistake.

Quoted 80 lines
nbd/server.c +0 -0
           assert(strlen(exp->export_bitmap_context) < NBD_MAX_STRING_SIZE);
       }
 
tests/qemu-iotests/223 +8 -8
index ea69cd4b8b..3068a7c280 100755
@@ -167,7 +167,7 @@ $QEMU_IO -r -c 'r -P 0x22 512 512' -c 'r -P 0 512k 512k' -c 'r -P 0x11 1m 1m' \
   $QEMU_IMG map --output=json --image-opts \
     "$IMG" | _filter_qemu_img_map
   $QEMU_IMG map --output=json --image-opts \
-  "$IMG,x-dirty-bitmap=qemu:dirty-bitmap:b" | _filter_qemu_img_map
+  "$IMG,x-dirty-bitmap=qemu:dirty-bitmap:n" | _filter_qemu_img_map
 
   echo
   echo "=== Contrast to small granularity dirty-bitmap ==="
@@ -175,7 +175,7 @@ echo
 
   IMG="driver=nbd,export=n2,server.type=unix,server.path=$SOCK_DIR/nbd"
   $QEMU_IMG map --output=json --image-opts \
-  "$IMG,x-dirty-bitmap=qemu:dirty-bitmap:b2" | _filter_qemu_img_map
+  "$IMG,x-dirty-bitmap=qemu:dirty-bitmap:n2" | _filter_qemu_img_map
 
   echo
   echo "=== End qemu NBD server ==="
@@ -199,15 +199,15 @@ echo
   echo "=== Use qemu-nbd as server ==="
   echo
 
-nbd_server_start_unix_socket -r -f $IMGFMT -B b "$TEST_IMG"
-IMG="driver=nbd,server.type=unix,server.path=$nbd_unix_socket"
+nbd_server_start_unix_socket -r -f $IMGFMT -x n -B b "$TEST_IMG"
+IMG="driver=nbd,export=n,server.type=unix,server.path=$nbd_unix_socket"
   $QEMU_IMG map --output=json --image-opts \
-  "$IMG,x-dirty-bitmap=qemu:dirty-bitmap:b" | _filter_qemu_img_map
+  "$IMG,x-dirty-bitmap=qemu:dirty-bitmap:n" | _filter_qemu_img_map
 
-nbd_server_start_unix_socket -f $IMGFMT -B b2 "$TEST_IMG"
-IMG="driver=nbd,server.type=unix,server.path=$nbd_unix_socket"
+nbd_server_start_unix_socket -f $IMGFMT -x n -B b2 "$TEST_IMG"
+IMG="driver=nbd,export=n,server.type=unix,server.path=$nbd_unix_socket"
   $QEMU_IMG map --output=json --image-opts \
-  "$IMG,x-dirty-bitmap=qemu:dirty-bitmap:b2" | _filter_qemu_img_map
+  "$IMG,x-dirty-bitmap=qemu:dirty-bitmap:n" | _filter_qemu_img_map
 
   # success, all done
   echo '*** done'
tests/qemu-iotests/223.out +3 -3
index f175598802..9f879add60 100644
@@ -61,7 +61,7 @@ exports available: 2
     max block: 33554432
     available meta contexts: 2
      base:allocation
-   qemu:dirty-bitmap:b
+   qemu:dirty-bitmap:n
    export: 'n2'
     size:  4194304
     flags: 0xced ( flush fua trim zeroes df cache fast-zero )
@@ -70,7 +70,7 @@ exports available: 2
     max block: 33554432
     available meta contexts: 2
      base:allocation
-   qemu:dirty-bitmap:b2
+   qemu:dirty-bitmap:n2
 
   === Contrast normal status to large granularity dirty-bitmap ===
 
@@ -141,7 +141,7 @@ exports available: 2
     max block: 33554432
     available meta contexts: 2
      base:allocation
-   qemu:dirty-bitmap:b
+   qemu:dirty-bitmap:n
    export: 'n2'
     size:  4194304
     flags: 0xced ( flush fua trim zeroes df cache fast-zero )

tests/qemu-iotests/223.out exports available: 2 · line 156

Quoted 8 lines
tests/qemu-iotests/223.out +1 -1
@@ -150,7 +150,7 @@ exports available: 2
     max block: 33554432
     available meta contexts: 2
      base:allocation
-   qemu:dirty-bitmap:b2
+   qemu:dirty-bitmap:n2
 
   === Contrast normal status to large granularity dirty-bitmap ===
 

--
Best regards,
Vladimir

Signature · 2 lines
Best regards,
Vladimir