Re: [Libguestfs] Windows v2v
by Richard W.M. Jones
So assuming the answer to the previous question was _yes_ ...
Then there are various ways to force a full shutdown either one-off or
permanently. Can you work out what works and submit a documentation
patch to improve things for Windows >= 8?
(1) Try this command: shutdown /s /t 0
Because the /hybrid option is not present it should force a full shutdown.
(2) From the GUI use [Shift] + shutdown option:
(https://blogs.technet.microsoft.com/askperf/2012/10/25/windows-8-windows-...)
For permanently disabling hibernation:
(3) Use: powercfg /hibernate off
(4) Use: reg add "HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Power" /v HiberbootEnabled /t REG_DWORD /d "0" /f
(3) & (4) might be equivalent, I'm not very clear and don't have a
convenient way to test right now.
Rich.
--
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
Read my programming and virtualization blog: http://rwmj.wordpress.com
virt-df lists disk usage of guests without needing to install any
software inside the virtual machine. Supports Linux and Windows.
http://people.redhat.com/~rjones/virt-df/
6 years, 7 months
[PATCH] v2v: Give better diagnostics if filesystem falls back to read-only (RHBZ#1567763).
by Richard W.M. Jones
Some filesystems fall back silently to read-only if there are problems
such a dirty filesystem and an unrecoverable journal. Almost all
conversions involve writing to the root filesystem, so these will
inevitably fail later on with a strange error message.
Test the root filesystem is writable by creating and deleting a
temporary file, and if the creation fails then give better
diagnostics.
Reported-by: Piotr Kliczewski
---
generator/OCaml.ml | 1 +
v2v/inspect_source.ml | 37 +++++++++++++++++++++++++++----------
2 files changed, 28 insertions(+), 10 deletions(-)
diff --git a/generator/OCaml.ml b/generator/OCaml.ml
index e58f387cc..467a1f0d8 100644
--- a/generator/OCaml.ml
+++ b/generator/OCaml.ml
@@ -40,6 +40,7 @@ let ocaml_errnos = [
"EPERM";
"ESRCH";
"ENOENT";
+ "EROFS";
]
(* Generate the OCaml bindings interface. *)
diff --git a/v2v/inspect_source.ml b/v2v/inspect_source.ml
index bd382cb11..c1a7e5737 100644
--- a/v2v/inspect_source.ml
+++ b/v2v/inspect_source.ml
@@ -41,16 +41,33 @@ let rec inspect_source root_choice g =
let mps = List.sort cmp mps in
List.iter (
fun (mp, dev) ->
- try g#mount dev mp
- with G.Error msg ->
- if mp = "/" then ( (* RHBZ#1145995 *)
- if String.find msg "Windows" >= 0 && String.find msg "NTFS partition is in an unsafe state" >= 0 then
- error (f_"unable to mount the disk image for writing. This has probably happened because Windows Hibernation or Fast Restart is being used in this guest. You have to disable this (in the guest) in order to use virt-v2v.\n\nOriginal error message: %s") msg
- else
- error "%s" msg
- )
- else
- warning (f_"%s (ignored)") msg
+ (try g#mount dev mp
+ with G.Error msg ->
+ if mp = "/" then ( (* RHBZ#1145995 *)
+ if String.find msg "Windows" >= 0 && String.find msg "NTFS partition is in an unsafe state" >= 0 then
+ error (f_"unable to mount the disk image for writing. This has probably happened because Windows Hibernation or Fast Restart is being used in this guest. You have to disable this (in the guest) in order to use virt-v2v.\n\nOriginal error message: %s") msg
+ else
+ error "%s" msg
+ )
+ else
+ warning (f_"%s (ignored)") msg
+ );
+
+ (* Some filesystems (hello, ntfs-3g) can silently fall back to
+ * a read-only mount. Check the root filesystem is really writable.
+ * RHBZ#1567763
+ *)
+ if mp = "/" then (
+ let file = sprintf "/%s" (String.random8 ()) in
+ (try g#touch file
+ with G.Error msg ->
+ if g#last_errno () = G.Errno.errno_EROFS then
+ error (f_"filesystem was mounted read-only, even though we asked for it to be mounted read-write. This usually means that the filesystem was not cleanly unmounted. Possible causes include trying to convert a guest which is running, or using Windows Hibernation or Fast Restart.\n\nOriginal error message: %s") msg
+ else
+ error (f_"could not write to the guest filesystem: %s") msg
+ );
+ g#rm file
+ )
) mps;
(* Get list of applications/packages installed. *)
--
2.16.2
6 years, 7 months
[PATCH 0/2] Support for expanding f2fs partitions
by Pino Toscano
Hi,
this small patch series exposes one of the utility in f2fs-tools, and
use it to expand f2fs partitions in virt-resize.
Thanks,
Pino Toscano (2):
New API: f2fs_expand
resize: expand f2fs partitions
daemon/Makefile.am | 1 +
daemon/f2fs.c | 49 +++++++++++++++++++++++++++++++++++++++++++++++
generator/actions_core.ml | 9 +++++++++
generator/proc_nr.ml | 1 +
lib/MAX_PROC_NR | 2 +-
resize/resize.ml | 12 ++++++++++--
6 files changed, 71 insertions(+), 3 deletions(-)
create mode 100644 daemon/f2fs.c
--
2.14.3
6 years, 7 months
v2v: -o rhv-upload: Long time spent zeroing the disk
by Richard W.M. Jones
We now have true zeroing support in oVirt imageio, thanks for that.
However a problem is that ‘qemu-img convert’ issues zero requests for
the whole disk before starting the transfer. It does this using 32 MB
requests which take approx. 1 second each to execute on the oVirt side.
Two problems therefore:
(1) Zeroing the disk can take a long time (eg. 40 GB is approx.
20 minutes). Furthermore there is no progress indication while this
is happening.
Nothing bad happens: because it is making frequent requests there
is no timeout.
(2) I suspect that because we don't have trim support that this is
actually causing the disk to get fully allocated on the target.
The NBD requests are sent with may_trim=1 so we could turn these
into trim requests, but obviously cannot do that while there is no
trim support.
Note that this is (sort of) a regression over previous versions of the
‘-o rhv-upload’ patch since the old code ignored some zero requests.
I'm not sure what to do about this. Possibly we could fix the
progress bar issue in qemu. It's also possible we could do something
in nbdkit such as having is signal back that "stuff is being done" and
turn that into some indication in virt-v2v.
Anyway it's something to be aware of, in case you try out the
forthcoming virt-v2v rhvpreview and it appears to sit at 0/100% "doing
nothing" for a long time.
Rich.
--
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
Read my programming and virtualization blog: http://rwmj.wordpress.com
virt-top is 'top' for virtual machines. Tiny program with many
powerful monitoring features, net stats, disk stats, logging, etc.
http://people.redhat.com/~rjones/virt-top
6 years, 7 months
[PATCH] Fix out-of-tree builds of OCaml components
by Hilko Bengen
- Add $(srcdir), $(builddir) to Makefiles where required
- Post-process ocamldep output
- generate ocaml/.depends
---
builder/Makefile.am | 7 ++++---
common/mlgettext/Makefile.am | 2 +-
common/mlpcre/Makefile.am | 2 +-
common/mlprogress/Makefile.am | 2 +-
common/mlstdutils/Makefile.am | 2 +-
common/mltools/Makefile.am | 2 +-
common/mlutils/Makefile.am | 2 +-
common/mlvisit/Makefile.am | 2 +-
common/mlxml/Makefile.am | 2 +-
customize/Makefile.am | 2 +-
daemon/Makefile.am | 10 +++++-----
generator/Makefile.am | 2 +-
get-kernel/Makefile.am | 2 +-
ocaml-dep.sh.in | 18 ++++++++++++++++--
ocaml/Makefile.am | 3 +--
resize/Makefile.am | 2 +-
sparsify/Makefile.am | 2 +-
subdir-rules.mk | 6 +++---
v2v/Makefile.am | 2 +-
v2v/test-harness/Makefile.am | 2 +-
20 files changed, 44 insertions(+), 30 deletions(-)
diff --git a/builder/Makefile.am b/builder/Makefile.am
index a17a2aa6d6..c7b50778a1 100644
--- a/builder/Makefile.am
+++ b/builder/Makefile.am
@@ -142,11 +142,12 @@ bin_PROGRAMS += virt-builder virt-builder-repository
virt_builder_SOURCES = $(SOURCES_C)
virt_builder_CPPFLAGS = \
- -I. \
+ -I$(builddir) -I$(srcdir) \
-I$(top_builddir) \
-I$(top_srcdir)/gnulib/lib -I$(top_builddir)/gnulib/lib \
-I$(shell $(OCAMLC) -where) \
-I$(top_srcdir)/gnulib/lib \
+ -I$(top_builddir)/common/utils \
-I$(top_srcdir)/common/utils \
-I$(top_srcdir)/lib
virt_builder_CFLAGS = \
@@ -163,7 +164,7 @@ XOBJECTS = $(BOBJECTS:.cmo=.cmx)
virt_builder_repository_SOURCES = $(REPOSITORY_SOURCES_C)
virt_builder_repository_CPPFLAGS = \
- -I. \
+ -I$(builddir) -I$(srcdir) \
-I$(top_builddir) \
-I$(top_srcdir)/gnulib/lib -I$(top_builddir)/gnulib/lib \
-I$(shell $(OCAMLC) -where) \
@@ -446,7 +447,7 @@ CLEANFILES += \
console-*.out
# OCaml dependencies.
-.depend: *.mli *.ml osinfo_config.mli osinfo_config.ml
+.depend: $(srcdir)/*.mli $(srcdir)/*.ml osinfo_config.mli osinfo_config.ml
$(top_builddir)/ocaml-dep.sh $^
-include .depend
diff --git a/common/mlgettext/Makefile.am b/common/mlgettext/Makefile.am
index 4cca6b4db0..cdcea33ec5 100644
--- a/common/mlgettext/Makefile.am
+++ b/common/mlgettext/Makefile.am
@@ -79,7 +79,7 @@ mlgettext.cmxa: $(XOBJECTS)
endif
# Dependencies.
-.depend: *.mli *.ml
+.depend: $(srcdir)/*.mli $(srcdir)/*.ml
$(top_builddir)/ocaml-dep.sh $^
-include .depend
diff --git a/common/mlpcre/Makefile.am b/common/mlpcre/Makefile.am
index 4ff74cf972..f9699f5922 100644
--- a/common/mlpcre/Makefile.am
+++ b/common/mlpcre/Makefile.am
@@ -122,7 +122,7 @@ check-valgrind:
$(MAKE) VG="@VG@" check
# Dependencies.
-.depend: *.mli *.ml
+.depend: $(srcdir)/*.mli $(srcdir)/*.ml
$(top_builddir)/ocaml-dep.sh $^
-include .depend
diff --git a/common/mlprogress/Makefile.am b/common/mlprogress/Makefile.am
index f031a5a69e..be88ef2dee 100644
--- a/common/mlprogress/Makefile.am
+++ b/common/mlprogress/Makefile.am
@@ -93,7 +93,7 @@ $(MLPROGRESS_CMA): $(OBJECTS) libmlprogress.a
-o mlprogress
# OCaml dependencies.
-.depend: *.mli *.ml
+.depend: $(srcdir)/*.mli $(srcdir)/*.ml
$(top_builddir)/ocaml-dep.sh $^
-include .depend
diff --git a/common/mlstdutils/Makefile.am b/common/mlstdutils/Makefile.am
index cc05c5a73f..e38230db8a 100644
--- a/common/mlstdutils/Makefile.am
+++ b/common/mlstdutils/Makefile.am
@@ -141,7 +141,7 @@ check-valgrind:
$(MAKE) VG="@VG@" check
# OCaml dependencies.
-.depend: *.mli *.ml
+.depend: $(srcdir)/*.mli $(srcdir)/*.ml
$(top_builddir)/ocaml-dep.sh $^
-include .depend
diff --git a/common/mltools/Makefile.am b/common/mltools/Makefile.am
index 2ea1fee8ff..66b18f5ded 100644
--- a/common/mltools/Makefile.am
+++ b/common/mltools/Makefile.am
@@ -253,7 +253,7 @@ check-valgrind:
$(MAKE) VG="@VG@" check
# Dependencies.
-.depend: *.mli *.ml
+.depend: $(srcdir)/*.mli $(srcdir)/*.ml
$(top_builddir)/ocaml-dep.sh $^
-include .depend
diff --git a/common/mlutils/Makefile.am b/common/mlutils/Makefile.am
index 33d742f4c3..8627e5b10c 100644
--- a/common/mlutils/Makefile.am
+++ b/common/mlutils/Makefile.am
@@ -135,7 +135,7 @@ c_utils_unit_tests_LINK = \
$(c_utils_unit_tests_THEOBJECTS) -o $@
# Dependencies.
-.depend: *.mli *.ml
+.depend: $(srcdir)/*.mli $(srcdir)/*.ml
$(top_builddir)/ocaml-dep.sh $^
-include .depend
diff --git a/common/mlvisit/Makefile.am b/common/mlvisit/Makefile.am
index 6902c9a2a9..add1fe56e8 100644
--- a/common/mlvisit/Makefile.am
+++ b/common/mlvisit/Makefile.am
@@ -139,7 +139,7 @@ check-valgrind:
$(MAKE) VG="@VG@" check
# OCaml dependencies.
-.depend: *.mli *.ml
+.depend: $(srcdir)/*.mli $(srcdir)/*.ml
$(top_builddir)/ocaml-dep.sh $^
-include .depend
diff --git a/common/mlxml/Makefile.am b/common/mlxml/Makefile.am
index 083c7a64be..eab036b82f 100644
--- a/common/mlxml/Makefile.am
+++ b/common/mlxml/Makefile.am
@@ -88,7 +88,7 @@ $(MLXML_CMA): $(OBJECTS) libmlxml.a
-o mlxml
# Dependencies.
-.depend: *.mli *.ml
+.depend: $(srcdir)/*.mli $(srcdir)/*.ml
$(top_builddir)/ocaml-dep.sh $^
-include .depend
diff --git a/customize/Makefile.am b/customize/Makefile.am
index 7f18b2fc34..efdd272275 100644
--- a/customize/Makefile.am
+++ b/customize/Makefile.am
@@ -312,7 +312,7 @@ CLEANFILES += \
settings-*.img
# OCaml dependencies.
-.depend: *.mli *.ml
+.depend: $(srcdir)/*.mli $(srcdir)/*.ml
$(top_builddir)/ocaml-dep.sh $^
-include .depend
diff --git a/daemon/Makefile.am b/daemon/Makefile.am
index 9dbd375f5d..506c880297 100644
--- a/daemon/Makefile.am
+++ b/daemon/Makefile.am
@@ -318,11 +318,11 @@ XOBJECTS = $(BOBJECTS:.cmo=.cmx)
OCAMLPACKAGES = \
-package str,unix,hivex \
- -I $(top_srcdir)/common/mlaugeas \
- -I $(top_srcdir)/common/mlstdutils \
- -I $(top_srcdir)/common/mlutils \
+ -I $(top_builddir)/common/mlaugeas \
+ -I $(top_builddir)/common/mlstdutils \
+ -I $(top_builddir)/common/mlutils \
-I $(top_builddir)/common/utils/.libs \
- -I $(top_srcdir)/common/mlpcre \
+ -I $(top_builddir)/common/mlpcre \
-I $(top_builddir)/common/mlpcre/.libs \
-I $(top_builddir)/gnulib/lib/.libs
@@ -356,7 +356,7 @@ camldaemon.o: $(OBJECTS)
$(OBJECTS)
# OCaml dependencies.
-.depend: *.mli *.ml
+.depend: $(srcdir)/*.mli $(srcdir)/*.ml
$(top_builddir)/ocaml-dep.sh $^
-include .depend
diff --git a/generator/Makefile.am b/generator/Makefile.am
index fba807f18a..c2d10966aa 100644
--- a/generator/Makefile.am
+++ b/generator/Makefile.am
@@ -188,7 +188,7 @@ generator: $(objects)
$^ -o $@
# OCaml dependencies.
-.depend: *.mli *.ml
+.depend: $(srcdir)/*.mli $(srcdir)/*.ml
$(top_builddir)/ocaml-dep.sh $^
-include .depend
diff --git a/get-kernel/Makefile.am b/get-kernel/Makefile.am
index 03d4b9815f..81dfb48b42 100644
--- a/get-kernel/Makefile.am
+++ b/get-kernel/Makefile.am
@@ -135,7 +135,7 @@ stamp-virt-get-kernel.pod: virt-get-kernel.pod
touch $@
# OCaml dependencies.
-.depend: *.ml *.mli
+.depend: $(srcdir)/*.mli $(srcdir)/*.ml
$(top_builddir)/ocaml-dep.sh $^
-include .depend
diff --git a/ocaml-dep.sh.in b/ocaml-dep.sh.in
index 92037b785f..bef14d488a 100755
--- a/ocaml-dep.sh.in
+++ b/ocaml-dep.sh.in
@@ -49,7 +49,12 @@ ocaml
# Output file is always created in the current directory.
output=.depend
-includes=""
+subdir=$(realpath --relative-to=@abs_top_builddir@ .)
+srcdir=$(realpath --relative-to=. @abs_top_srcdir@/${subdir})
+srcdir_re=$(realpath --relative-to=. @abs_top_srcdir@/${subdir} | sed 's/\./[.]/g')
+top_builddir=$(realpath --relative-to=. @abs_top_builddir@)
+
+includes="-I @abs_top_srcdir@/$subdir -I @abs_top_builddir@/$subdir"
for i in $include_dirs; do
includes="$includes -I @abs_top_srcdir@/$i -I @abs_top_builddir@/$i"
done
@@ -58,7 +63,16 @@ rm -f $output $output-t
echo "# OCaml dependencies generated by $0" > $output-t
echo >> $output-t
-@OCAMLFIND@ ocamldep @OCAMLDEP_ALL@ @OCAMLDEP_ONE_LINE@ $includes "$@" >> $output-t
+
+# Rewrite paths for everything that is generated
+@OCAMLFIND@ ocamldep @OCAMLDEP_ALL@ @OCAMLDEP_ONE_LINE@ $includes "$@" \
+ | sed -e "s,@abs_top_srcdir(a)/${subdir},.,g" \
+ -e "s,@abs_top_srcdir@/\\([^ ]*[.]\\)\\(cm[^ ]*\\|o\\),${top_builddir}/\\1\\2,g" \
+ -e "s,${srcdir_re}/\\([^ ]*[.]\\)\\(cm[^ ]*\\|o\\),\\1\\2,g" \
+ -e 's, ./, ,g' \
+ -e "s,${srcdir_re}/\\([^ /]*_config[.]ml\\),\\1,g" \
+ >> $output-t
+
chmod -w $output-t
mv $output-t $output
diff --git a/ocaml/Makefile.am b/ocaml/Makefile.am
index b2af7d7e2d..b0f2900f2e 100644
--- a/ocaml/Makefile.am
+++ b/ocaml/Makefile.am
@@ -26,7 +26,6 @@ generator_built = \
EXTRA_DIST = \
$(generator_built) \
- .depend \
guestfs-c.c guestfs-c.h \
html/.gitignore \
META.in \
@@ -171,7 +170,7 @@ check-valgrind:
$(MAKE) VG="@VG@" TESTS="$(test_progs_all)" check
# Dependencies.
-.depend: *.mli *.ml
+.depend: $(srcdir)/*.mli $(srcdir)/*.ml
$(top_builddir)/ocaml-dep.sh $^
-include .depend
diff --git a/resize/Makefile.am b/resize/Makefile.am
index e599e1142f..847fb313a7 100644
--- a/resize/Makefile.am
+++ b/resize/Makefile.am
@@ -144,7 +144,7 @@ check-valgrind:
$(MAKE) VG="@VG@" check
# Dependencies.
-.depend: *.ml *.mli
+.depend: $(srcdir)/*.ml $(srcdir)/*.mli
$(top_builddir)/ocaml-dep.sh $^
-include .depend
diff --git a/sparsify/Makefile.am b/sparsify/Makefile.am
index 2f73f97a67..2ab357a685 100644
--- a/sparsify/Makefile.am
+++ b/sparsify/Makefile.am
@@ -154,7 +154,7 @@ check-valgrind:
$(MAKE) VG="@VG@" check
# OCaml dependencies.
-.depend: *.mli *.ml
+.depend: $(srcdir)/*.mli $(srcdir)/*.ml
$(top_builddir)/ocaml-dep.sh $^
-include .depend
diff --git a/subdir-rules.mk b/subdir-rules.mk
index a2382aa08c..ef3ba0941f 100644
--- a/subdir-rules.mk
+++ b/subdir-rules.mk
@@ -79,12 +79,12 @@ guestfs_am_v_jar = $(guestfs_am_v_jar_@AM_V@)
guestfs_am_v_jar_ = $(guestfs_am_v_jar_@AM_DEFAULT_V@)
guestfs_am_v_jar_0 = @echo " JAR " $@;
-%.cmi: %.mli
+%.cmi: $(srcdir)/%.mli
$(guestfs_am_v_ocamlcmi)$(OCAMLFIND) ocamlc $(OCAMLFLAGS) $(OCAMLPACKAGES) -c $< -o $@
-%.cmo: %.ml
+%.cmo: $(srcdir)/%.ml
$(guestfs_am_v_ocamlc)$(OCAMLFIND) ocamlc $(OCAMLFLAGS) $(OCAMLPACKAGES) -c $< -o $@
if HAVE_OCAMLOPT
-%.cmx: %.ml
+%.cmx: $(srcdir)/%.ml
$(guestfs_am_v_ocamlopt)$(OCAMLFIND) ocamlopt $(OCAMLFLAGS) $(OCAMLPACKAGES) -c $< -o $@
endif
diff --git a/v2v/Makefile.am b/v2v/Makefile.am
index 50611e7d2e..da34dd2645 100644
--- a/v2v/Makefile.am
+++ b/v2v/Makefile.am
@@ -542,7 +542,7 @@ v2v_unit_tests_LINK = \
$(v2v_unit_tests_THEOBJECTS) -o $@
# Dependencies.
-.depend: *.mli *.ml
+.depend: $(srcdir)/*.mli $(srcdir)/*.ml
$(top_builddir)/ocaml-dep.sh $^
-include .depend
diff --git a/v2v/test-harness/Makefile.am b/v2v/test-harness/Makefile.am
index 5c38a7266b..d69188969e 100644
--- a/v2v/test-harness/Makefile.am
+++ b/v2v/test-harness/Makefile.am
@@ -126,7 +126,7 @@ stamp-virt-v2v-test-harness.pod: virt-v2v-test-harness.pod
touch $@
# Dependencies.
-.depend: *.mli *.ml
+.depend: $(srcdir)/*.mli $(srcdir)/*.ml
$(top_builddir)/ocaml-dep.sh -I .. $^
-include .depend
--
2.17.0
6 years, 7 months
[nbdkit PATCH v3 00/15] Add FUA support to nbdkit
by Eric Blake
After more than a month since v2 [1], I've finally got my FUA
support series polished. This is all of my outstanding patches,
even though some of them were originally posted in separate
threads from the original FUA post [2], [3]
[1] https://www.redhat.com/archives/libguestfs/2018-January/msg00113.html
[2] https://www.redhat.com/archives/libguestfs/2018-January/msg00219.html
[3] https://www.redhat.com/archives/libguestfs/2018-February/msg00000.html
Still to go: figure out how we want to expose flags through the
language bindings (there, we can break API if needed, but hopefully
we can instead exploit languages with function-overloading and/or
optional parameters to make it feel like a natural extension).
This exercise has been good; I've found a couple of tweaks needed
in qemu for corner cases explored while writing these nbdkit
patches. Also, the qemu list reminded me that even though the
NBD spec says FUA on trim is required to wait until the trim
effects have hit the disk, no sane client will ever send trim+FUA
because trim is advisory, and the client has no sane way to tell
if trim had an effect in the first place.
It feels pretty much like a rewrite, according to:
$ git backport-diff -u fua-v2 -r origin..
Key:
[----] : patches are identical
[####] : number of functional differences between upstream/downstream patch
[down] : patch is downstream-only
The flags [FC] indicate (F)unctional and (C)ontextual differences, respectively
001/15:[down] 'src: Let internal.h handle common includes'
002/15:[down] 'backend: Rework internal error return semantics'
003/15:[down] 'filters: Adjust callback API for flags/errors'
004/15:[0133] [FC] 'filters: Add log filter'
005/15:[0157] [FC] 'filters: Add blocksize filter'
006/15:[down] 'backend: Add .can_zero/.can_fua helpers'
007/15:[down] 'filters: Expose new .can_zero callback'
008/15:[0125] [FC] 'filters: Add nozero filter'
009/15:[down] 'filters: Expose new .can_fua callback'
010/15:[down] 'filters: Add fua filter'
011/15:[down] 'plugins: Expose new FUA callbacks'
012/15:[0043] [FC] 'nbd: Wire up FUA flag passthrough'
013/15:[down] 'null: Wire up FUA flag support'
014/15:[down] 'todo: Mention possibility of caching .can_FOO callbacks'
015/15:[0130] [FC] 'RFC: plugins: Add back-compat for new plugin with old nbdkit'
Eric Blake (15):
src: Let internal.h handle common includes
backend: Rework internal error return semantics
filters: Adjust callback API for flags/errors
filters: Add log filter
filters: Add blocksize filter
backend: Add .can_zero/.can_fua helpers
filters: Expose new .can_zero callback
filters: Add nozero filter
filters: Expose new .can_fua callback
filters: Add fua filter
plugins: Expose new FUA callbacks
nbd: Wire up FUA flag passthrough
null: Wire up FUA flag support
todo: Mention possibility of caching .can_FOO callbacks
RFC: plugins: Add back-compat for new plugin with old nbdkit
TODO | 22 +-
docs/nbdkit-filter.pod | 173 ++++++++++--
docs/nbdkit-plugin.pod | 151 +++++++++--
docs/nbdkit.pod | 9 +-
filters/blocksize/nbdkit-blocksize-filter.pod | 141 ++++++++++
filters/fua/nbdkit-fua-filter.pod | 119 +++++++++
filters/log/nbdkit-log-filter.pod | 115 ++++++++
filters/nozero/nbdkit-nozero-filter.pod | 99 +++++++
configure.ac | 6 +-
include/nbdkit-common.h | 7 +
include/nbdkit-filter.h | 36 ++-
include/nbdkit-plugin.h | 89 ++++++-
src/internal.h | 24 +-
src/cleanup.c | 1 -
src/connections.c | 71 +++--
src/errors.c | 1 -
src/filters.c | 137 ++++++----
src/main.c | 1 -
src/plugins.c | 216 ++++++++++-----
src/sockets.c | 1 -
src/threadlocal.c | 1 -
src/utils.c | 1 -
plugins/nbd/nbd.c | 42 ++-
plugins/null/null.c | 42 ++-
filters/blocksize/blocksize.c | 370 ++++++++++++++++++++++++++
filters/cache/cache.c | 87 ++++--
filters/cow/cow.c | 55 +++-
filters/delay/delay.c | 15 +-
filters/fua/fua.c | 251 +++++++++++++++++
filters/log/log.c | 366 +++++++++++++++++++++++++
filters/nozero/nozero.c | 106 ++++++++
filters/offset/offset.c | 20 +-
filters/partition/partition.c | 26 +-
filters/Makefile.am | 4 +
filters/blocksize/Makefile.am | 62 +++++
filters/fua/Makefile.am | 62 +++++
filters/log/Makefile.am | 62 +++++
filters/nozero/Makefile.am | 62 +++++
tests/Makefile.am | 16 ++
tests/test-blocksize.sh | 156 +++++++++++
tests/test-fua.sh | 153 +++++++++++
tests/test-log.sh | 88 ++++++
tests/test-nozero.sh | 145 ++++++++++
43 files changed, 3318 insertions(+), 293 deletions(-)
create mode 100644 filters/blocksize/nbdkit-blocksize-filter.pod
create mode 100644 filters/fua/nbdkit-fua-filter.pod
create mode 100644 filters/log/nbdkit-log-filter.pod
create mode 100644 filters/nozero/nbdkit-nozero-filter.pod
create mode 100644 filters/blocksize/blocksize.c
create mode 100644 filters/fua/fua.c
create mode 100644 filters/log/log.c
create mode 100644 filters/nozero/nozero.c
create mode 100644 filters/blocksize/Makefile.am
create mode 100644 filters/fua/Makefile.am
create mode 100644 filters/log/Makefile.am
create mode 100644 filters/nozero/Makefile.am
create mode 100755 tests/test-blocksize.sh
create mode 100755 tests/test-fua.sh
create mode 100755 tests/test-log.sh
create mode 100755 tests/test-nozero.sh
--
2.14.3
6 years, 7 months
[PATCH] virt-builder.pod: Update Fedora versions
by Kashyap Chamarthy
This is just a mechanincal change, so that the public documentation[*]
refers to the latest release Fedora versions, instead of the EOLed
versions.
While at it, also update the `virt-cutomize` Makefile.am
[*] http://libguestfs.org/virt-builder.1.html
Signed-off-by: Kashyap Chamarthy <kchamart(a)redhat.com>
---
Maybe I missed more places. (Me wonders if upstream libguestfs uses a
more systematic approach to do this "purge" of EOLed distributions from
the source, where applicable.)
---
builder/virt-builder.pod | 54 ++++++++++++++++++++++++------------------------
customize/Makefile.am | 6 +++---
2 files changed, 30 insertions(+), 30 deletions(-)
diff --git a/builder/virt-builder.pod b/builder/virt-builder.pod
index 1ed18a7c7..c82a08b4d 100644
--- a/builder/virt-builder.pod
+++ b/builder/virt-builder.pod
@@ -59,11 +59,11 @@ your own too (see below).
After choosing a guest from the list, you may want to see if there
are any installation notes:
- virt-builder --notes fedora-25
+ virt-builder --notes fedora-27
=head2 Build a virtual machine
- virt-builder fedora-25
+ virt-builder fedora-27
will build a Fedora 25 image for the same architecture as virt-builder
(so running it from an i686 installation will try to build an i686
@@ -77,31 +77,31 @@ The first time this runs it has to download the template over the
network, but this gets cached (see L</CACHING>).
The name of the output file is derived from the template name, so
-above it will be F<fedora-25.img>. You can change the output filename
+above it will be F<fedora-27.img>. You can change the output filename
using the I<-o> option:
- virt-builder fedora-25 -o mydisk.img
+ virt-builder fedora-27 -o mydisk.img
You can also use the I<-o> option to write to existing devices or
logical volumes.
- virt-builder fedora-25 --format qcow2
+ virt-builder fedora-27 --format qcow2
-As above, but write the output in qcow2 format to F<fedora-25.qcow2>.
+As above, but write the output in qcow2 format to F<fedora-27.qcow2>.
- virt-builder fedora-25 --size 20G
+ virt-builder fedora-27 --size 20G
As above, but the output size will be 20 GB. The guest OS is resized
as it is copied to the output (automatically, using
L<virt-resize(1)>).
- virt-builder fedora-25 --arch i686
+ virt-builder fedora-27 --arch i686
As above, but using an i686 template, if available.
=head2 Setting the root password
- virt-builder fedora-25 --root-password file:/tmp/rootpw
+ virt-builder fedora-27 --root-password file:/tmp/rootpw
Create a Fedora 25 image. The root password is taken from the file
F</tmp/rootpw>.
@@ -113,7 +113,7 @@ You can also create user accounts. See L</USERS AND PASSWORDS> below.
=head2 Set the hostname
- virt-builder fedora-25 --hostname virt.example.com
+ virt-builder fedora-27 --hostname virt.example.com
Set the hostname to C<virt.example.com>.
@@ -122,7 +122,7 @@ Set the hostname to C<virt.example.com>.
To install packages from the ordinary (guest) software repository
(eg. dnf or apt):
- virt-builder fedora-25 --install "inkscape,@Xfce Desktop"
+ virt-builder fedora-27 --install "inkscape,@Xfce Desktop"
(In Fedora, C<@> is used to install groups of packages. On Debian
you would install a meta-package instead.)
@@ -135,7 +135,7 @@ For guests which use SELinux, like Fedora and Red Hat Enterprise
Linux, you may need to do SELinux relabelling after installing or
updating packages (see L</SELINUX> below):
- virt-builder fedora-25 --update --selinux-relabel
+ virt-builder fedora-27 --update --selinux-relabel
=head2 Customizing the installation
@@ -153,18 +153,18 @@ For example:
dnf -y --best update
EOF
- virt-builder fedora-25 --firstboot /tmp/dnf-update.sh
+ virt-builder fedora-27 --firstboot /tmp/dnf-update.sh
or simply:
- virt-builder fedora-25 --firstboot-command 'dnf -y --best update'
+ virt-builder fedora-27 --firstboot-command 'dnf -y --best update'
which makes the L<dnf(8)> C<update> command run once the first time
the guest boots.
Or:
- virt-builder fedora-25 \
+ virt-builder fedora-27 \
--edit '/etc/dnf/dnf.conf:
s/gpgcheck=1/gpgcheck=0/'
@@ -557,7 +557,7 @@ If the guest OS you are installing is similar to the host OS (eg.
both are Linux), and if libguestfs supports network connections, then
you can use I<--install> to install packages like this:
- virt-builder fedora-25 --install inkscape
+ virt-builder fedora-27 --install inkscape
This uses the guest���s package manager and the host���s network
connection.
@@ -566,7 +566,7 @@ connection.
To update the installed packages in the template at build time:
- virt-builder fedora-25 --update
+ virt-builder fedora-27 --update
Most of the templates that ship with virt-builder come with a very
minimal selection of packages (known as a "JEOS" or "Just Enough
@@ -578,7 +578,7 @@ OS from the template. This option updates those template packages.
Another option is to install the packages when the guest first boots:
- virt-builder fedora-25 --firstboot-install inkscape
+ virt-builder fedora-27 --firstboot-install inkscape
This uses the guest���s package manager and the guest���s network
connection.
@@ -626,7 +626,7 @@ For apt, create /tmp/install.sh containing:
Use the I<--attach> option to attach the CD / disk image and the
I<--run> option to run the script:
- virt-builder fedora-25 \
+ virt-builder fedora-27 \
--attach extra-packages.iso \
--run /tmp/install.sh
@@ -705,7 +705,7 @@ keyboard for some common Linux distributions.
For distros that use systemd C<localectl>, use a command like this:
- virt-builder fedora-25 \
+ virt-builder fedora-27 \
--firstboot-command 'localectl set-keymap uk'
See L<localectl(1)> and
@@ -749,7 +749,7 @@ This section contains examples for some common Linux distributions.
=head3 Setting Japanese in Fedora 25
- virt-builder fedora-25 \
+ virt-builder fedora-27 \
--size 20G \
--update \
--install @japanese-support \
@@ -977,7 +977,7 @@ I<--import> option.
virt-install --import \
--name guest --ram 2048 \
- --disk path=disk.img,format=raw --os-variant fedora25
+ --disk path=disk.img,format=raw --os-variant fedora27
Notes:
@@ -1012,7 +1012,7 @@ tools probably work differently as well.
Import the image into Glance (the OpenStack image store) by doing:
- glance image-create --name fedora-25-image --file fedora-25.img \
+ glance image-create --name fedora-27-image --file fedora-27.img \
--disk-format raw --container-format bare \
--is-public True
@@ -1022,12 +1022,12 @@ parameter should match virt-builder���s I<--format> option (or C<raw> if
you didn't use that option). The I<--container-format> should always
be C<bare> since virt-builder doesn't put images into containers.
-You can use the S<C<glance image-show I<fedora-25-image>>> command to
+You can use the S<C<glance image-show I<fedora-27-image>>> command to
display the properties of the image.
To boot up an instance of your image on a Nova compute node, do:
- nova boot fedora-25-server --image fedora-25-image \
+ nova boot fedora-27-server --image fedora-27-image \
--flavor m1.medium
Use S<C<nova flavor-list>> to list possible machine flavors. Use
@@ -1058,7 +1058,7 @@ at boot.
A typical virt-builder command would be:
- virt-builder fedora-25 \
+ virt-builder fedora-27 \
--hostname client.example.com \
--update \
--install puppet \
@@ -1583,7 +1583,7 @@ package manager at that.
To install a Fedora guest using a local mirror:
- virt-builder fedora-25 \
+ virt-builder fedora-27 \
--edit '/etc/yum.repos.d/fedora.repo:
s{.*baseurl=.*}{baseurl=http://example.com/mirror/};
s{.*metalink=.*}{};
diff --git a/customize/Makefile.am b/customize/Makefile.am
index 5fa176341..0d1d5aa6c 100644
--- a/customize/Makefile.am
+++ b/customize/Makefile.am
@@ -237,8 +237,8 @@ firstboot_test_scripts := \
test-firstboot-debian-6.sh \
test-firstboot-debian-7.sh \
test-firstboot-debian-8.sh \
- test-firstboot-fedora-25.sh \
test-firstboot-fedora-26.sh \
+ test-firstboot-fedora-27.sh \
test-firstboot-ubuntu-10.04.sh \
test-firstboot-ubuntu-12.04.sh \
test-firstboot-ubuntu-14.04.sh \
@@ -258,7 +258,7 @@ password_test_scripts := \
test-password-debian-6.sh \
test-password-debian-7.sh \
test-password-debian-8.sh \
- test-password-fedora-25.sh \
+ test-password-fedora-27.sh \
test-password-rhel-3.9.sh \
test-password-rhel-4.9.sh \
test-password-rhel-5.11.sh \
@@ -284,7 +284,7 @@ settings_test_scripts := \
test-settings-debian-6.sh \
test-settings-debian-7.sh \
test-settings-debian-8.sh \
- test-settings-fedora-25.sh \
+ test-settings-fedora-27.sh \
test-settings-ubuntu-10.04.sh \
test-settings-ubuntu-12.04.sh \
test-settings-ubuntu-14.04.sh \
--
2.13.6
6 years, 7 months
[nbdkit PATCH 0/2] Python cleanups
by Eric Blake
I noticed these while working on adding fua support into python,
these are independent enough to push now (and I'll have to rebase
my 'optional may_trim' patch on top of this).
Eric Blake (2):
python: Use Py_XDEFREF()
python: Simplify calling into plugin
plugins/python/python.c | 106 ++++++++----------------------------------------
1 file changed, 18 insertions(+), 88 deletions(-)
--
2.14.3
6 years, 7 months
[PATCH v2 0/5] daemon: generate almall the API OCaml interfaces
by Pino Toscano
Hi,
as a followup for the signature fix for mount_vfs [1], here it is a
patch series to generate automatically all the OCaml interfaces of
daemon actions.
[1] https://www.redhat.com/archives/libguestfs/2018-April/msg00059.html
Thanks,
Pino Toscano (5):
daemon: directly use Optgroups
daemon: use the structs from the Structs module
daemon: move Lvm.lv_canonical to new Lvm_utils module
daemon: move Mount.umount_all to new Mount_utils module
daemon: autogenerate OCaml interfaces
.gitignore | 17 ++++++++
daemon/Makefile.am | 4 ++
daemon/blkid.mli | 19 ---------
daemon/btrfs.mli | 26 -----------
daemon/devsparts.mli | 25 -----------
daemon/filearch.mli | 19 ---------
daemon/findfs.ml | 2 +-
daemon/findfs.mli | 20 ---------
daemon/inspect.ml | 2 +-
daemon/inspect.mli | 41 ------------------
daemon/inspect_fs.ml | 2 +-
daemon/inspect_fs_unix_fstab.ml | 2 +-
daemon/inspect_fs_windows.ml | 4 +-
daemon/is.mli | 21 ---------
daemon/ldm.ml | 2 -
daemon/ldm.mli | 22 ----------
daemon/link.mli | 19 ---------
daemon/listfs.ml | 8 ++--
daemon/listfs.mli | 19 ---------
daemon/lvm.ml | 29 -------------
daemon/lvm_utils.ml | 48 +++++++++++++++++++++
daemon/{lvm.mli => lvm_utils.mli} | 4 --
daemon/md.mli | 20 ---------
daemon/mount.ml | 61 --------------------------
daemon/mount.mli | 24 -----------
daemon/mount_utils.ml | 83 ++++++++++++++++++++++++++++++++++++
daemon/{file.mli => mount_utils.mli} | 2 +-
daemon/parted.mli | 34 ---------------
daemon/realpath.mli | 20 ---------
daemon/statvfs.mli | 33 --------------
generator/daemon.ml | 83 ++++++++++++++++++++++++++++++++++++
generator/daemon.mli | 1 +
generator/main.ml | 17 ++++++++
33 files changed, 264 insertions(+), 469 deletions(-)
delete mode 100644 daemon/blkid.mli
delete mode 100644 daemon/btrfs.mli
delete mode 100644 daemon/devsparts.mli
delete mode 100644 daemon/filearch.mli
delete mode 100644 daemon/findfs.mli
delete mode 100644 daemon/inspect.mli
delete mode 100644 daemon/is.mli
delete mode 100644 daemon/ldm.mli
delete mode 100644 daemon/link.mli
delete mode 100644 daemon/listfs.mli
create mode 100644 daemon/lvm_utils.ml
rename daemon/{lvm.mli => lvm_utils.mli} (94%)
delete mode 100644 daemon/md.mli
delete mode 100644 daemon/mount.mli
create mode 100644 daemon/mount_utils.ml
rename daemon/{file.mli => mount_utils.mli} (96%)
delete mode 100644 daemon/parted.mli
delete mode 100644 daemon/realpath.mli
delete mode 100644 daemon/statvfs.mli
--
2.14.3
6 years, 7 months