Richard W.M. Jones | 4 Aug 23:38 2015

[PATCH] customize: Make dnf upgrade to the latest versions of packages.

I discovered that 'dnf upgrade' doesn't actually upgrade to the latest
versions of packages unless you also supply the '--best' flag.

This also changes update -> upgrade, since apparently 'dnf update'
is deprecated.
 customize/ | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/customize/ b/customize/
index bce0aca..828c711 100644
--- a/customize/
+++ b/customize/
 <at>  <at>  -123,7 +123,7  <at>  <at>  exec >>%s 2>&1
         apt-get $apt_opts upgrade
     | "dnf" ->
-      sprintf "dnf -y update"
+      sprintf "dnf -y --best upgrade"
     | "pisi" ->
       sprintf "pisi upgrade"
     | "pacman" ->

Richard W.M. Jones | 4 Aug 21:15 2015

[PATCH] automake: Admit defeat and use 'subdir-objects'.

Because this 'feature' is broken (since 2013):

we have to replace all instances of $(top_srcdir) in *_SOURCES lines
with a relative path.  According to what I read, this shouldn't break
split builds, but I didn't test it.

The only things automake moans about now are:

* Unescaped left brace in regex is deprecated, passed through in regex; marked by <-- HERE in m/\${ <-- HERE
([^ \t=:+{}]+)}/ at /usr/bin/automake line 3936.

  - This is another bug in automake

* autoreconf: AM_GNU_GETTEXT is used, but not AM_GNU_GETTEXT_VERSION

  - This is a feature, not a bug.
 .gitignore                    |  1 +
 builder/           | 14 +++++++-------                  |  2 +-
 customize/         |  8 ++++----
 dib/               |  2 +-
 get-kernel/        |  4 ++--
 mllib/             |  4 ++--
 resize/            | 10 +++++-----
 sparsify/          |  4 ++--
 sysprep/           | 12 ++++++------
 tests/mount-local/ |  4 ++--
(Continue reading)

Richard W.M. Jones | 4 Aug 15:19 2015

[PATCH v3 01/16] tests: Introduce test harness for running tests.

Since v2:

 - Add perl tests.

 - Reworked and fixed the tests for virt-builder.

 - Some further minor bug fixes.
Richard W.M. Jones | 31 Jul 17:13 2015

[PATCH v2 00/14] tests: Introduce test harness for running tests.

This is a more complete patch to add the test harness.

The only parts missing now are the language bindings (except OCaml).
The language bindings need a bit more thought.  At the moment most
language binding tests are done through some sort of shell script like
perl/run-perl-tests which either runs each test itself or uses some
language-specific machinary to run each test.  The problem with that
is the test harness should be running individual tests, otherwise we
cannot parallelize them, nor run fast-only tests.  That won't work
however until the test harness knows how to run language tests, which
it doesn't at the moment (except for OCaml).

In any case, this is now ready for review, and maybe inclusion

Philip KP LI | 29 Jul 03:12 2015

Redhat v2v


I am looking for the package, virt-v2v, for Redhat 7 to convert virtual
machines under Xen in Redhat 5 to KVM.  But, can't find it from the 7 and
neither from the public websites.   Why wasn’t virt-v2v included with 7
from the get-go?

And, pls also advise for the downloading sites if possible.



This e-mail message (together with any attachments) is for the designated recipient only. 
It may contain information that is privileged for the designated recipient.  
If you are not the intended recipient, you are hereby notified that any use, retention, disclosure,
printing, forwarding or dissemination of the message is strictly prohibited. 
If you have received the message in error, please erase all copies of the message (including attachments) 
from your system and notify the sender immediately.

Libguestfs mailing list
Libguestfs <at>
Raghu | 29 Jul 15:02 2015

restrict access to host from guestfish

Hi Richard,

guestfish shell has an ability to execute commands on the host such as
!mkdir local
tgz-out /remote local/remote-data.tar.gz

What is the best way to restrict access to host from guestfish ?

For instance,
- Allow readonly access to host.. i.e., !ls is allowed
but dont allow !rm or !mkdir

- commands such as tgz-out, or copy-out should be able to access just /tmp, but nothing else in host filesystem

Appreciate your guidance on this,


Libguestfs mailing list
Libguestfs <at>
Richard W.M. Jones | 29 Jul 14:42 2015

Re: \n didn't lead to a new line while using remote model

