Commit Graph

398 Commits

Author SHA1 Message Date
Jan Kiszka 4091da4b7c Add dependency of JSON unit tests on config-host.h
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-06-01 12:53:09 -05:00
Corentin Chary 380282b07d vnc: add basic tight support
Add support for tight encoding [1]. This patch only add support
for "basic" tight compression without any filter.

[1] http://tigervnc.org/cgi-bin/rfbproto#tight-encoding.

Signed-off-by: Corentin Chary <corentincj@iksaif.net>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-06-01 12:53:09 -05:00
Stuart Brady 4c0a6db01b Fix tarbin Makefile rule
The 'tarbin' Makefile rule doesn't include qemu-system-sparc64, but
should do, now that sparc64-softmmu is in the default target list.

The rule attempts to tar up binaries that were not built if a target
list was passed to the configure script -- in which case, it will
either fail, or otherwise include binaries from previous builds.

Fix both problems once and for all by building a list of binaries to
include in the tarball, using the list of targets to be built.

Signed-off-by: Stuart Brady <sdb@zubnet.me.uk>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-05-22 08:36:07 +00:00
Alexander Graf fe270d044d target-s390: add firmware code
This patch adds a firmware blob to the S390 target. The blob is a simple
implementation of a virtio client that tries to read the second stage
bootloader from sectors described as of offset 0x20 in the MBR.

In combination with an updated zipl this allows for booting from virtio
block devices. This firmware is built from the same sources as the second
stage bootloader. You can find a virtio capable s390-tools in this repo:

git://repo.or.cz/s390-tools.git

Signed-off-by: Alexander Graf <agraf@suse.de>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2010-05-18 21:12:48 +02:00
Corentin Chary 70a4568fe0 vnc: split encoding in specific files
This will allow to implement new encodings (tight, zrle, ..)
in a cleaner way. This may hurt performances, because some
functions like vnc_convert_pixel are not static anymore, but
should not be a problem with gcc 4.5 and the new -flto.

Signed-off-by: Corentin Chary <corentincj@iksaif.net>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-05-03 12:09:47 -05:00
Amit Shah e4d5639dbb iov: Introduce a new file for helpers around iovs, add iov_from_buf()
The virtio-net code uses iov_fill() which fills an iov from a linear
buffer. The virtio-serial-bus code does something similar in an
open-coded function.

Create a new iov.c file that has iov_from_buf().

Convert virtio-net and virtio-serial-bus over to use this functionality.
virtio-net used ints to hold sizes, the new function is going to use
size_t types.

Later commits will add the opposite functionality -- going from an iov
to a linear buffer.

Signed-off-by: Amit Shah <amit.shah@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-04-28 08:58:22 -05:00
Markus Armbruster 526f0ac153 error: Link qemu-img, qemu-nbd, qemu-io with qemu-error.o
The location tracking interface is used by code shared with qemi-img,
qemu-nbd and qemu-io, so it needs to be available there.  Commit
827b0813 provides it in a rather hamfisted way: it adds a dummy
implementation to qemu-tool.c.

It's cleaner to provide the real thing, and put a few more dummy
monitor functions into qemu-tool.c.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2010-03-27 14:30:38 +01:00
Blue Swirl 4d9045339a Compile disassemblers only once
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-03-21 08:28:47 +00:00
Andre Przywara 990caaf19c install: honor DESTDIR on sysconfdir population
When creating and populating $sysconfdir, we should prepend $DESTDIR
as we do with all other paths.

Reported-by: Frank Arnold <frank.arnold@amd.com>
Signed-off-by: Andre Przywara <andre.przywara@amd.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2010-03-13 12:09:25 +01:00
Stefan Weil 01668d98a3 Documentation: Modify rule for html output (better looking output format)
To create html output from texi input, texi2html was used.
Output from makeinfo looks cleaner, so replace the old rule
and use makeinfo now.

For those who want to use their own variant of html output,
the macros MAKEINFO and MAKEINFOFLAGS allow customisation.
Option "-I ." is not needed (the current directory is
searched by default), so remove it.

Please note that the build requirements changed, too:
makeinfo is required for doc builds.
texi2html is no longer used.

Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2010-03-06 23:07:09 +01:00
Stefan Weil 5309e5fbbe Makefile: Fix names of GPXE ROM files
da51e79b7f added two new ROM files
and removed an old one for eepro100.c.

These changes were missing in Makefile (which resulted
in a broken "make install").

Reported by Lucas Meneghel Rodrigues, thanks.

Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-03-04 14:54:53 -06:00
Amit Shah 9e0a5d5495 Fix 'make install' from non-srcdir build
Commit b5ec5ce0 broke 'make install' from non source-dir build. Fix.

