[PATCH 0/2] Skip test-qemu-drive-libvirt.sh if libvirt is < 1.1.3
by Pino Toscano
Hi,
test-qemu-drive-libvirt.sh fails to run with libvirt < 1.1.3, because
the <test:runstate> attribute (used to keep the domains shut off) has
been introduced in that libvirt version.
Create a small (uninstalled) C tool which just does this version check,
to be used in all the tests (just one, so far) written in
shell/scripting language.
Pino Toscano (2):
tests: add a a simple libvirt-is-version test tool
tests/disks: skip test-qemu-drive-libvirt.sh if libvirt is < 1.1.3
.gitignore | 1 +
Makefile.am | 1 +
configure.ac | 1 +
tests/disks/test-qemu-drive-libvirt.sh | 10 +++++
tests/libvirt/Makefile.am | 32 ++++++++++++++
tests/libvirt/libvirt-is-version.c | 76 ++++++++++++++++++++++++++++++++++
6 files changed, 121 insertions(+)
create mode 100644 tests/libvirt/Makefile.am
create mode 100644 tests/libvirt/libvirt-is-version.c
--
1.8.3.1
10 years, 10 months
[PATCH] tests/mountable: add missing space in test-mountable-inspect.sh
by Pino Toscano
No actual behaviour, other than getting rid of a bash warning.
---
tests/mountable/test-mountable-inspect.sh | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tests/mountable/test-mountable-inspect.sh b/tests/mountable/test-mountable-inspect.sh
index 906263b..10d1e9f 100755
--- a/tests/mountable/test-mountable-inspect.sh
+++ b/tests/mountable/test-mountable-inspect.sh
@@ -66,7 +66,7 @@ $guestfish -a test.qcow2 -i <<'EOF' > test.output
<! echo inspect-get-product-name "`cat root.tmp`"
EOF
-if [ "$(cat test.output)" != "Fedora release 14 (Phony)"]; then
+if [ "$(cat test.output)" != "Fedora release 14 (Phony)" ]; then
echo "$0: error #2: unexpected output from inspect-get-product-name"
cat test.output
exit 1
--
1.8.3.1
10 years, 10 months
[PATCH] appliance: Disable ipv6 in the appliance because qemu usernet is ipv4 only
by Olaf Hering
Signed-off-by: Olaf Hering <olaf(a)aepfle.de>
---
Untested in this environment.
appliance/init | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/appliance/init b/appliance/init
index b25ea26..cc8c978 100755
--- a/appliance/init
+++ b/appliance/init
@@ -71,6 +71,10 @@ for f in /sys/block/{h,s,ub,v}d*/queue/scheduler; do echo noop > $f; done
# Update the system clock.
hwclock -u -s
+# Disable ipv6 because host names resolve to ipv4 and ipv6
+# Resolver may prefer ipv6 and qemu usernet does only ipv4
+for f in /proc/sys/net/ipv6/conf/*/disable_ipv6; do if test -w $f ; then echo 1 > $f; fi; done
+
# Set up the network.
ip addr add 127.0.0.1/8 brd + dev lo scope host
ip link set dev lo up
10 years, 10 months
[virt-builder] symbol lookup error: /lib64/libgnutls.so.28 - undefined symbol: nettle_secp_256r1
by Kashyap Chamarthy
Running virt-builder in a guest Fedora-20 guest hypervisor w/ Rawhide
Kernel, throws the below:
$ virt-builder fedora-20 --format qcow2 --size 20G
virt-builder: symbol lookup error: /lib64/libgnutls.so.28: undefined
symbol: nettle_secp_256r1
Version on L1 (guest hypervisor)
--------------------------------
$ uname -r; rpm -q libvirt-daemon-kvm qemu-system-x86 \
libguestfs gnutls
3.14.0-0.rc0.git9.1.fc21.x86_64
libvirt-daemon-kvm-1.2.1-1.fc21.x86_64
qemu-system-x86-1.7.0-4.fc21.x86_64
libguestfs-1.25.29-1.fc21.x86_64
gnutls-3.2.8-1.fc21.x86_64
And, that's the latest gnutls available on Fedora Rawhide:
$ koji latest-build rawhide gnutls | awk '{print $1}'
Build
----------------------------------------
gnutls-3.2.8-1.fc21
Version on L0 (Bare metal)
--------------------------
$ uname -r; rpm -q libvirt-daemon-kvm qemu-system-x86 \
libguestfs
3.12.8-300.fc20.x86_64
libvirt-daemon-kvm-1.2.1-1.fc21.x86_64
qemu-system-x86-1.7.0-4.fc21.x86_64
libguestfs-1.25.29-1.fc21.x86_64
--
/kashyap
10 years, 10 months
[PATCH] fuse: In mount-local-run, test if root filesystem has been mounted (RHBZ#1057504).
by Richard W.M. Jones
It is never normally valid to use the mount-local* APIs when you
haven't mounted some filesystems in the libguestfs namespace.
If you try it, it results in some odd errors. The mount-local-run
call is successful, but subsequent operations fail:
$ mkdir -p /tmp/mnt
$ guestfish -x -N fs mount-local /tmp/mnt : mount-local-run
libguestfs: error: lstat: lstat_stub: you must call 'mount' first to mount the root filesystem
libguestfs: error: lstat: lstat_stub: you must call 'mount' first to mount the root filesystem
With this commit, the mount-local-run call gives an error.
The error is implemented by calling guestfs_exists (g, "/") which has
the side effect of running the NEED_ROOT macro in the daemon. (There
is no simple equivalent of NEED_ROOT on the library side.)
---
src/fuse.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/src/fuse.c b/src/fuse.c
index dd4f139..c22cbba 100644
--- a/src/fuse.c
+++ b/src/fuse.c
@@ -1028,6 +1028,12 @@ guestfs__mount_local_run (guestfs_h *g)
return -1;
}
+ /* Test if root is mounted. We do this by using a side-effect of
+ * guestfs_exists (which is that it calls NEED_ROOT).
+ */
+ if (guestfs_exists (g, "/") == -1)
+ return -1;
+
debug (g, "%s: entering fuse_loop", __func__);
/* Enter the main loop. */
--
1.8.4.2
10 years, 10 months
[PATCH] builder: read all the available notes from the index
by Pino Toscano
Switch the internal storage for the notes of each entry to a sorted list
with all the subkeys available (which should represent the translations
to various languages).
The current outputs are the same (i.e. still the untranslated notes), so
this is just internal refactoring/preparation.
---
builder/builder.ml | 4 ++--
builder/index_parser.ml | 19 +++++++++++++++----
builder/index_parser.mli | 2 +-
builder/list_entries.ml | 10 +++++++---
4 files changed, 25 insertions(+), 10 deletions(-)
diff --git a/builder/builder.ml b/builder/builder.ml
index bb0b108..19d1e42 100644
--- a/builder/builder.ml
+++ b/builder/builder.ml
@@ -200,9 +200,9 @@ let main () =
(match mode with
| `Notes -> (* --notes *)
(match entry with
- | { Index_parser.notes = Some notes } ->
+ | { Index_parser.notes = ("", notes) :: _ } ->
print_endline notes;
- | { Index_parser.notes = None } ->
+ | { Index_parser.notes = _ } ->
printf (f_"There are no notes for %s\n") arg
);
exit 0
diff --git a/builder/index_parser.ml b/builder/index_parser.ml
index da44b21..961b91b 100644
--- a/builder/index_parser.ml
+++ b/builder/index_parser.ml
@@ -35,7 +35,7 @@ and entry = {
compressed_size : int64 option;
expand : string option;
lvexpand : string option;
- notes : string option;
+ notes : (string * string) list;
hidden : bool;
sigchecker : Sigchecker.t;
@@ -92,8 +92,8 @@ let print_entry chan (name, { printable_name = printable_name;
| Some lvexpand -> fp "lvexpand=%s\n" lvexpand
);
(match notes with
- | None -> ()
- | Some notes -> fp "notes=%s\n" notes
+ | ("", notes) :: _ -> fp "notes=%s\n" notes
+ | _ -> ()
);
if hidden then fp "hidden=true\n"
@@ -219,7 +219,18 @@ let get_index ~prog ~debug ~downloader ~sigchecker source =
let lvexpand =
try Some (List.assoc ("lvexpand", None) fields) with Not_found -> None in
let notes =
- try Some (List.assoc ("notes", None) fields) with Not_found -> None in
+ let rec loop = function
+ | [] -> []
+ | (("notes", subkey), value) :: xs ->
+ let subkey = match subkey with
+ | None -> ""
+ | Some v -> v in
+ (subkey, value) :: loop xs
+ | _ :: xs -> loop xs in
+ List.sort (
+ fun (k1, _) (k2, _) ->
+ String.compare k1 k2
+ ) (loop fields) in
let hidden =
try bool_of_string (List.assoc ("hidden", None) fields)
with
diff --git a/builder/index_parser.mli b/builder/index_parser.mli
index 54f1807..3c679b3 100644
--- a/builder/index_parser.mli
+++ b/builder/index_parser.mli
@@ -29,7 +29,7 @@ and entry = {
compressed_size : int64 option;
expand : string option;
lvexpand : string option;
- notes : string option;
+ notes : (string * string) list;
hidden : bool;
sigchecker : Sigchecker.t;
diff --git a/builder/list_entries.ml b/builder/list_entries.ml
index 7369e6c..742e43b 100644
--- a/builder/list_entries.ml
+++ b/builder/list_entries.ml
@@ -71,10 +71,10 @@ and list_entries_long ~sources index =
printf "%-24s %s\n" (s_"Download size:") (human_size size);
);
(match notes with
- | None -> ()
- | Some notes ->
+ | ("", notes) :: _ ->
printf "\n";
printf (f_"Notes:\n\n%s\n") notes
+ | _ -> ()
);
printf "\n"
)
@@ -108,6 +108,10 @@ and list_entries_json ~sources index =
| None -> ()
| Some n ->
printf " \"%s\": \"%Ld\",\n" key n in
+ let print_notes = function
+ | ("", notes) :: _ ->
+ printf " \"notes\": \"%s\",\n" (json_string_escape notes)
+ | _ -> () in
printf "{\n";
printf " \"version\": %d,\n" 1;
@@ -132,7 +136,7 @@ and list_entries_json ~sources index =
json_optional_printf_string "full-name" printable_name;
printf " \"size\": %Ld,\n" size;
json_optional_printf_int64 "compressed-size" compressed_size;
- json_optional_printf_string "notes" notes;
+ print_notes notes;
printf " \"hidden\": %s\n" (json_string_of_bool hidden);
printf " }%s\n" (trailing_comma i (List.length index))
) index;
--
1.8.3.1
10 years, 10 months
[PATCH] launch: direct: Stop using deprecated -no-kvm-pit-reinjection if qemu is new enough (RHBZ#1053847).
by Richard W.M. Jones
---
src/launch-direct.c | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/src/launch-direct.c b/src/launch-direct.c
index 6eaee63..c091732 100644
--- a/src/launch-direct.c
+++ b/src/launch-direct.c
@@ -491,7 +491,14 @@ launch_direct (guestfs_h *g, void *datav, const char *arg)
*/
ADD_CMDLINE ("-no-hpet");
#endif
- ADD_CMDLINE ("-no-kvm-pit-reinjection");
+ if (data->qemu_version_major < 1 ||
+ (data->qemu_version_major == 1 && data->qemu_version_minor <= 2))
+ ADD_CMDLINE ("-no-kvm-pit-reinjection");
+ else {
+ /* New non-deprecated way, added in qemu >= 1.3. */
+ ADD_CMDLINE ("-global");
+ ADD_CMDLINE ("kvm-pit.lost_tick_policy=discard");
+ }
ADD_CMDLINE ("-kernel");
ADD_CMDLINE (kernel);
--
1.8.4.2
10 years, 10 months
[PATCH 0/7] Various fixes for Ceph drives and parsing libvirt XML.
by Richard W.M. Jones
Miscellaneous fixes to:
- Handling of Ceph drives now works end-to-end (RHBZ#1026688).
- In particular, you can now use rbd:/// URIs in guestfish (and
they work).
- Parse Ceph & NBD network drives from libvirt XML correctly, so
that existing domains with Ceph/NBD drives can be added
(eg. using guestfish -d option).
- Add more testing of the above.
10 years, 10 months