[v2v PATCH] output_qemu: pass "=on" with "readonly" to "-drive"
by Laszlo Ersek
> qemu-system-x86_64: -drive
> if=pflash,format=raw,file=/usr/share/OVMF/OVMF_CODE.fd,readonly: warning:
> short-form boolean option 'readonly' deprecated
> Please use readonly=on instead
Reported-by: Ming Xie <mxie(a)redhat.com>
Signed-off-by: Laszlo Ersek <lersek(a)redhat.com>
---
output/output_qemu.ml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/output/output_qemu.ml b/output/output_qemu.ml
index 29adcba901a3..3269fba501e4 100644
--- a/output/output_qemu.ml
+++ b/output/output_qemu.ml
@@ -164,7 +164,7 @@ module QEMU = struct
arg_list "-global"
["driver=cfi.pflash01"; "property=secure"; "value=on"];
arg_list "-drive"
- ["if=pflash"; "format=raw"; "file=" ^ code; "readonly"];
+ ["if=pflash"; "format=raw"; "file=" ^ code; "readonly=on"];
arg_noquote "-drive" "if=pflash,format=raw,file=\"$uefi_vars\"";
);
base-commit: 03c7f0561081ca5c9fce8a89191a230c5f1add23
--
2.19.1.3.g30247aa5d201
2 years, 5 months
building guestfs-tools
by Simon Walter
Hi all,
I want to understand the build process for guestfs-tools a bit better. I
read that it was split out to a different repo/project. I do not want to
build and test any OCaml tools. However, passing --disable-ocaml does
not do that. Is OCaml a requirement for building any and/or all
guestfs-tools?
I've submitted an issue report
(https://github.com/rwmjones/guestfs-tools/issues/8).
Any feedback is appreciated. Thanks!
Simon
--
Simon Walter
QE
Red Hat
4054 7C3F 4817 CB8B E9C3 DC89 2B68 3438 41D4 8F76
2 years, 5 months
nbdkit error: "write reply: NBD_CMD_WRITE: Broken pipe"
by Nikolaus Rath
Hi,
I am developing a new nbdkit plugin, and occasionally I am getting errors like this:
`nbdkit: s3backer.8: error: write reply: NBD_CMD_WRITE: Broken pipe
nbdkit: s3backer.15: error: write reply: NBD_CMD_WRITE: Broken pipe`
(where "s3backer" is the plugin name).
I am not sure what to make of these. Can someone advise?
Looking at the nbdkit source, it looks to me like these are generated when there is a problem sending a reply to the nbd client. On the other hand, I am using the standard 'nbd-client' program through a Unix socket, so I'd think this should not result in errors...?
Best,
-Nikolaus
--
GPG Fingerprint: ED31 791B 2C5C 1613 AF38 8B8A D113 FCAC 3C4E 599F
»Time flies like an arrow, fruit flies like a Banana.«
2 years, 5 months
nbdkit worker thread shutdown
by Nikolaus Rath
Hello,
When nbdkit calls a plugin's unload() method, is it guaranteed that all
pending requests have been handled (and all worker threads exited)?
(I would have expected this to be the case, but I'm getting errors from
threads accessing data that my unload() handler frees, so I wanted to
confirm my assumption).
Best,
-Nikolaus
--
GPG Fingerprint: ED31 791B 2C5C 1613 AF38 8B8A D113 FCAC 3C4E 599F
»Time flies like an arrow, fruit flies like a Banana.«
2 years, 5 months
[libguestfs PATCH 0/4] ignore "iface" in "add-drive" variants
by Laszlo Ersek
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1844341
The "iface" parameter of the various "add-drive" actions has never been
functional: the libvirt backend has always rejected a non-empty "iface",
and the direct backend has never handled it correctly. The parameter
itself is not useful for anything really, so let's just remove all the
logic related to it, beyond keeping the API compatible. Update the docs
as well.
Thanks,
Laszlo
Laszlo Ersek (4):
lib: launch-direct: ignore drive "iface" parameter
lib: drive_create_data, drive: remove field "iface"
lib: rename VALID_FORMAT_IFACE to VALID_FORMAT
tests/regressions: remove "iface"-based restrictions
generator/actions_core_deprecated.ml | 6 +-
lib/drives.c | 35 +++---------
lib/guestfs-internal.h | 1 -
lib/launch-direct.c | 59 +++++---------------
lib/launch-libvirt.c | 6 --
lib/libvirt-domain.c | 15 -----
lib/unit-tests.c | 16 +++---
tests/regressions/rhbz690819.sh | 10 +---
tests/regressions/rhbz975797.sh | 10 +---
9 files changed, 38 insertions(+), 120 deletions(-)
base-commit: 4864d21cb8eb991f0fc98d03a068173837cba50e
--
2.19.1.3.g30247aa5d201
2 years, 5 months
nbdkit: how to require use of filter
by Nikolaus Rath
Hi,
Is there a way for a nbdkit plugin to *require* use of a nbdkit filter
(specifically the nbdkit-blocksize-filter) programmatically?
Thanks!
-Nikolaus
--
GPG Fingerprint: ED31 791B 2C5C 1613 AF38 8B8A D113 FCAC 3C4E 599F
»Time flies like an arrow, fruit flies like a Banana.«
2 years, 6 months
[libguestfs PATCH 0/2] lift protocol limit on guestfs_readdir()
by Laszlo Ersek
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1674392
Remove the GUESTFS_MESSAGE_MAX protocol limit from the last remaining
"high-profile" API, guestfs_readdir().
A fast reproducer is in
<https://bugzilla.redhat.com/show_bug.cgi?id=1674392#c27>.
Thanks
Laszlo
Laszlo Ersek (2):
guestfs_readdir(): rewrite with FileOut transfer, to lift protocol
limit
guestfs_readdir(): minimize the number of send_file_write() calls
TODO | 8 -
daemon/readdir.c | 156 ++++++++++++--------
generator/actions_core.ml | 127 ++++++++--------
generator/proc_nr.ml | 2 +-
lib/Makefile.am | 1 +
lib/readdir.c | 131 ++++++++++++++++
6 files changed, 291 insertions(+), 134 deletions(-)
create mode 100644 lib/readdir.c
base-commit: 0956e8e0c5b70e79a01f43046ac7be2b9a171ed8
--
2.19.1.3.g30247aa5d201
2 years, 6 months
[PATCH v3] New API: guestfs_device_name returning the drive name
by Richard W.M. Jones
For each drive added, return the name. For example calling this with
index 0 will return the string "/dev/sda". I called it
guestfs_device_name (not drive_name) for consistency with the existing
guestfs_device_index function.
You don't really need to call this function. You can follow the
advice here:
https://libguestfs.org/guestfs.3.html#block-device-naming
and assume that drives are added with predictable names like
"/dev/sda", "/dev/sdb", etc.
However it's useful to expose the internal guestfs_int_drive_name
function since especially handling names beyond index 26 is tricky
(https://rwmj.wordpress.com/2011/01/09/how-are-linux-drives-named-beyond-d...)
Fixes: https://github.com/libguestfs/libguestfs/issues/80
---
generator/actions_core.ml | 24 +++++++++++++++++++++++-
lib/drives.c | 15 +++++++++++++++
2 files changed, 38 insertions(+), 1 deletion(-)
diff --git a/generator/actions_core.ml b/generator/actions_core.ml
index ce9ee39cca..dc12fdc33e 100644
--- a/generator/actions_core.ml
+++ b/generator/actions_core.ml
@@ -737,7 +737,29 @@ returns the index of the device in the list of devices.
Index numbers start from 0. The named device must exist,
for example as a string returned from C<guestfs_list_devices>.
-See also C<guestfs_list_devices>, C<guestfs_part_to_dev>." };
+See also C<guestfs_list_devices>, C<guestfs_part_to_dev>,
+C<guestfs_device_name>." };
+
+ { defaults with
+ name = "device_name"; added = (1, 49, 1);
+ style = RString (RPlainString, "name"), [Int "index"], [];
+ tests = [
+ InitEmpty, Always, TestResult (
+ [["device_name"; "0"]], "STREQ (ret, \"/dev/sda\")"), [];
+ InitEmpty, Always, TestResult (
+ [["device_name"; "1"]], "STREQ (ret, \"/dev/sdb\")"), [];
+ InitEmpty, Always, TestLastFail (
+ [["device_name"; "99"]]), []
+ ];
+ shortdesc = "convert device index to name";
+ longdesc = "\
+This function takes a device index and returns the device
+name. For example index C<0> will return the string C</dev/sda>.
+
+The drive index must have been added to the handle.
+
+See also C<guestfs_list_devices>, C<guestfs_part_to_dev>,
+C<guestfs_device_index>." };
{ defaults with
name = "shutdown"; added = (1, 19, 16);
diff --git a/lib/drives.c b/lib/drives.c
index fd95308d2d..a6179fc367 100644
--- a/lib/drives.c
+++ b/lib/drives.c
@@ -31,6 +31,7 @@
#include <netdb.h>
#include <arpa/inet.h>
#include <assert.h>
+#include <errno.h>
#include <libintl.h>
#include "c-ctype.h"
@@ -1084,3 +1085,17 @@ guestfs_impl_device_index (guestfs_h *g, const char *device)
error (g, _("%s: device not found"), device);
return r;
}
+
+char *
+guestfs_impl_device_name (guestfs_h *g, int index)
+{
+ char drive_name[64];
+
+ if (index < 0 || index >= g->nr_drives) {
+ guestfs_int_error_errno (g, EINVAL, _("drive index out of range"));
+ return NULL;
+ }
+
+ guestfs_int_drive_name (index, drive_name);
+ return safe_asprintf (g, "/dev/sd%s", drive_name);
+}
--
2.35.1
2 years, 6 months