Signed-off-by: Amit Shah <amit.shah@redhat.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2010-02-27 16:10:46 +01:00
john cooper b5ec5ce0e3 Add cpu model configuration support..
This is a reimplementation of prior versions which adds
the ability to define cpu models for contemporary processors.
The added models are likewise selected via -cpu <name>,
and are intended to displace the existing convention
of "-cpu qemu64" augmented with a series of feature flags.

A primary motivation was determination of a least common
denominator within a given processor class to simplify guest
migration.  It is still possible to modify an arbitrary model
via additional feature flags however the goal here was to
make doing so unnecessary in typical usage.  The other
consideration was providing models names reflective of
current processors.  Both AMD and Intel have reviewed the
models in terms of balancing generality of migration vs.
excessive feature downgrade relative to released silicon.

This version of the patch replaces the prior hard wired
definitions with a configuration file approach for new
models.  Existing models are thus far left as-is but may
easily be transitioned to (or may be overridden by) the
configuration file representation.

Proposed new model definitions are provided here for current
AMD and Intel processors.  Each model consists of a name
used to select it on the command line (-cpu <name>), and a
model_id which corresponds to a least common denominator
commercial instance of the processor class.

A table of names/model_ids may be queried via "-cpu ?model":

        :
    x86       Opteron_G3  AMD Opteron 23xx (Gen 3 Class Opteron)
    x86       Opteron_G2  AMD Opteron 22xx (Gen 2 Class Opteron)
    x86       Opteron_G1  AMD Opteron 240 (Gen 1 Class Opteron)
    x86          Nehalem  Intel Core i7 9xx (Nehalem Class Core i7)
    x86           Penryn  Intel Core 2 Duo P9xxx (Penryn Class Core 2)
    x86           Conroe  Intel Celeron_4x0 (Conroe/Merom Class Core 2)
        :

Also added is "-cpu ?dump" which exhaustively outputs all config
data for all defined models, and "-cpu ?cpuid" which enumerates
all qemu recognized CPUID feature flags.

The pseudo cpuid flag 'check' when added to the feature flag list
will warn when feature flags (either implicit in a cpu model or
explicit on the command line) would have otherwise been quietly
unavailable to a guest:

    # qemu-system-x86_64 ... -cpu Nehalem,check
    warning: host cpuid 0000_0001 lacks requested flag 'sse4.2|sse4_2' [0x00100000]
    warning: host cpuid 0000_0001 lacks requested flag 'popcnt' [0x00800000]

A similar 'enforce' pseudo flag exists which in addition
to the above causes qemu to error exit if requested flags are
unavailable.

Configuration data for a cpu model resides in the target config
file which by default will be installed as:

    /usr/local/etc/qemu/target-<arch>.conf

The format of this file should be self explanatory given the
definitions for the above six models and essentially mimics
the structure of the static x86_def_t x86_defs.

Encoding of cpuid flags names now allows aliases for both the
configuration file and the command line which reconciles some
Intel/AMD/Linux/Qemu naming differences.

This patch was tested relative to qemu.git.

Signed-off-by: john cooper <john.cooper@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-02-22 16:16:17 -06:00
Stefan Weil 20cc99972c Documentation: Add build support for documentation in pdf format
Makefile already supported dvi, html and info formats,
but pdf was missing.

pdf is especially convenient for printing and for
documentation reviews. I hope it will help to
improve qemu's documentation.

Make now supports the new target 'pdf' which will
create qemu-doc.pdf and qemu-tech.pdf. It is also
possible to build both files individually.

texi2pdf and texi2dvi are rather noisy, so normally
some less important warnings are suppressed.
When make is called with V=1 (verbose mode),
warnings are not suppressed.

The patch also sorts the documentation targets
alphabetically and wraps a line which was too long.

Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-02-10 11:56:56 -06:00
Markus Armbruster acc3b0336c QDict: New qdict_get_double()
Helper function just like qdict_get_int(), just for QFloat/double.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-02-03 12:36:25 -06:00
Juan Quintela 3c089e15b6 Fix generation of config-host.h
This patch improves Anthony patch a6a853c862

Once there, it improves handling of object files for qemu tools

cc: Andreas Färber <andreas.faerber@web.de>
Signed-off-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-01-26 15:42:02 -06:00
Anthony Liguori a6a853c862 make: qemu-img depends on config-host.h
Fixes mingw32 build out of tree.

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-01-20 10:09:35 -06:00
Stefan Weil b88bc808ea Makefile: Fix message for missing configure
When make is called without a valid configuration,
it should tell the user what to do.

Revision 0e8c9214ba
was a regression which resulted in a message
which was no longer user friendly
(reported by Aurelien Jarno).

This patch restores the old behaviour.

