---
docs/nbdkit.pod | 8 ++++----
filters/cow/nbdkit-cow-filter.pod | 2 +-
plugins/xz/nbdkit-xz-plugin.pod | 7 ++++++-
plugins/xz/xz.c | 3 ++-
tests/test-xz.c | 2 +-
5 files changed, 14 insertions(+), 8 deletions(-)
diff --git a/docs/nbdkit.pod b/docs/nbdkit.pod
index cf1c5ca..d650283 100644
--- a/docs/nbdkit.pod
+++ b/docs/nbdkit.pod
@@ -75,7 +75,7 @@ Serve only the first partition from compressed disk image
F<disk.img.xz>, combining L<nbdkit-xz-plugin(1)> and
L<nbdkit-partition-filter(1)>:
- nbdkit --filter=partition xz file=disk.img.xz partition=1
+ nbdkit --filter=partition xz disk.img.xz partition=1
To understand this command line:
@@ -83,9 +83,9 @@ To understand this command line:
│
┌─────┴────┐
│ │
- nbdkit --filter=partition xz file=disk.img.xz partition=1
- │ │
- └───────────────┬───────────────────┘
+ nbdkit --filter=partition xz disk.img.xz partition=1
+ │ │
+ └─────────────┬─────────────────┘
│
filter name and filter parameter
diff --git a/filters/cow/nbdkit-cow-filter.pod b/filters/cow/nbdkit-cow-filter.pod
index 80100e7..d5cd735 100644
--- a/filters/cow/nbdkit-cow-filter.pod
+++ b/filters/cow/nbdkit-cow-filter.pod
@@ -65,7 +65,7 @@ L<nbdkit-xz-plugin(1)> only supports read access, but you can
provide
temporary write access by doing (although this does B<not> save
changes to the file):
- nbdkit --filter=cow xz file=disk.xz
+ nbdkit --filter=cow xz disk.xz
=head1 CREATING A DIFF WITH QEMU-IMG
diff --git a/plugins/xz/nbdkit-xz-plugin.pod b/plugins/xz/nbdkit-xz-plugin.pod
index 2c9ab6e..2bd0a1c 100644
--- a/plugins/xz/nbdkit-xz-plugin.pod
+++ b/plugins/xz/nbdkit-xz-plugin.pod
@@ -4,7 +4,7 @@ nbdkit-xz-plugin - nbdkit xz plugin
=head1 SYNOPSIS
- nbdkit xz file=FILENAME.xz
+ nbdkit xz [file=]FILENAME.xz
=head1 DESCRIPTION
@@ -59,6 +59,11 @@ Serve the file named C<FILENAME.xz>.
This parameter is required.
+In nbdkit E<ge> 1.8, C<file=> may be omitted. To ensure that the
+filename does not end up being parsed accidentally as C<key=value>,
+prefix relative paths with C<./> (absolute paths do not need
+modification).
+
=item B<maxblock=>SIZE
The maximum block size that the plugin will read. The plugin will
diff --git a/plugins/xz/xz.c b/plugins/xz/xz.c
index f45e489..a88d713 100644
--- a/plugins/xz/xz.c
+++ b/plugins/xz/xz.c
@@ -1,5 +1,5 @@
/* nbdkit
- * Copyright (C) 2013 Red Hat Inc.
+ * Copyright (C) 2013-2018 Red Hat Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -250,6 +250,7 @@ static struct nbdkit_plugin plugin = {
.config = xz_config,
.config_complete = xz_config_complete,
.config_help = xz_config_help,
+ .magic_config_key = "file",
.open = xz_open,
.close = xz_close,
.get_size = xz_get_size,
diff --git a/tests/test-xz.c b/tests/test-xz.c
index ef58d59..46b1d04 100644
--- a/tests/test-xz.c
+++ b/tests/test-xz.c
@@ -51,7 +51,7 @@ main (int argc, char *argv[])
int r;
char *data;
- if (test_start_nbdkit ("xz", "-r", "file=disk.xz", NULL)
== -1)
+ if (test_start_nbdkit ("xz", "-r", "disk.xz", NULL) ==
-1)
exit (EXIT_FAILURE);
g = guestfs_create ();
--
2.18.0