|
|
538efe |
From 2a3e909e9e1ccb608bde75b76524acd753b33889 Mon Sep 17 00:00:00 2001
|
|
|
538efe |
From: "Richard W.M. Jones" <rjones@redhat.com>
|
|
|
538efe |
Date: Sat, 25 Jan 2020 11:38:14 +0000
|
|
|
538efe |
Subject: [PATCH 12/19] extentlist: Documentation and test fixes.
|
|
|
538efe |
|
|
|
538efe |
Updates commit 3e770b6d6620a62546849a2863638041c0b00640.
|
|
|
538efe |
|
|
|
538efe |
(cherry picked from commit c16709ef663a5ed9fd9ddef4e379f316d84c9a07)
|
|
|
538efe |
---
|
|
|
538efe |
TODO | 12 +++++++----
|
|
|
538efe |
.../extentlist/nbdkit-extentlist-filter.pod | 21 +++++++++++++------
|
|
|
538efe |
plugins/curl/nbdkit-curl-plugin.pod | 1 +
|
|
|
538efe |
plugins/ssh/nbdkit-ssh-plugin.pod | 1 +
|
|
|
538efe |
tests/test-extentlist.sh | 2 +-
|
|
|
538efe |
5 files changed, 26 insertions(+), 11 deletions(-)
|
|
|
538efe |
|
|
|
538efe |
diff --git a/TODO b/TODO
|
|
|
538efe |
index 2a3e89dc..e1ac71cd 100644
|
|
|
538efe |
--- a/TODO
|
|
|
538efe |
+++ b/TODO
|
|
|
538efe |
@@ -187,10 +187,6 @@ Suggestions for filters
|
|
|
538efe |
MBs of extra data)
|
|
|
538efe |
https://github.com/facebook/zstd/issues/395#issuecomment-535875379
|
|
|
538efe |
|
|
|
538efe |
-* nbdkit-extentlist-filter could read the extents generated by
|
|
|
538efe |
- qemu-img map, allowing extents to be ported from a qemu block
|
|
|
538efe |
- device.
|
|
|
538efe |
-
|
|
|
538efe |
nbdkit-rate-filter:
|
|
|
538efe |
|
|
|
538efe |
* allow other kinds of traffic shaping such as VBR
|
|
|
538efe |
@@ -216,6 +212,14 @@ nbdkit-retry-filter:
|
|
|
538efe |
|
|
|
538efe |
* subsecond times
|
|
|
538efe |
|
|
|
538efe |
+nbdkit-extentlist-filter:
|
|
|
538efe |
+
|
|
|
538efe |
+* read the extents generated by qemu-img map, allowing extents to be
|
|
|
538efe |
+ ported from a qemu block device
|
|
|
538efe |
+
|
|
|
538efe |
+* make non-read-only access safe by updating the extent list when the
|
|
|
538efe |
+ filter sees writes and trims
|
|
|
538efe |
+
|
|
|
538efe |
Filters for security
|
|
|
538efe |
--------------------
|
|
|
538efe |
|
|
|
538efe |
diff --git a/filters/extentlist/nbdkit-extentlist-filter.pod b/filters/extentlist/nbdkit-extentlist-filter.pod
|
|
|
538efe |
index adfb4ad8..5d1a38ae 100644
|
|
|
538efe |
--- a/filters/extentlist/nbdkit-extentlist-filter.pod
|
|
|
538efe |
+++ b/filters/extentlist/nbdkit-extentlist-filter.pod
|
|
|
538efe |
@@ -4,7 +4,7 @@ nbdkit-extentlist-filter - place extent list over a plugin
|
|
|
538efe |
|
|
|
538efe |
=head1 SYNOPSIS
|
|
|
538efe |
|
|
|
538efe |
- nbdkit --filter=extentlist plugin extentlist=FILENAME
|
|
|
538efe |
+ nbdkit -r --filter=extentlist plugin extentlist=FILENAME
|
|
|
538efe |
|
|
|
538efe |
=head1 DESCRIPTION
|
|
|
538efe |
|
|
|
538efe |
@@ -13,11 +13,20 @@ static list of extents on top of an existing plugin. Extents record
|
|
|
538efe |
whether or not specific parts of the disk are allocated or sparse.
|
|
|
538efe |
|
|
|
538efe |
You can use this with plugins which cannot get extent information
|
|
|
538efe |
-themselves, but you can get this information from another source. One
|
|
|
538efe |
-place where it is useful is with L<nbdkit-ssh-plugin(1)> because the
|
|
|
538efe |
-sftp protocol does not support reading sparseness information, but you
|
|
|
538efe |
-may be able to get this information directly from the source disk on
|
|
|
538efe |
-the remote server.
|
|
|
538efe |
+themselves, but where you can get this information from another
|
|
|
538efe |
+source. One place where it is useful is with L<nbdkit-ssh-plugin(1)>
|
|
|
538efe |
+because the sftp protocol does not support reading sparseness
|
|
|
538efe |
+information, but you may be able to get this information directly from
|
|
|
538efe |
+the source disk on the remote server using commands such as
|
|
|
538efe |
+L<xfs_bmap(8)>. A similar situation applies to
|
|
|
538efe |
+L<nbdkit-curl-plugin(1)>.
|
|
|
538efe |
+
|
|
|
538efe |
+Note that the extent list is read-only. This filter does not monitor
|
|
|
538efe |
+writes and trims in order to update the extent list. What can happen
|
|
|
538efe |
+is that you would write to a “hole” in the disk, but would not be able
|
|
|
538efe |
+to read it back because the NBD client would still think that part of
|
|
|
538efe |
+the disk is a hole. So it is generally only safe to use this filter
|
|
|
538efe |
+in read-only mode (I<-r> option).
|
|
|
538efe |
|
|
|
538efe |
=head1 FILE FORMAT
|
|
|
538efe |
|
|
|
538efe |
diff --git a/plugins/curl/nbdkit-curl-plugin.pod b/plugins/curl/nbdkit-curl-plugin.pod
|
|
|
538efe |
index 827e0bd1..d3c85248 100644
|
|
|
538efe |
--- a/plugins/curl/nbdkit-curl-plugin.pod
|
|
|
538efe |
+++ b/plugins/curl/nbdkit-curl-plugin.pod
|
|
|
538efe |
@@ -182,6 +182,7 @@ L<libcurl(3)>,
|
|
|
538efe |
L<CURLOPT_COOKIE(3)>
|
|
|
538efe |
L<CURLOPT_VERBOSE(3)>,
|
|
|
538efe |
L<nbdkit(1)>,
|
|
|
538efe |
+L<nbdkit-extentlist-filter(1)>,
|
|
|
538efe |
L<nbdkit-readahead-filter(1)>,
|
|
|
538efe |
L<nbdkit-retry-filter(1)>,
|
|
|
538efe |
L<nbdkit-ssh-plugin(1)>,
|
|
|
538efe |
diff --git a/plugins/ssh/nbdkit-ssh-plugin.pod b/plugins/ssh/nbdkit-ssh-plugin.pod
|
|
|
538efe |
index 0a0421d5..3fc3146a 100644
|
|
|
538efe |
--- a/plugins/ssh/nbdkit-ssh-plugin.pod
|
|
|
538efe |
+++ b/plugins/ssh/nbdkit-ssh-plugin.pod
|
|
|
538efe |
@@ -316,6 +316,7 @@ C<nbdkit-ssh-plugin> first appeared in nbdkit 1.12.
|
|
|
538efe |
|
|
|
538efe |
L<nbdkit(1)>,
|
|
|
538efe |
L<nbdkit-curl-plugin(1)>,
|
|
|
538efe |
+L<nbdkit-extentlist-filter(1)>,
|
|
|
538efe |
L<nbdkit-readahead-filter(1)>,
|
|
|
538efe |
L<nbdkit-retry-filter(1)>,
|
|
|
538efe |
L<nbdkit-plugin(3)>,
|
|
|
538efe |
diff --git a/tests/test-extentlist.sh b/tests/test-extentlist.sh
|
|
|
538efe |
index 7d05de4f..73ce3ca6 100755
|
|
|
538efe |
--- a/tests/test-extentlist.sh
|
|
|
538efe |
+++ b/tests/test-extentlist.sh
|
|
|
538efe |
@@ -50,7 +50,7 @@ cleanup_fn rm $files
|
|
|
538efe |
test ()
|
|
|
538efe |
{
|
|
|
538efe |
nbdkit -v -D extentlist.lookup=1 \
|
|
|
538efe |
- -U - \
|
|
|
538efe |
+ -r -U - \
|
|
|
538efe |
--filter=extentlist \
|
|
|
538efe |
null size=$1 extentlist=$input \
|
|
|
538efe |
--run 'qemu-img map -f raw --output=json $nbd' |
|
|
|
538efe |
--
|
|
|
538efe |
2.18.2
|
|
|
538efe |
|