Cc: Aurelien Jarno <aurelien@aurel32.net>
Reviewed-by: Andreas Färber <afaerber@opensolaris.org>
Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2010-01-14 20:01:19 +01:00
Paolo Bonzini 59bc10ee01 finish VPATH -> vpath translation
This adds a few more vpath suffixes and points the remaining two paths
explicitly to $(SRC_PATH) in order to eliminate the VPATH assignment
from config-host.mak.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Cc: Juan Quintela <quintela@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-01-08 16:55:03 -06:00
Blue Swirl 25d0ae900f Makefile: remove obsolete libuser.a rule
libuser.a was removed by 0e8c9214ba.

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-01-08 19:54:10 +00:00
Stefan Weil 012f087923 Makefile: Update unmodified config-devices.mak automatically
This makes rebuilds after source updates easier
for most users (who don't edit config-devices.mak).

Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-01-08 09:58:40 -06:00
Paolo Bonzini 076d247142 Use vpath directive
The vpath directive has two advantages over the VPATH variable:
1) it allows to skip searching of .o files; 2) the default semantics
are to append to the vpath, so there is no confusion between "VPATH=xyz"
and "VPATH+=xyz".

Since "vpath %.c %.h PATH" is not valid, I'm introducing a wrapper
macro to append one or more directories to the vpath.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-01-08 09:58:40 -06:00
Andreas Färber 0e8c9214ba Drop --whole-archive and static libraries
Juan has contributed a cool Makefile infrastructure that enables us to drop
static libraries completely:

Move shared obj-y definitions to Makefile.objs, prefixed {common-,hw-,user-},
and link those object files directly into the executables.

Replace HWLIB by HWDIR, specifying only the directory.

Drop --whole-archive and ARLIBS in Makefiles and configure.

Drop GENERATED_HEADERS dependency in rules.mak, since this rebuilds all
common objects after generating a target-specific header; add dependency
rules to Makefile and Makefile.target instead.

v2:
- Don't try to include /config.mak for user emulators
- Changes to user object paths ("Quickfix for libuser.a drop") were obsoleted
  by "user_only: compile everything with -fpie" (Kirill A. Shutemov)

v3:
- Fix dependency modelling for tools
- Remove comment on GENERATED_HEADERS obsoleted by this patch

Signed-off-by: Andreas Färber <afaerber@opensolaris.org>
Cc: Blue Swirl <blauwirbel@gmail.com>
Cc: Palle Lyckegaard <palle@lyckegaard.dk>
Cc: Ben Taylor <bentaylor.solx86@gmail.com>
Cc: Juan Quintela <quintela@trasno.org>
Cc: Kirill A. Shutemov <kirill@shutemov.name>
Cc: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-01-07 18:08:53 +00:00
Juergen Lock c1bb0dcef2 Fix a make -j race
Make libuser.a depend on $(GENERATED_HEADERS) too so make -j won't start
building it before the headers exist.  (There may be more bugs like this
but at least this makes (g)make -j4 started from scratch on a quadcore
now always complete here again.)

Signed-off-by: Juergen Lock <nox@jelal.kn-bremen.de>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2009-12-17 18:27:07 +01:00
Luiz Capitulino d15e546567 block: Convert bdrv_info() to QObject
Each block device information is stored in a QDict and the
returned QObject is a QList of all devices.

This commit should not change user output.

Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-12-12 07:59:49 -06:00
Luiz Capitulino f2e1750803 QDict: Introduce qdict_get_qlist()
A helper function to get a QList from a QDict.

Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-12-12 07:59:46 -06:00
Luiz Capitulino cd4dde36ae QDict: Introduce qdict_get_qbool()
This is a helper function that does type checking before retrieving
a QBool from the dictionary.

Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-12-12 07:59:45 -06:00
Luiz Capitulino 2a01000f7d Makefile: move QObject objs to their own entry
Other subsystems will need to link against them.

Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-12-12 07:59:45 -06:00
Stefan Weil 01d86a8544 Fix build for mingw32 on windows ($$ expansion)
Make using mingw32 on windows fails when running grep "=y$$".
The command is expanded to grep "=y$ and the missing "
results in an error.

I don't expect a file config-devices.mak with =y somewhere in
the middle of a line (they are always at the end of the line),
so simplifying the regular expression to =y seems to be permitted.

