[PATCH 0/2] python: improved UTF8 decoding error handling
by Matteo Cafasso
The Python 3 bindings currently are unable to deal with non UTF8 characters.
This series continues what proposed in RHBZ#1406906.
A new function 'set_decode_error_handler' allows the User to specify
how to deal with decoding errors.
The default behaviour will be raising a UnicodeDecodeError.
If the handler is changed to 'surrogateescape', non UTF8 characters will be escaped
in a similar manner as for Python 2.
See PEP383 for reference.
This series fixes also a bug introduced in commit 9d25b4e56471f9c33ea6229a8b620fc800c240f8.
Matteo Cafasso (2):
python: return bytes when return value is RBufferOut
python: unicode decode handler error scheme setter
generator/python.ml | 19 ++++++++++++++++++-
python/handle.c | 28 ++++++++++++++++++++++++++--
python/t/test830RHBZ1406906.py | 6 ++++++
3 files changed, 50 insertions(+), 3 deletions(-)
--
2.11.0
7 years, 5 months
FYI: Changes to libguestfs.org web hosting
by Richard W.M. Jones
The former libguestfs.org website was running on an old server in a
cellar with "Beware of the Leopard" on the door. The server was
overdue for retirement and is about to be decommissioned.
I have moved and split up the hosting as follows:
* The main website http://libguestfs.org is on a temporary server.
The medium term plan is to move it to Openshift, but I've been
having a lot of trouble getting access to my account, so this might
not happen for another week. It should also allow us to enable TLS
in the near-ish future.
* The http://libguestfs.org/download directory has been moved to
+ http://builder.libguestfs.org ,
+ http://archive.libguestfs.org and
+ http://download.libguestfs.org
Existing file and directory URLs should redirect automatically.
* http://builder.libguestfs.org contains the virt-builder templates
previously located at http://libguestfs.org/download/builder/
Because that URL is baked into all sorts of Linux distros, I have
set up redirection which should ensure that the old URLs keep
working forever. But I will also submit an update to all our stable
branches with the new URL.
In my testing virt-builder seems fine, but more testing would be
useful here.
* http://archive.libguestfs.org hosts old tarballs of ancient versions
of libguestfs, and is of historic interest only. The main reason to
split this out was to reduce the amount of data that we need to
store in Openshift. As above, redirects should automatically deal
with old URLs.
* http://download.libguestfs.org hosts only tarballs for current
stable and development branches. Once a branch becomes unsupported
I'll move it to http://archive.libguestfs.org
Note also that http://libguestfs.org/download/binaries/appliance
which is baked into some distros (particularly Gentoo) has moved.
Again, redirects should take care of everything.
All of this should be transparent to everyone - ie you shouldn't need
to do anything at all. But as with all these things, if you find
something is broken, please let me know.
Rich.
--
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
Read my programming and virtualization blog: http://rwmj.wordpress.com
Fedora Windows cross-compiler. Compile Windows programs, test, and
build Windows installers. Over 100 libraries supported.
http://fedoraproject.org/wiki/MinGW
7 years, 5 months
IRC question: the proper way to break multiple lines when using virt-sysprep --commands-from-file?
by Richard W.M. Jones
18:07 < _ng> What is the proper way to break mult lines when using
virt-sysprep --write option, with --commands-from-file?
(I don't mean escaping, but actually writing new lines to
the file)
You can use \ as a continuation character, as it mentions
in the manual.
Using virt-builder (just because it's a bit easier to demonstrate, but
virt-sysprep should work the same way), you can do:
$ cat test.cmds
write /testfile:this is line 1\
this is line 2\
this is line 3
write /anotherfile:this is another command
$ virt-builder fedora-25 --commands-from-file test.cmds
$ guestfish --ro -a fedora-25.img -i
><fs> cat /testfile
this is line 1
this is line 2
this is line 3
><fs> cat /anotherfile
this is another command
Rich.
--
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
Read my programming and virtualization blog: http://rwmj.wordpress.com
libguestfs lets you edit virtual machines. Supports shell scripting,
bindings from many languages. http://libguestfs.org
7 years, 5 months
[PATCH] btrfs_replace: fix position of subcommand options
by Pino Toscano
btrfs-progs 4.11 is more strict with option parsing, so subcommand
options must appear now before the subcommand arguments.
---
daemon/btrfs.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/daemon/btrfs.c b/daemon/btrfs.c
index 23513a9..ae2310b 100644
--- a/daemon/btrfs.c
+++ b/daemon/btrfs.c
@@ -2185,11 +2185,11 @@ do_btrfs_replace (const char *srcdev, const char *targetdev,
ADD_ARG (argv, i, str_btrfs);
ADD_ARG (argv, i, "replace");
ADD_ARG (argv, i, "start");
- ADD_ARG (argv, i, srcdev);
- ADD_ARG (argv, i, targetdev);
- ADD_ARG (argv, i, path_buf);
ADD_ARG (argv, i, "-B");
ADD_ARG (argv, i, "-f");
+ ADD_ARG (argv, i, srcdev);
+ ADD_ARG (argv, i, targetdev);
+ ADD_ARG (argv, i, path_buf);
ADD_ARG (argv, i, NULL);
r = commandv (NULL, &err, argv);
--
2.9.4
7 years, 5 months
[PATCH] v2v: add crypto support (RHBZ#1451665)
by Pino Toscano
Make use of the additional command line arguments, and API needed to
decrypt LUKS partitions. This extends to v2v the work done in other
OCaml tools with commit 6b26a0cce4f1d6264bee88902b8931e39288c901,
since it seems to be working fine after a basic testing.
Related to: RHBZ#1362649
---
v2v/cmdline.ml | 2 +-
v2v/v2v.ml | 3 +++
v2v/virt-v2v.pod | 20 ++++++++++++++++++++
3 files changed, 24 insertions(+), 1 deletion(-)
diff --git a/v2v/cmdline.ml b/v2v/cmdline.ml
index a1338eb..70301ab 100644
--- a/v2v/cmdline.ml
+++ b/v2v/cmdline.ml
@@ -236,7 +236,7 @@ A short summary of the options is given below. For detailed help please
read the man page virt-v2v(1).
")
prog in
- let opthandle = create_standard_options argspec ~anon_fun usage_msg in
+ let opthandle = create_standard_options argspec ~anon_fun ~key_opts:true usage_msg in
Getopt.parse opthandle;
(* Dereference the arguments. *)
diff --git a/v2v/v2v.ml b/v2v/v2v.ml
index 8cf1fad..59f5ef1 100644
--- a/v2v/v2v.ml
+++ b/v2v/v2v.ml
@@ -86,6 +86,9 @@ let rec main () =
g#launch ();
+ (* Decrypt the disks. *)
+ inspect_decrypt g;
+
(* Inspection - this also mounts up the filesystems. *)
(match conversion_mode with
| Copying _ -> message (f_"Inspecting the overlay")
diff --git a/v2v/virt-v2v.pod b/v2v/virt-v2v.pod
index f6d196f..c255c0d 100644
--- a/v2v/virt-v2v.pod
+++ b/v2v/virt-v2v.pod
@@ -302,6 +302,17 @@ Save the overlay file(s) created during conversion. This option is
only used for debugging virt-v2v and may be removed in a future
version.
+=item B<--echo-keys>
+
+When prompting for keys and passphrases, virt-v2v normally turns
+echoing off so you cannot see what you are typing. If you are not
+worried about Tempest attacks and there is no one else in the room you
+can specify this flag to see what you are typing.
+
+Note this options only applies to keys and passphrases for encrypted
+devices and partitions, not for passwords used to connect to remote
+servers.
+
=item B<-i> B<disk>
Set the input method to I<disk>.
@@ -382,6 +393,15 @@ See L</IN PLACE CONVERSION> below.
Conflicts with all I<-o *> options.
+=item B<--keys-from-stdin>
+
+Read key or passphrase parameters from stdin. The default is
+to try to read passphrases from the user by opening F</dev/tty>.
+
+Note this options only applies to keys and passphrases for encrypted
+devices and partitions, not for passwords used to connect to remote
+servers.
+
=item B<--machine-readable>
This option is used to make the output more machine friendly
--
2.9.4
7 years, 6 months
[PATCH 1/5] s390x: launch: libvirt: Use <console> device sclp for appliance debug messages (RHBZ#1376547).
by Richard W.M. Jones
Thanks: Cole Robinson, Dan Horak, Thomas Huth.
---
lib/launch-libvirt.c | 17 +++++++++++++++++
1 file changed, 17 insertions(+)
diff --git a/lib/launch-libvirt.c b/lib/launch-libvirt.c
index f66c8e0ef..4adb2cfb3 100644
--- a/lib/launch-libvirt.c
+++ b/lib/launch-libvirt.c
@@ -1359,6 +1359,7 @@ construct_libvirt_xml_devices (guestfs_h *g,
return -1;
}
+#ifndef __s390x__
/* Console. */
start_element ("serial") {
attribute ("type", "unix");
@@ -1370,6 +1371,22 @@ construct_libvirt_xml_devices (guestfs_h *g,
attribute ("port", "0");
} end_element ();
} end_element ();
+#else
+ /* https://bugzilla.redhat.com/show_bug.cgi?id=1376547#c14
+ * and https://libvirt.org/formatdomain.html#elementCharConsole
+ */
+ start_element ("console") {
+ attribute ("type", "unix");
+ start_element ("source") {
+ attribute ("mode", "connect");
+ attribute ("path", params->data->console_path);
+ } end_element ();
+ start_element ("target") {
+ attribute ("type", "sclp");
+ attribute ("port", "0");
+ } end_element ();
+ } end_element ();
+#endif
/* Virtio-serial for guestfsd communication. */
start_element ("channel") {
--
2.13.0
7 years, 6 months
[PATCH] s390x: tests: 9p: Use virtio-9p-ccw as the 9p device in this test.
by Richard W.M. Jones
---
tests/9p/test-9p.sh | 22 ++++++++++++----------
1 file changed, 12 insertions(+), 10 deletions(-)
diff --git a/tests/9p/test-9p.sh b/tests/9p/test-9p.sh
index 748603037..b4bdbe56e 100755
--- a/tests/9p/test-9p.sh
+++ b/tests/9p/test-9p.sh
@@ -25,16 +25,18 @@ $TEST_FUNCTIONS
skip_if_skipped
skip_unless_backend direct
-# The name of the virtio-9p device is different on virtio-pci and virtio-mmio.
-arch="$(uname -m)"
-if [[ "$arch" =~ ^arm ]]; then
- virtio_mmio=yes
-fi
-if [ "$virtio_mmio" != "yes" ]; then
- virtio_9p=virtio-9p-pci
-else
- virtio_9p=virtio-9p-device
-fi
+# The name of the virtio-9p device is different on some architectures.
+case "$(uname -m)" in
+ arm*)
+ virtio_9p=virtio-9p-device
+ ;;
+ s390*)
+ virtio_9p=virtio-9p-ccw
+ ;;
+ *)
+ virtio_9p=virtio-9p-pci
+ ;;
+esac
rm -f test-9p.img test-9p.out
--
2.13.0
7 years, 6 months
[PATCH] s390x: tests: regressions: Skip IDE tests on S/390.
by Richard W.M. Jones
IDE interface is not supported.
---
tests/regressions/rhbz690819.sh | 1 +
tests/regressions/rhbz975797.sh | 1 +
2 files changed, 2 insertions(+)
diff --git a/tests/regressions/rhbz690819.sh b/tests/regressions/rhbz690819.sh
index d18b4d81a..0b790862d 100755
--- a/tests/regressions/rhbz690819.sh
+++ b/tests/regressions/rhbz690819.sh
@@ -29,6 +29,7 @@ skip_if_arch arm
skip_if_arch aarch64
skip_if_arch ppc64
skip_if_arch ppc64le
+skip_if_arch s390x
skip_if_backend libvirt
# UML doesn't support the 'iface' parameter.
skip_if_backend uml
diff --git a/tests/regressions/rhbz975797.sh b/tests/regressions/rhbz975797.sh
index bc6a1c63f..04e8d23de 100755
--- a/tests/regressions/rhbz975797.sh
+++ b/tests/regressions/rhbz975797.sh
@@ -29,6 +29,7 @@ skip_if_arch arm
skip_if_arch aarch64
skip_if_arch ppc64
skip_if_arch ppc64le
+skip_if_arch s390x
skip_if_backend libvirt
# UML doesn't support the 'iface' parameter.
skip_if_backend uml
--
2.13.0
7 years, 6 months