[PATCH 0/3] RFC: appliance flavours
by Pino Toscano
Hi,
this is a prototype of something I've around for some time.
Basically it is about adding new appliances in addition to the main
one currently used and kept up-to-date automatically: this way it is
possible to create new appliances with extra packages, to be used in
specific contexts (like virt-rescue, with more network/recovery tools)
without filling the main appliance.
It's still WIP (the most notable lack is a proper base.tar.gz with
config files of flavour packages), but I'd like to get some feedback
about it.
Pino Toscano (3):
New API: appliance flavours
appliance: add a "rescue" appliance for virt-rescue
appliance: move openssh to the "rescue" appliance
appliance/Makefile.am | 21 ++++++++++++++++++++-
appliance/packagelist-rescue.in | 32 ++++++++++++++++++++++++++++++++
appliance/packagelist.in | 4 ----
generator/actions.ml | 28 ++++++++++++++++++++++++++++
rescue/rescue.c | 4 ++++
src/appliance.c | 22 +++++++++++++++++-----
src/guestfs-internal.h | 1 +
src/guestfs.pod | 18 ++++++++++++++++++
src/handle.c | 24 ++++++++++++++++++++++++
9 files changed, 144 insertions(+), 10 deletions(-)
create mode 100644 appliance/packagelist-rescue.in
--
1.9.3
10 years, 1 month
[PATCH 1/2] appliance: Use dhclient instead of hard-coding IP address of appliance.
by Richard W.M. Jones
qemu in SLIRP mode offers DHCP services to the appliance. We don't
use them, but use a fixed IP address intead. This changes the
appliance to get its IP address using DHCP.
Note: This is only used when the network is enabled. dhclient is
somewhat slower, but the penalty (a few seconds) is only paid for
network users. We could consider using the faster systemd dhcp client
instead.
---
appliance/init | 9 +++------
appliance/packagelist.in | 1 +
2 files changed, 4 insertions(+), 6 deletions(-)
diff --git a/appliance/init b/appliance/init
index 6d62338..d688a52 100755
--- a/appliance/init
+++ b/appliance/init
@@ -79,12 +79,9 @@ hwclock -u -s
ip addr add 127.0.0.1/8 brd + dev lo scope host
ip link set dev lo up
-ip addr add 169.254.2.10/16 brd + dev eth0 scope global
-ip link set dev eth0 up
-
-ip route add default via 169.254.2.2
-
-echo nameserver 169.254.2.3 > /etc/resolv.conf
+if grep -sq guestfs_network=1 /proc/cmdline; then
+ dhclient
+fi
# Scan for MDs.
mdadm -As --auto=yes --run
diff --git a/appliance/packagelist.in b/appliance/packagelist.in
index 276b4c2..4e93eaf 100644
--- a/appliance/packagelist.in
+++ b/appliance/packagelist.in
@@ -210,6 +210,7 @@ binutils
bzip2
coreutils
cpio
+dhclient
diffutils
dosfstools
e2fsprogs
--
2.0.4
10 years, 1 month
Useful tip: Run guestfsd under gdb and print stack trace on exit
by Richard W.M. Jones
Useful for tracking down segfaults in the daemon. This is not
upstreamable right now.
Example usage:
$ ./run guestfish -v -x -a /dev/null run : debug segv ""
[...]
libguestfs: trace: launch = 0
libguestfs: trace: debug "segv" ""
guestfsd: main_loop: new request, len 0x34
Program received signal SIGSEGV, Segmentation fault.
debug_segv (subcmd=0x4687050 "segv", argc=0, argv=0x4687070) at debug.c:223
223\tdebug.c: No such file or directory.
#0 debug_segv (subcmd=0x4687050 "segv", argc=0, argv=0x4687070) at debug.c:223
#1 0x000000000042e083 in debug_stub (xdr_in=<optimized out>) at stubs.c:2557
#2 0x0000000000448d5d in dispatch_incoming_message (xdr_in=0x7fffffffe8d0) at stubs.c:15819
#3 0x0000000000428a91 in main_loop (_sock=73953360, _sock@entry=3) at proto.c:192
#4 0x000000000040564d in main (argc=<optimized out>, argv=<optimized out>) at guestfsd.c:344
Rebooting.
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
10 years, 1 month
[PATCH] sysprep: add no-op --no-selinux-relabel (RHBZ#1148072)
by Pino Toscano
Add a no-op --no-selinux-relabel option, to be compatible with
virt-sysprep < 1.26.
---
sysprep/main.ml | 2 ++
1 file changed, 2 insertions(+)
diff --git a/sysprep/main.ml b/sysprep/main.ml
index ea94728..f32c4ad 100644
--- a/sysprep/main.ml
+++ b/sysprep/main.ml
@@ -140,6 +140,8 @@ let main () =
"--list-operations", Arg.Unit list_operations, " " ^ s_"List supported operations";
"--long-options", Arg.Unit display_long_options, " " ^ s_"List long options";
"--mount-options", Arg.Set_string mount_opts, s_"opts" ^ " " ^ s_"Set mount options (eg /:noatime;/var:rw,noatime)";
+ "--no-selinux-relabel", Arg.Unit (fun () -> ()),
+ " " ^ s_"Compatibility option, does nothing";
"--operation", Arg.String set_operations, " " ^ s_"Enable/disable specific operations";
"--operations", Arg.String set_operations, " " ^ s_"Enable/disable specific operations";
"-q", Arg.Set quiet, " " ^ s_"Don't print log messages";
--
1.9.3
10 years, 1 month