[PATCH] launch: switch from -nographic to -display none
by Pino Toscano
The latter is a better way to disable the qemu display output as we
need to, without enabling extra devices (which are disabled already,
anyway).
Also, related to the change above, ban the -display parameter from the
ones that can be supplied by the user.
---
configure.ac | 8 ++++----
src/launch-direct.c | 12 ++++++++----
src/launch.c | 1 +
3 files changed, 13 insertions(+), 8 deletions(-)
diff --git a/configure.ac b/configure.ac
index ae676c4..eb0e493 100644
--- a/configure.ac
+++ b/configure.ac
@@ -797,16 +797,16 @@ working.
AC_MSG_FAILURE([$QEMU version must be >= 1.0.])
fi
- AC_MSG_CHECKING([that $QEMU -nographic -machine accel=kvm:tcg -device ? works])
- if $QEMU -nographic -machine accel=kvm:tcg -device \? >&AS_MESSAGE_LOG_FD 2>&1; then
+ AC_MSG_CHECKING([that $QEMU -display none -machine accel=kvm:tcg -device ? works])
+ if $QEMU -display none -machine accel=kvm:tcg -device \? >&AS_MESSAGE_LOG_FD 2>&1; then
AC_MSG_RESULT([yes])
else
AC_MSG_RESULT([no])
- AC_MSG_FAILURE([$QEMU -nographic -machine accel=kvm:tcg -device ? doesn't work.])
+ AC_MSG_FAILURE([$QEMU -display none -machine accel=kvm:tcg -device ? doesn't work.])
fi
AC_MSG_CHECKING([for virtio-serial support in $QEMU])
- if $QEMU $QEMU_OPTIONS -nographic -machine accel=kvm:tcg -device \? 2>&1 | grep -sq virtio-serial; then
+ if $QEMU $QEMU_OPTIONS -display none -machine accel=kvm:tcg -device \? 2>&1 | grep -sq virtio-serial; then
AC_MSG_RESULT([yes])
else
AC_MSG_RESULT([no])
diff --git a/src/launch-direct.c b/src/launch-direct.c
index 8d0d8ce..f45f582 100644
--- a/src/launch-direct.c
+++ b/src/launch-direct.c
@@ -349,7 +349,8 @@ launch_direct (guestfs_h *g, void *datav, const char *arg)
if (qemu_supports (g, data, "-nodefaults"))
ADD_CMDLINE ("-nodefaults");
- ADD_CMDLINE ("-nographic");
+ ADD_CMDLINE ("-display");
+ ADD_CMDLINE ("none");
#ifdef MACHINE_TYPE
ADD_CMDLINE ("-M");
@@ -918,7 +919,8 @@ test_qemu (guestfs_h *g, struct backend_direct_data *data)
data->qemu_devices = NULL;
guestfs___cmd_add_arg (cmd1, g->hv);
- guestfs___cmd_add_arg (cmd1, "-nographic");
+ guestfs___cmd_add_arg (cmd1, "-display");
+ guestfs___cmd_add_arg (cmd1, "none");
guestfs___cmd_add_arg (cmd1, "-help");
guestfs___cmd_set_stdout_callback (cmd1, read_all, &data->qemu_help,
CMD_STDOUT_FLAG_WHOLE_BUFFER);
@@ -927,7 +929,8 @@ test_qemu (guestfs_h *g, struct backend_direct_data *data)
goto error;
guestfs___cmd_add_arg (cmd2, g->hv);
- guestfs___cmd_add_arg (cmd2, "-nographic");
+ guestfs___cmd_add_arg (cmd2, "-display");
+ guestfs___cmd_add_arg (cmd2, "none");
guestfs___cmd_add_arg (cmd2, "-version");
guestfs___cmd_set_stdout_callback (cmd2, read_all, &data->qemu_version,
CMD_STDOUT_FLAG_WHOLE_BUFFER);
@@ -938,7 +941,8 @@ test_qemu (guestfs_h *g, struct backend_direct_data *data)
parse_qemu_version (g, data);
guestfs___cmd_add_arg (cmd3, g->hv);
- guestfs___cmd_add_arg (cmd3, "-nographic");
+ guestfs___cmd_add_arg (cmd3, "-display");
+ guestfs___cmd_add_arg (cmd3, "none");
guestfs___cmd_add_arg (cmd3, "-machine");
guestfs___cmd_add_arg (cmd3, "accel=kvm:tcg");
guestfs___cmd_add_arg (cmd3, "-device");
diff --git a/src/launch.c b/src/launch.c
index 60f6811..9c1c33a 100644
--- a/src/launch.c
+++ b/src/launch.c
@@ -295,6 +295,7 @@ guestfs__config (guestfs_h *g,
if (STREQ (hv_param, "-kernel") ||
STREQ (hv_param, "-initrd") ||
STREQ (hv_param, "-nographic") ||
+ STREQ (hv_param, "-display") ||
STREQ (hv_param, "-serial") ||
STREQ (hv_param, "-full-screen") ||
STREQ (hv_param, "-std-vga") ||
--
1.8.3.1
10 years, 10 months
[PATCH] sysprep: remove more anaconda and tuned logs (RHBZ#1039540).
by Pino Toscano
---
sysprep/sysprep_operation_logfiles.ml | 3 +++
1 file changed, 3 insertions(+)
diff --git a/sysprep/sysprep_operation_logfiles.ml b/sysprep/sysprep_operation_logfiles.ml
index 8994af9..3055ca4 100644
--- a/sysprep/sysprep_operation_logfiles.ml
+++ b/sysprep/sysprep_operation_logfiles.ml
@@ -41,6 +41,7 @@ let globs = List.sort compare [
"/var/log/apache2/*_log";
"/var/log/apache2/*_log-*";
"/var/log/ntp";
+ "/var/log/tuned/tuned.log";
(* logfiles configured by /etc/logrotate.d/* *)
"/var/log/BackupPC/LOG";
@@ -66,6 +67,8 @@ let globs = List.sort compare [
"/root/install.log";
"/root/install.log.syslog";
"/root/anaconda-ks.cfg";
+ "/root/anaconda-post.log";
+ "/var/log/anaconda.syslog";
(* GDM and session preferences. *)
"/var/cache/gdm/*";
--
1.8.3.1
10 years, 10 months
[PATCH 1/2] Fix installing man-pages from out-of-tree build
by Hilko Bengen
---
po-docs/ja/Makefile.am | 6 +++---
po-docs/uk/Makefile.am | 6 +++---
2 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/po-docs/ja/Makefile.am b/po-docs/ja/Makefile.am
index da1bcc3..820f91a 100644
--- a/po-docs/ja/Makefile.am
+++ b/po-docs/ja/Makefile.am
@@ -160,8 +160,8 @@ $(podfiles):
# XXX Can automake do this properly?
install-data-hook:
$(MKDIR_P) $(DESTDIR)$(mandir)/$(LINGUA)/man1
- $(INSTALL) -m 0644 *.1 $(DESTDIR)$(mandir)/$(LINGUA)/man1
+ $(INSTALL) -m 0644 $(srcdir)/*.1 $(DESTDIR)$(mandir)/$(LINGUA)/man1
$(MKDIR_P) $(DESTDIR)$(mandir)/$(LINGUA)/man3
- $(INSTALL) -m 0644 *.3 $(DESTDIR)$(mandir)/$(LINGUA)/man3
+ $(INSTALL) -m 0644 $(srcdir)/*.3 $(DESTDIR)$(mandir)/$(LINGUA)/man3
$(MKDIR_P) $(DESTDIR)$(mandir)/$(LINGUA)/man5
- $(INSTALL) -m 0644 *.5 $(DESTDIR)$(mandir)/$(LINGUA)/man5
+ $(INSTALL) -m 0644 $(srcdir)/*.5 $(DESTDIR)$(mandir)/$(LINGUA)/man5
diff --git a/po-docs/uk/Makefile.am b/po-docs/uk/Makefile.am
index da1bcc3..820f91a 100644
--- a/po-docs/uk/Makefile.am
+++ b/po-docs/uk/Makefile.am
@@ -160,8 +160,8 @@ $(podfiles):
# XXX Can automake do this properly?
install-data-hook:
$(MKDIR_P) $(DESTDIR)$(mandir)/$(LINGUA)/man1
- $(INSTALL) -m 0644 *.1 $(DESTDIR)$(mandir)/$(LINGUA)/man1
+ $(INSTALL) -m 0644 $(srcdir)/*.1 $(DESTDIR)$(mandir)/$(LINGUA)/man1
$(MKDIR_P) $(DESTDIR)$(mandir)/$(LINGUA)/man3
- $(INSTALL) -m 0644 *.3 $(DESTDIR)$(mandir)/$(LINGUA)/man3
+ $(INSTALL) -m 0644 $(srcdir)/*.3 $(DESTDIR)$(mandir)/$(LINGUA)/man3
$(MKDIR_P) $(DESTDIR)$(mandir)/$(LINGUA)/man5
- $(INSTALL) -m 0644 *.5 $(DESTDIR)$(mandir)/$(LINGUA)/man5
+ $(INSTALL) -m 0644 $(srcdir)/*.5 $(DESTDIR)$(mandir)/$(LINGUA)/man5
--
1.8.5.1
10 years, 11 months
[PATCH] builder: translate more user-visible strings
by Pino Toscano
Translate also the "OS version" and "Notes" strings that appear in the
--long output.
---
builder/list_entries.ml | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/builder/list_entries.ml b/builder/list_entries.ml
index 8c24fe2..a1d0696 100644
--- a/builder/list_entries.ml
+++ b/builder/list_entries.ml
@@ -47,7 +47,7 @@ let list_entries ?(list_long = false) ~sources index =
printf "\n"
)
else ( (* Long *)
- printf "%-24s %s\n" "os-version:" name;
+ printf "%-24s %s\n" (s_"OS version:") name;
(match printable_name with
| None -> ()
| Some name -> printf "%-24s %s\n" (s_"Full name:") name;
@@ -62,7 +62,7 @@ let list_entries ?(list_long = false) ~sources index =
| None -> ()
| Some notes ->
printf "\n";
- printf "Notes:\n\n%s\n" notes
+ printf (f_"Notes:\n\n%s\n") notes
);
printf "\n"
)
--
1.8.3.1
10 years, 11 months
Use of qemu-kvm command line arguments in libguestfs (was: Re: Fwd: ...)
by Richard W.M. Jones
[Moving this thread over to the public mailing list]
On Mon, Dec 02, 2013 at 01:17:09AM +0100, Pino Toscano wrote:
> On Friday 29 November 2013 18:53:38 you wrote:
> > > > I'm marking options with NONE (not used at all), or M (used in
> > > > master) and/or RH7 (used in rhel-7.0).
> > > >
> > > > > * -nographic
> > > >
> > > > M + RH7
> > > > I guess that could be changed into (roughly)
> > > >
> > > > if (qemu_supports (g, data, "-display"))
> > > > { ADD_CMDLINE ("-display"); ADD_CMDLINE ("none"); }
> > > > else
> > > >
> > > > ADD_CMDLINE ("-nographic");
> > >
> > > Yup, something like that should work. Did you have a look at the
> > > qemu code to find out what other side-effects -nographic has? Are
> > > they important side-effects?
>
> It seems most of the effects are related to the default devices (serial,
> parallel, vrtcon, etc) that are added; OTOH, we always use -nodefaults
> so those are not added, so at least there should be no difference from
> this p.o.v.
>
> The other changes related to the use of nographics are in few target-
> related places:
> - in lm32 hardware (milkymist-tmu2), no display device is created when
> the display type is "nographics" (but it is when the type is "none"?
> hmm..)
> - in nvram support, the FW_CFG_NOGRAPHIC bit is set to 1 if the display
> is "nographics", while 0 otherwise
> - in sparc (not sparc64 though, it seems), the ESCC serial device is
> created disabled if the display type is "nographics", while enabled
> otherwise
>
> I'm not totally sure about these architecture-specific bits, but at
> least from a quick glance it could be relatively safe to make
> "-display none" preferred over -nographics, at it seems more like
> "device graphics is enabled (as if it was SDL, curses, etc), just with
> no output at all)".
It sounds fine, as long as qemu 1.2 had "-display none".
> I will ask to the qemu people whether these behaviour differences
> actually matter or not (at least for libguestfs).
I'd be surprised if you get an answer ...
> > > > > * -serial
> > > >
> > > > M + RH7, "-serial stdio"
> > >
> > > We could think about using virtio-console instead of -serial.
> > > Virtio-console would be faster and have lower overhead than
> > > continuing to use the 16550 serial port emulation. This would be
> > > something to do upstream first, get it right, fix the bugs, then
> > > add it to RHEL 7.x later.
> >
> > Yes, I saw the commented code for it, but I did not have the time to
> > investigate it yet.
>
> I see you added it (as commented code) in 866ec00d, but no indication
> why it was not actually used (other than a comment hinting about not
> working it yet). Do you have any pointers about it already?
TBH I don't remember. That commit dates from early 2010, which was
about the same time that virtio-serial/virtio-console was being
written by Amit. Possibly virtio-console just didn't work then. If
it works, we should use it because it should be much more efficient.
16550 has a 16 byte (virtual) FIFO so the host is constantly
interrupted when the guest writes log messages.
Note that the src/conn-socket.c code could be affected for reasons
that may not be obvious. Since libguestfs handles are synchronous,
that code only reads log messages when we're waiting to read a reply
from the daemon. Since log messages are sent by qemu in small chunks
(because of the small emulated FIFO), log messages generally appear
before the reply message, and usually are not lost if the appliance is
killed/closes/crashes. That's nice for debugging. It also explains
why there is an odd 1-millisecond sleep in that code.
That might not happen if we use virtio-console that probably uses
virtio-sized (huge) buffers.
> This poses me another question: should we review all the qemu command
> line options and unconditionally drop the support for qemu < 1.2, or
> touch them just like in cases like this one (i.e. when some of them is
> mentioned/superseded/etc)?
It sounds like a lot of work, but if you want to do it.
> > > > > * -nodefconfig
> > > >
> > > > M + RH7, if available
> > >
> > > qemu has a load of unhelpful built-in devices. This avoids using
> > > them, so it's a good thing from our p.o.v.
>
> Ah, I guess you are confusing this with -nodefaults (which we pass if
> available): -nodefconfig this just disables the loading of
> qemu.conf/qemu-$target.conf configuration files.
Correct.
Rich.
--
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
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, 11 months
Using guestfs to debug kernel
by Teto
Hi,
I would like to use libguestfs to help me setup a VM that I run later
with qemu to debug my linux kernel (via qemu -kernel <mykernel>
-append ...).
One problem I face for instance is that my VM lacks the modules
matching my kernel version. So what would you consider as the best
option here to load the modules for the kernel ?
Should I upload the modules from the host to the VM /lib/modules (need
to tar this fodler and upload it via tar_in ?!) ? Or can I access my
/lib/modules over the network via a specific initramfs ?
I am quite open to any suggestion, I've already got the libguestfs
python binding working.
Best Regards
Matt
10 years, 11 months
[PATCH] launch: direct: Pass -enable-fips option if qemu supports it.
by Richard W.M. Jones
From: "Richard W.M. Jones" <rjones(a)redhat.com>
---
src/launch-direct.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/src/launch-direct.c b/src/launch-direct.c
index f06bb23..58e4b1a 100644
--- a/src/launch-direct.c
+++ b/src/launch-direct.c
@@ -328,6 +328,13 @@ launch_direct (guestfs_h *g, void *datav, const char *arg)
ADD_CMDLINE (VIRTIO_BLK ".scsi=off");
}
+ /* This oddly named option doesn't actually enable FIPS. It just
+ * causes qemu to do the right thing if FIPS is enabled in the
+ * kernel. So like libvirt, we pass it unconditionally.
+ */
+ if (qemu_supports (g, data, "-enable-fips"))
+ ADD_CMDLINE ("-enable-fips");
+
if (qemu_supports (g, data, "-nodefconfig"))
ADD_CMDLINE ("-nodefconfig");
--
1.8.3.1
10 years, 11 months
[PATCH 0/3] Small improvements to i18n extraction/handling
by Pino Toscano
Hi,
here there are few patches to improve the extraction of translatable
messages, and the usage of messages with plural forms.
Pino Toscano (3):
po: fix broken message extraction
po: fix dependencies for libguestfs.pot extraction
fish: improve the command error messages
generator/fish.ml | 20 ++++++++++++++++----
po/Makefile.am | 24 +++++++-----------------
2 files changed, 23 insertions(+), 21 deletions(-)
Thanks,
--
Pino Toscano
--
1.8.3.1
10 years, 11 months
Regression testing inspection code
by Richard W.M. Jones
[Continuing a discussion we had on IRC last week ...]
How to create meaningful regression tests for the inspection code?
We'd like developers to be able to test that changes to the inspection
code don't break inspection of existing guests. We might not be able
to run these tests routinely, and we might have to accept that they
have to download hundreds of megabytes of test data.
Idea #1: Run virt-inspector on cloud images
----------------------------------------------------------------------
eg:
virt-inspector -a http://download.fedoraproject.org/pub/fedora/linux/releases/19/Images/x86...
Unfortunately this doesn't work for a couple of reasons. Firstly the
Curl driver in qemu is broken (RHBZ#971790). Secondly even when I
implemented a workaround, the command above doesn't work reliably when
connecting to a slow mirror, because of SCSI timeouts inside the
appliance.
Idea #2: Make "reduced" test images available
----------------------------------------------------------------------
Delete bits of real test images so they are small enough to
distribute. Inspection doesn't look at the vast majority of files in
a test image. The hard bit is working out which bits inspection
*does* need to look at, either now or in the future.
I wrote a small program to test this. Unfortunately it doesn't reduce
images that much. We'd still be talking about ~50-100MB to host +
distribute per test case, and we'd ideally want >20 test cases so
that's still multiple gigabytes of test data.
I've attached the program to this email in case anyone wants to look
at this further.
Any other ideas ...?
Rich.
--
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
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, 11 months