[PATCH] appliance: move virt-rescue welcome to /etc/issue
by Cédric Bosdonnat
To allow easier downstream tweaks to the virt-rescue welcome message,
just output the content of the /etc/issue file in the appliance.
Thus, a new extras.tar.gz file appeared in supermin.d containing
the etc/issue file and future tweaks like this one.
---
appliance/Makefile.am | 11 +++++++++++
appliance/init | 11 ++---------
appliance/issue | 9 +++++++++
3 files changed, 22 insertions(+), 9 deletions(-)
create mode 100644 appliance/issue
diff --git a/appliance/Makefile.am b/appliance/Makefile.am
index e23778e..f26c4d4 100644
--- a/appliance/Makefile.am
+++ b/appliance/Makefile.am
@@ -36,6 +36,7 @@ EXTRA_DIST = \
guestfs_shadow.aug \
hostfiles.in \
init \
+ issue \
libguestfs-make-fixed-appliance.in \
libguestfs-make-fixed-appliance.pod \
make.sh.in \
@@ -49,6 +50,7 @@ superminfs_DATA = \
supermin.d/base.tar.gz \
supermin.d/daemon.tar.gz \
supermin.d/excludefiles \
+ supermin.d/extras.tar.gz \
supermin.d/hostfiles \
supermin.d/init.tar.gz \
supermin.d/packages \
@@ -107,6 +109,15 @@ supermin.d/excludefiles: excludefiles.in Makefile
cmp -s $@ excludefiles-t || mv excludefiles-t $@
rm -f excludefiles-t
+supermin.d/extras.tar.gz: issue
+ rm -f $@ $@-t
+ rm -rf tmp-d
+ mkdir -p tmp-d/etc
+ cp issue tmp-d/etc
+ ( cd tmp-d && tar zcf - * ) > $@-t
+ rm -r tmp-d
+ mv $@-t $@
+
supermin.d/hostfiles: hostfiles.in Makefile
m4 $(PACKAGELIST_CPP_FLAGS) $< | \
grep -v '^[[:space:]]*$$' | grep -v '^#' > hostfiles-t
diff --git a/appliance/init b/appliance/init
index 3816dfd..e549df0 100755
--- a/appliance/init
+++ b/appliance/init
@@ -184,15 +184,8 @@ else
echo "PS1='><rescue> '" >> $HOME/.bashrc
echo "export TERM PS1" >> $HOME/.bashrc
- echo
- echo "------------------------------------------------------------"
- echo
- echo "Welcome to virt-rescue, the libguestfs rescue shell."
- echo
- echo "Note: The contents of / are the rescue appliance."
- echo "You have to mount the guest's partitions under /sysroot"
- echo "before you can examine them."
- echo
+ cat /etc/issue
+
bash -i
echo
echo "virt-rescue: Syncing the disk now before exiting ..."
diff --git a/appliance/issue b/appliance/issue
new file mode 100644
index 0000000..40b8e17
--- /dev/null
+++ b/appliance/issue
@@ -0,0 +1,9 @@
+
+------------------------------------------------------------
+
+Welcome to virt-rescue, the libguestfs rescue shell.
+
+Note: The contents of / are the rescue appliance.
+You have to mount the guest's partitions under /sysroot
+before you can examine them.
+
--
2.6.6
8 years
Plan for libguestfs 1.34
by Richard W.M. Jones
Libguestfs 1.32 was released on 2016-01-06, which is over 6 months
ago. In fact the previous stable version of libguestfs (1.30) was
released on 2015-07-21, almost exactly 12 months ago. Are we heading
for a 6 month release cycle? Not officially. Anyway, I would like
you to think about what needs work for the next stable 1.34 release.
Any new APIs added in the 1.33 cycle will become supported and
guaranteed when we release 1.34, so we need to check those. See:
git diff 1.32.0 -- generator/actions.ml
Please follow-up also if there are features / blockers / bugs that
need to be addressed for 1.34.
As usual, bugs which have "1.34" (without quotes) in the "Devel
Whiteboard" field in Bugzilla are nominated as blockers for the
release. You can see a list of those here (currently empty):
https://bugzilla.redhat.com/buglist.cgi?bug_status=NEW&bug_status=ASSIGNE...
For a list of all bugs, go to:
https://bugzilla.redhat.com/buglist.cgi?component=libguestfs&product=Virt...
Rich.
--
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
Read my programming and virtualization blog: http://rwmj.wordpress.com
virt-p2v converts physical machines to virtual machines. Boot with a
live CD or over the network (PXE) and turn machines into KVM guests.
http://libguestfs.org/virt-v2v
8 years, 3 months
Help
by M.H. Hasan Bhuiyan
Dear sir,
I am a newbie in coding. I am using ubuntu 14.04 in my machine and
installed libguestfs by the following command:
sudo apt-get install libguestfs-tools
I get to run guestfish properly from terminal. But as it happens I
want to write a program in C++ and i want to include the guestfs.h
file in the program. I have tried and searched many options but have
not found any. Is there something I am doing wrong? Can you please
help me getting the file. If you can show me a way then it would be
great cause I have been trying for three days in a row.
Thanks
Hasib
8 years, 4 months
[PATCH] utils: add new CLEANUP_XMLFREE cleanup, to call xmlFree()
by Pino Toscano
Small cleanup helper to dispose xmlChar* buffers.
---
src/cleanup.c | 9 +++++++++
src/guestfs-internal-frontend.h | 4 ++++
2 files changed, 13 insertions(+)
diff --git a/src/cleanup.c b/src/cleanup.c
index 1aa3051..6c4558c 100644
--- a/src/cleanup.c
+++ b/src/cleanup.c
@@ -106,6 +106,15 @@ guestfs_int_cleanup_unlink_free (char **ptr)
}
void
+guestfs_int_cleanup_xmlFree (void *ptr)
+{
+ xmlChar *buf = * (xmlChar **) ptr;
+
+ if (buf)
+ xmlFree (buf);
+}
+
+void
guestfs_int_cleanup_xmlBufferFree (void *ptr)
{
xmlBufferPtr xb = * (xmlBufferPtr *) ptr;
diff --git a/src/guestfs-internal-frontend.h b/src/guestfs-internal-frontend.h
index d1de76d..8689009 100644
--- a/src/guestfs-internal-frontend.h
+++ b/src/guestfs-internal-frontend.h
@@ -43,6 +43,8 @@
__attribute__((cleanup(guestfs_int_cleanup_hash_free)))
#define CLEANUP_UNLINK_FREE \
__attribute__((cleanup(guestfs_int_cleanup_unlink_free)))
+#define CLEANUP_XMLFREE \
+ __attribute__((cleanup(guestfs_int_cleanup_xmlFree)))
#define CLEANUP_XMLBUFFERFREE \
__attribute__((cleanup(guestfs_int_cleanup_xmlBufferFree)))
#define CLEANUP_XMLFREEDOC \
@@ -62,6 +64,7 @@
#define CLEANUP_FREE_STRING_LIST
#define CLEANUP_HASH_FREE
#define CLEANUP_UNLINK_FREE
+#define CLEANUP_XMLFREE
#define CLEANUP_XMLBUFFERFREE
#define CLEANUP_XMLFREEDOC
#define CLEANUP_XMLFREEURI
@@ -109,6 +112,7 @@ extern void guestfs_int_cleanup_free (void *ptr);
extern void guestfs_int_cleanup_free_string_list (char ***ptr);
extern void guestfs_int_cleanup_hash_free (void *ptr);
extern void guestfs_int_cleanup_unlink_free (char **ptr);
+extern void guestfs_int_cleanup_xmlFree (void *ptr);
extern void guestfs_int_cleanup_xmlBufferFree (void *ptr);
extern void guestfs_int_cleanup_xmlFreeDoc (void *ptr);
extern void guestfs_int_cleanup_xmlFreeURI (void *ptr);
--
2.7.4
8 years, 4 months
virt-v2v
by Стаценко Константин Юрьевич
Hello!
Libguestfs in CentOS 7.2 is really old.
When it will be updated to more recent version to support Oracle Linux conversion via virt-v2v, for example ?
Thank you.
8 years, 4 months
[PATCH] build: improve Gtk check
by Pino Toscano
Check the presence of Gtk properly depending on the value of --with-gtk:
if a specific version is chosen, then let PKG_CHECK_MODULES fail if that
version if not found, otherwise fallback from gtk3 to gtk2 to no gtk.
Also move few common AC_SUBST in a single place.
---
m4/guestfs_misc_libraries.m4 | 26 ++++++++++++++------------
1 file changed, 14 insertions(+), 12 deletions(-)
diff --git a/m4/guestfs_misc_libraries.m4 b/m4/guestfs_misc_libraries.m4
index 4ae0576..fee265b 100644
--- a/m4/guestfs_misc_libraries.m4
+++ b/m4/guestfs_misc_libraries.m4
@@ -85,29 +85,31 @@ AC_ARG_WITH([gtk],
AC_MSG_RESULT([not set, will check for installed Gtk])]
)
-if test "x$GTK_LIBS" = "x" && \
- ( test "x$with_gtk" = "x3" || test "x$with_gtk" = "xcheck" ) ; then
+if test "x$with_gtk" = "x3"; then
PKG_CHECK_MODULES([GTK], [gtk+-3.0], [
- AC_SUBST([GTK_CFLAGS])
- AC_SUBST([GTK_LIBS])
GTK_VERSION=3
- AC_SUBST([GTK_VERSION])
- ], [])
-fi
-if test "x$GTK_LIBS" = "x" && \
- ( test "x$with_gtk" = "x2" || test "x$with_gtk" = "xcheck" ) ; then
+ ])
+elif test "x$with_gtk" = "x2"; then
PKG_CHECK_MODULES([GTK], [gtk+-2.0], [
- AC_SUBST([GTK_CFLAGS])
- AC_SUBST([GTK_LIBS])
GTK_VERSION=2
- AC_SUBST([GTK_VERSION])
], [])
+elif test "x$with_gtk" = "xcheck"; then
+ PKG_CHECK_MODULES([GTK], [gtk+-3.0], [
+ GTK_VERSION=3
+ ], [
+ PKG_CHECK_MODULES([GTK], [gtk+-2.0], [
+ GTK_VERSION=2
+ ], [:])
+ ])
fi
dnl Can we build virt-p2v?
AC_MSG_CHECKING([if we can build virt-p2v])
if test "x$GTK_LIBS" != "x"; then
AC_MSG_RESULT([yes, with Gtk $GTK_VERSION])
+ AC_SUBST([GTK_CFLAGS])
+ AC_SUBST([GTK_LIBS])
+ AC_SUBST([GTK_VERSION])
else
AC_MSG_RESULT([no])
fi
--
2.7.4
8 years, 4 months
[PATCH] builder: fix EOF check with flex >= 2.6.1
by Pino Toscano
It looks like flex 2.6.1 changed [1] the return code for EOF in
yyinput. Therefore, use the right value depending on the version of
flex which generates the lexer.
[1] https://github.com/westes/flex/commit/f863c9490e6912ffcaeb12965fb3a567a10...
---
builder/index-scan.l | 12 ++++++++++--
1 file changed, 10 insertions(+), 2 deletions(-)
diff --git a/builder/index-scan.l b/builder/index-scan.l
index d4db826..bdb474b 100644
--- a/builder/index-scan.l
+++ b/builder/index-scan.l
@@ -45,6 +45,14 @@
extern void scanner_init (yyscan_t *scanner, struct parse_context *context, FILE *in);
extern void scanner_destroy (yyscan_t scanner);
+#if (YY_FLEX_MAJOR_VERSION > 2) \
+ || ((YY_FLEX_MAJOR_VERSION == 2) && (YY_FLEX_MINOR_VERSION > 6)) \
+ || ((YY_FLEX_MAJOR_VERSION == 2) && (YY_FLEX_MINOR_VERSION == 6) && (YY_FLEX_SUBMINOR_VERSION >= 1))
+#define IS_EOF 0
+#else
+#define IS_EOF EOF
+#endif
+
%}
%option nounput
@@ -104,7 +112,7 @@ extern void scanner_destroy (yyscan_t scanner);
int c, prevnl = 0;
/* Eat everything to the first blank line. */
- while ((c = input (yyscanner)) != EOF) {
+ while ((c = input (yyscanner)) != IS_EOF) {
if (c == '\n' && prevnl)
break;
prevnl = c == '\n';
@@ -116,7 +124,7 @@ extern void scanner_destroy (yyscan_t scanner);
/* Hack to eat the PGP epilogue. */
^"-----BEGIN PGP SIGNATURE-----\n" {
/* Eat everything to the end of the file. */
- while (input (yyscanner) != EOF)
+ while (input (yyscanner) != IS_EOF)
;
return PGP_EPILOGUE;
--
2.7.4
8 years, 4 months
[PATCH 0/5] Improve LVM handling in the appliance
by Pino Toscano
Hi,
this series improves the way LVM is used in the appliance: in
particular, now lvmetad can eventually run at all, and with the correct
configuration.
Also improve the listing strategies.
Thanks,
Pino Toscano (5):
daemon: lvm-filter: set also global_filter
daemon: lvm-filter: start lvmetad better
daemon: lvm: improve filter for LVs with activationskip flag set
daemon: lvm: list PVs/VGs/LVs with --foreign
appliance: run systemd-tmpfiles also for /run
appliance/init | 3 +--
daemon/lvm-filter.c | 43 +++++++++++++++++++++++++++++++++++++++----
daemon/lvm.c | 14 ++++++++------
generator/daemon.ml | 1 +
4 files changed, 49 insertions(+), 12 deletions(-)
--
2.7.4
8 years, 4 months
[PATCH v2 0/4] Improve LVM handling in the appliance
by Pino Toscano
Hi,
this series improves the way LVM is used in the appliance: in
particular, now lvmetad can eventually run at all, and with the correct
configuration.
Also improve the listing strategies.
Changes in v2:
- dropped patch #5, will be sent separately
- move lvmetad statup in own function (patch #2)
Thanks,
Pino Toscano (4):
daemon: lvm-filter: set also global_filter
daemon: lvm-filter: start lvmetad better
daemon: lvm: improve filter for LVs with activationskip flag set
appliance: run systemd-tmpfiles also for /run
appliance/init | 3 +--
daemon/daemon.h | 1 +
daemon/guestfsd.c | 4 +++-
daemon/lvm-filter.c | 50 ++++++++++++++++++++++++++++++++++++++++++++++----
daemon/lvm.c | 4 ++--
5 files changed, 53 insertions(+), 9 deletions(-)
--
2.7.4
8 years, 4 months
[PATCH] daemon: lvm: change the separator character to '\r'
by Pino Toscano
Commit b91b39e06ab7eb9b9b06c8b4dfef2ef9f381ab19 changed the separator to
':', although this creates parsing issues when there are fields with
colons (for example lv_tags=imgbased:pool).
Change once more the separator, but this time using a non-printable
character such as '\r': while it will produce uglier debug logs, this
should greatly reduce the possibilities of conflicts with texts of
metadata.
---
generator/daemon.ml | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/generator/daemon.ml b/generator/daemon.ml
index d8dc9cf..1d79126 100644
--- a/generator/daemon.ml
+++ b/generator/daemon.ml
@@ -563,7 +563,7 @@ cleanup_free_mountable (mountable_t *mountable)
pr " fprintf (stderr, \"%%s: failed: string finished early, around token %%s\\n\", __func__, \"%s\");\n" name;
pr " return -1;\n";
pr " }\n";
- pr " p = strchrnul (tok, ':');\n";
+ pr " p = strchrnul (tok, '\\r');\n";
pr " if (*p) next = p+1; else next = NULL;\n";
pr " *p = '\\0';\n";
(match coltype with
@@ -633,7 +633,7 @@ cleanup_free_mountable (mountable_t *mountable)
pr " r = command (&out, &err,\n";
pr " \"lvm\", \"%ss\",\n" typ;
pr " \"-o\", lvm_%s_cols, \"--unbuffered\", \"--noheadings\",\n" typ;
- pr " \"--nosuffix\", \"--separator\", \":\", \"--units\", \"b\", NULL);\n";
+ pr " \"--nosuffix\", \"--separator\", \"\\r\", \"--units\", \"b\", NULL);\n";
pr " if (r == -1) {\n";
pr " reply_with_error (\"%%s\", err);\n";
pr " free (out);\n";
--
2.7.4
8 years, 4 months