This avoids problems with wrong expansion.

Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-12-03 15:25:59 -06:00
Mark McLoughlin f1d078c341 net: move parse_macaddr() to net/util.[ch]
Signed-off-by: Mark McLoughlin <markmc@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-12-03 09:41:34 -06:00
Mark McLoughlin 1abecf77d8 net: move dump backend code from net.c to net/dump.c
Signed-off-by: Mark McLoughlin <markmc@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-12-03 09:41:28 -06:00
Mark McLoughlin 42281ac9a3 net: move socket backend code from net.c to net/socket.c
Signed-off-by: Mark McLoughlin <markmc@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-12-03 09:41:28 -06:00
Mark McLoughlin 5c361cc322 net: move vde code from net.c to net/vde.c
Signed-off-by: Mark McLoughlin <markmc@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-12-03 09:41:28 -06:00
Mark McLoughlin 68ac40d2c6 net: move slirp code from net.c to net/slirp.c
Signed-off-by: Mark McLoughlin <markmc@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-12-03 09:41:27 -06:00
Luiz Capitulino 9f9daf9a63 Introduce QError
QError is a high-level data type which represents an exception
in QEMU, it stores the following error information:

- class          Error class name (eg. "ServiceUnavailable")
- description    A detailed error description, which can contain
                 references to run-time error data
- filename       The file name of where the error occurred
- line number    The exact line number of the error
- function       The function name of where the error occurred
- run-time data  Any run-time error data

Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-12-03 09:41:20 -06:00
Stefan Weil a73e8e4309 Makefile: Remove unneeded prerequisites
Thanks to f527c57935
(fix parallel build), these prerequisites
are redundant now and can be removed.

Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-12-02 08:47:07 -06:00
Stefan Weil 63e86b2e13 Makefile: Fix spelling
Replace defconfing -> defconfig

Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2009-11-24 19:53:50 +01:00
Paul Brook 1dfe3943e9 DS1338 RTC
Implement MAXIM SD1338 RTC+NVRAM.

Signed-off-by: Paul Brook <paul@codesourcery.com>
2009-11-22 21:27:40 +00:00
Paul Brook a992fe3d0f Makefile dependencies for device configs
Add makefile dependencies for target specific device configs.
These will copy the default config if none exists, obsoleting the old
configure time code.  If a config already exists but is older than the
default then print a warning.

Also remove config-devices.h.  Code does not and should not care which
devices are being built.

Signed-off-by: Paul Brook <paul@codesourcery.com>
2009-11-22 21:24:54 +00:00
Alexander Graf cfc6d90a98 Add linuxboot to BLOBS
We should install linuxboot.bin too, so let's add it to the to-be-installed
blobs.

Signed-off-by: Alexander Graf <agraf@suse.de>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-11-17 10:39:03 -06:00
Anthony Liguori 422c46a81d Add a unit test for JSON support
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-11-17 08:49:39 -06:00
Anthony Liguori b4748b9b94 Add a QObject JSON wrapper
This provides a QObject interface for creating QObjects from a JSON expression.

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-11-17 08:49:39 -06:00
Anthony Liguori 4a5fcab7ac Add a JSON parser
This is the third and final stage of the JSON parser.  It parses lexical tokens
performing grammar validation and creating the final QObject representation.  It
uses a recursive decent parser.

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-11-17 08:49:39 -06:00
Anthony Liguori d7ff3acbb4 Add a JSON message boundary identifier
The second stage of our JSON parser is a simple state machine that identifies
individual JSON values by counting the levels of nesting of tokens.  It does
not perform grammar validation.  We use this to emit a full JSON value to the
parser.

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-11-17 08:49:39 -06:00
Anthony Liguori 5ab8558d9b Add a lexer for JSON
Our JSON parser is a three stage parser.  The first stage tokenizes the stream
into a set of lexical tokens.  Since the lexical grammar is regular, we can
use a finite state machine to model it.  The state machine will emit tokens
as they are identified.

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-11-17 08:49:39 -06:00
Anthony Liguori f7e6b1927f Add a QBool type
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-11-17 08:49:39 -06:00
Anthony Liguori 9c9efb6b29 Add unit test for QFloat
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-11-17 08:49:38 -06:00
Anthony Liguori ec072ced1e Add a QFloat datatype
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-11-17 08:49:38 -06:00
lirans@il.ibm.com c163b5cae9 Block live migration
This patch introduces block migration called during live migration. Block
are being copied to the destination in an async way. First the code will
transfer the whole disk and then transfer all dirty blocks accumulted during
the migration.
Still need to improve transition from the iterative phase of migration to the
end phase. For now transition will take place when all blocks transfered once,
all the dirty blocks will be transfered during the end phase (guest is
suspended).

Changes from v4:
- Global variabels moved to a global state structure allocated dynamically.
- Minor coding style issues.
- Poll block.c for tracking of dirty blocks instead of manage it here.

Signed-off-by: Liran Schour <lirans@il.ibm.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-11-17 08:49:30 -06:00
Magnus Damm fc8e320ef5 fix make clean targets
This patch fixes clean in case of missing directories and
also adds code to distclean that removes the following files:
 qemu-monitor.texi roms/seabios/config.mak roms/vgabios/config.mak

Signed-off-by: Magnus Damm <damm@opensource.se>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2009-11-14 01:23:02 +01:00