On Wed, Jul 29, 2015 at 04:18:02PM +0800, Yu Liu wrote:
> Let's make an example:
> #guestfish -a disk.img
> >run
> >mount /dev/sda1 /
> >write-append /a.txt "Hello\n"
> >write-append /a.txt "World\n"
> >cat /a.txt
> Hello
> World
> >quit
> Another try:
> eval `guestfish --listen`
> guestfish --remote add disk.img
> guestfish --remote run
> guestfish --remote mount /dev/sda1 /
> guestfish --remote write-append /a.txt "Hello\n"
> guestfish --remote write-append /a.txt "World\n"
> guestfish --remote cat /a.txt
> Hello\nWorld\n
> #
> libguestfs-1.20.11-11.el6.x86_64

The problem is that \n is handled "specially" by guestfish when it is
reading the ><fs> command line, but not when it is parsing commands
sent via --remote.

The way to do this is:

$ guestfish --remote write /a.txt "hello
$ guestfish --remote cat /a.txt

Note that you have to actually press the [Return] key after "hello

Probably a better plan is to use something like python remoting:

which will be more predictable.



Richard Jones, Virtualization Group, Red Hat
Read my programming and virtualization blog:
virt-builder quickly builds VMs from scratch
Pino Toscano | 29 Jul 13:48 2015

[PATCH 1/2] sysprep: machine_id: simplify implementation

Instead of rm + touch, just truncate the file if existing.
In case there was no file previously, now nothing is created, as most
probably the system was fine even without it.

Also, turn the single path into a list, so more machine-id files can be
handled at once.
 sysprep/ | 11 ++++-------
 1 file changed, 4 insertions(+), 7 deletions(-)

diff --git a/sysprep/ b/sysprep/
index fbcc692..190ca5b 100644
--- a/sysprep/
+++ b/sysprep/
 <at>  <at>  -21,15 +21,12  <at>  <at>  open Common_gettext.Gettext

 module G = Guestfs

-let machine_id_perform g root side_effects =
+let machine_id_perform (g : Guestfs.guestfs) root side_effects =
   let typ = g#inspect_get_type root in
   if typ <> "windows" then (
-    let path = "/etc/machine-id" in
-    (try g#rm path with G.Error _ -> ());
-    (try
-       g#touch path;
-       side_effects#created_file ()
-     with G.Error _ -> ());
+    let paths = [ "/etc/machine-id"; ] in
+    let paths = List.filter g#is_file paths in
+    List.iter g#truncate paths

 let op = {

Cédric Bosdonnat | 29 Jul 10:35 2015

[PATCH v2] appliance init: find NIC name for dhcpcd

dhcpcd requires an interface name as parameter to work. We are now
getting it from /proc/sys/net/ipv4/conf/ folder children. dhclient
on Debian also has the problem, thus use the guessed interface name
for it too.
 appliance/init | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/appliance/init b/appliance/init
index cca62e7..d5a428d 100755
--- a/appliance/init
+++ b/appliance/init
 <at>  <at>  -108,10 +108,11  <at>  <at>  ip addr add brd + dev lo scope host
 ip link set dev lo up

 if test "$guestfs_network" = 1; then
+    iface=$(ls -I all -I default -I lo /proc/sys/net/ipv4/conf)
     if dhclient --version >/dev/null 2>&1; then
-        dhclient
+        dhclient $iface
-        dhcpcd
+        dhcpcd $iface


Richard W.M. Jones | 28 Jul 19:24 2015

[PATCH 00/10] tests: Introduce test harness for running tests.

I should probably start by saying this patch series isn't ready for
review yet.

This patch series adds a test harness to libguestfs.  It allows us to
run the tests outside the ordinary 'make check' path in the build
tree.  In particular, you can use this to run tests when libguestfs
has been installed.  'make check' and the other 'make check-*' rules
still work.

The goals for this series is described in the commit message for
patch 01/10.

Back in Oct last year, I posted an earlier version of this patch
series.  I believe the last version of this series posted was this

Cédric Bosdonnat | 28 Jul 15:21 2015

[PATCH 0/2] Misc fixes

Here are two patches: one fixes the gpg-agent causing unmount to fail
after running dnf to install packages. The other ones fixes dhcpcd call
in the init program to provide it an interface name.

Cédric Bosdonnat (2):
  appliance init: find NIC name for dhcpcd
  Make sure gpg-agent is terminated before umount

 appliance/init             | 3 ++-
 customize/ | 3 ++-
 2 files changed, 4 insertions(+), 2 deletions(-)



Libguestfs mailing list
Libguestfs <at>