Commit Graph

520 Commits

Author SHA1 Message Date
Jes Sorensen c1b0b93b06 Move QEMU OS dependant library functions to OS specific files
This moves library functions used by both QEMU and the QEMU tools,
such as qemu-img, qemu-nbd etc. from osdep.c to oslib-{posix,win32}.c

In addition it introduces oslib-obj.y to the Makefile set to be
included by the various targets, instead of relying on these library
functions magically getting included via block-obj-y.

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-10-30 08:02:36 +00:00
Michael S. Tsirkin df2943ba3c qemu-options.def: add to generated header list
All files include qemu-options.h which pulls in qemu-options.def from
the root directory.  Thus generating qemu-options.def from Makefile.objs
under the target directory is not effective.

Further, people expect .def file to get cleaned with make clean:
it does not have state so no reason to defer removing it
until distclean. Also add a rule to remove old files that might
be around.

This fixes the error: ‘QEMU_OPTION_spice’ undeclared
(first use in this function) error that some people reported
which is really down to an out of date .def file.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2010-10-27 18:54:02 +02:00
Anthony Liguori 174b2877b0 Merge remote branch 'qmp/for-anthony' into staging 2010-10-26 09:51:03 -05:00
Blue Swirl c57c846a80 qemu-timer: move commonly used timer code to qemu-timer-common
Move timer init functions to a new file, qemu-timer-common.c. Make other
critical timer functions inlined to preserve performance in
qemu-timer.c, also move muldiv64() (used by the inline functions)
to qemu-timer.h.

Adjust block/raw-posix.c and simpletrace.c to use get_clock() directly.
Remove a similar/duplicate definition in qemu-tool.c.

Adjust hw/omap_clk.c to include qemu-timer.h because muldiv64() is used
there.

After this change, tracing can be used also for user code and
simpletrace on Win32.

Cc: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Acked-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-10-23 15:24:07 +00:00
Jan Kiszka 945d3e6378 Fix test suite build with tracing enabled
qemu_malloc instrumentations require linking against the trace objects.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Acked-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
2010-10-22 10:08:37 -02:00
Blue Swirl ae0bfb79aa ppc: remove video.x
Only Mac-on-Linux stuff used video.x, OpenBIOS does not need it.

Remove video.x MoL hacks.

Signed-off-by: Alexander Graf <agraf@suse.de>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-10-13 18:38:07 +00:00
Blue Swirl d7489b72ca trace: remove timestamp files when cleaning up
'make clean' did not remove trace.[ch]-timestamp files,
only trace.[ch]. But 'make' did not know how to make trace.[ch]
files if the timestamp files were present.

Fix by removing the timestamp files along with trace.[ch].

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-10-09 08:24:17 +00:00
Anthony Liguori 48f57044e6 Merge remote branch 'qmp/for-anthony' into staging 2010-10-05 13:54:49 -05:00
Blue Swirl a82cdd58fd trace: avoid unnecessary recompilation if nothing changed
Add logic to detect changes in generated files. If the old
and new files are identical, don't touch the generated file.
This avoids a lot of churn since many files depend on trace.h.

Based on suggestion by Paolo Bonzini.

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-10-02 14:28:12 +00:00
Blue Swirl 904fe1fbd1 Makefile: fix config-devices.mak generation
The logic of detecting changes in default-configs/*.mak is
flawed as can be demonstrated by 'touch default-configs/*.mak'
followed by make. This results in a message claiming that user
made changes to the */config-devices.mak files.

Fix by separating the detection of changes made by the user and
changes in the default-configs.

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-10-02 14:28:08 +00:00
Luiz Capitulino acd0a09337 Monitor: Rename the qemu-monitor.hx file
Let's be consistent and call it hmp-commands.hx, so that we have
qmp-commands.hx for QMP and hmp-commands.hx for HMP.

Please, note that this commit doesn't touch qemu-monitor.texi. All
texi files have the qemu- prefix and I don't think it's worth
changing that.

Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
2010-10-01 10:20:07 -03:00
Luiz Capitulino 82a56f0d83 Monitor: Introduce the qmp-commands.hx file
This file contains a copy of the following information from the
qemu-monitor.hx file:

    o QObject handlers entries
    o QMP documentation (all SQMP/EQMP sections)

Right now it's only used to generate the QMP docs in QMP/, but
next commits will turn this into QMP's command dispatch table.

It's important to note that QObject handlers entries are going
to get duplicated: they will exist in both QMP's and HMP's
dispatch tables.

This will be fixed in the near future, when we add a proper
QMP call interface and HMP is converted to use it. This way we
can completely drop QObject handlers entries from HMP's tables.

NOTE: HMP specific constructions, like "q|quit", have been dropped.

Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
2010-10-01 10:20:06 -03:00
Blue Swirl 9fe6de9449 mingw: add version information to the executables
Add QEMU version information to the executables, based on earlier
work by C. W. Betts and Robert Riebisch.

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-09-26 16:07:57 +00:00
Andreas Färber 91f169004d trace: Fix user emulator dependency on trace objects
On a clean build, after generating trace.h, make would recurse into *-*-user
without a clue how to build ../trace.o (added to $(obj-y) in Makefile.target)
since its generation rule is in the main Makefile.
The softmmus are seemingly unaffected because the $(TOOLS), which each have
a dependency on $(trace-obj-y), are built first for the build-all target.

Add a dependency on $(trace-obj-y) for %-user, as done for the qemu-* tools.

Let's be paranoid and do the same for %-softmmu while at it, just in case
someone messes with $(TOOLS) or calls the Makefile target directly.

Signed-off-by: Andreas Färber <andreas.faerber@web.de>
Acked-by: Stefan Weil <weil@mail.berlios.de>
Cc: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Cc: Prerna Saxena <prerna@linux.vnet.ibm.com>
Cc: Blue Swirl <blauwirbel@gmail.com>
Cc: Anthony Liguori <aliguori@us.ibm.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-09-21 18:54:17 +00:00
Stefan Hajnoczi 26f7227bfe trace: Add simple built-in tracing backend
This patch adds a simple tracer which produces binary trace files.  To
try out the simple backend:

$ ./configure --trace-backend=simple
$ make

After running QEMU you can pretty-print the trace:

$ ./simpletrace.py trace-events trace.log

The output of simpletrace.py looks like this:

  qemu_realloc 0.699 ptr=0x24363f0 size=0x3 newptr=0x24363f0
  qemu_free 0.768 ptr=0x24363f0
  ^           ^---- timestamp delta (us)
  |____ trace event name

Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>

trace: Make trace record fields 64-bit

Explicitly use 64-bit fields in trace records so that timestamps and
magic numbers work for 32-bit host builds.

Includes fixes from Prerna Saxena <prerna@linux.vnet.ibm.com>.

Signed-off-by: Prerna Saxena <prerna@linux.vnet.ibm.com>
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
2010-09-09 16:22:44 -05:00
Stefan Hajnoczi 94a420b170 trace: Add trace-events file for declaring trace events
This patch introduces the trace-events file where trace events can be
declared like so:

qemu_malloc(size_t size) "size %zu"
qemu_free(void *ptr) "ptr %p"

These trace event declarations are processed by a new tool called
tracetool to generate code for the trace events.  Trace event
declarations are independent of the backend tracing system (LTTng User
Space Tracing, ftrace markers, DTrace).

The default "nop" backend generates empty trace event functions.
Therefore trace events are disabled by default.

The trace-events file serves two purposes:

1. Adding trace events is easy.  It is not necessary to understand the
   details of a backend tracing system.  The trace-events file is a
   single location where trace events can be declared without code
   duplication.

2. QEMU is not tightly coupled to one particular backend tracing system.
   In order to support tracing across QEMU host platforms and to
   anticipate new backend tracing systems that are currently maturing,
   it is important to be flexible and not tied to one system.

This commit includes fixes from Prerna Saxena
<prerna@linux.vnet.ibm.com> and Blue Swirl <blauwirbel@gmail.com>.

Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
2010-09-09 16:22:44 -05:00
Corentin Chary 3e230dd23b ui: move all ui components in ui/
Move sdl, vnc, curses and cocoa UI into ui/ to cleanup
the root directory. Also remove some unnecessary explicit
targets from Makefile.

aliguori: fix build when srcdir != objdir

Signed-off-by: Corentin Chary <corentincj@iksaif.net>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-07-26 17:35:54 -05:00
Hidetoshi Seto e1a068b21f Makefile: Not every shell support {}
So interpret it by hand.

Signed-off-by: Hidetoshi Seto <seto.hidetoshi@jp.fujitsu.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-07-11 20:27:29 +03:00
Hidetoshi Seto ac46eb8bec Makefile: add fsdev/*.{o,d} to clean
There were fsdev/qemu-fsdev.{o,d} not removed at "make clean".

Signed-off-by: Hidetoshi Seto <seto.hidetoshi@jp.fujitsu.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-07-11 20:26:56 +03:00
Hidetoshi Seto d6f3a84511 Makefile: add qemu-options.def to distclean
Remove generated qemu-options.def at "make distclean".

Signed-off-by: Hidetoshi Seto <seto.hidetoshi@jp.fujitsu.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2010-07-01 23:45:29 +02:00
Corentin Chary d9b73e47a3 vnc: add missing target for vnc-encodings-*.o
vnc-encodings-*.c dependencies where missing.

Signed-off-by: Corentin Chary <corentincj@iksaif.net>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-06-01 16:15:51 -05:00
Jan Kiszka b40292e711 QMP: Introduce commands documentation
One of the most important missing feature in QMP today is its
supported commands documentation.

The plan is to make it part of self-description support, however
self-description is a big task we have been postponing for a
long time now and still don't know when it's going to be done.

In order not to compromise QMP adoption and make users' life easier,
this commit adds a simple text documentation which fully describes
all QMP supported commands.

This is not ideal for a number of reasons (harder to maintain,
text-only, etc) but does improve the current situation. To avoid at
least divering from the user monitor help and texi snippets, QMP bits
are also maintained inside qemu-monitor.hx, and hxtool is extended to
generate a single text file from them.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-06-01 13:48:43 -05:00
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
Juan Quintela f527c57935 fix parallel build
Based on a ideas of Daniel Jacobowitz + Stefan Weil

Signed-off-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-11-12 11:23:54 -06:00
Stefan Weil 88e2b0a5fd Makefile: Fix definition of pxe-*.bin blobs
* Remove 2nd entry for pxe-pcnet.bin.
  This kind of error can be avoided by sorting
  entries. So all pxe-*.bin entries are now sorted
  alphabetically.
* Rename pxe-eepro100.bin -> pxe-i82559er.bin.
  This change completes another patch which did
  the rename on the pxe image for i82559er.

Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-11-12 11:23:54 -06:00
Stefan Weil 1bb62099bf Makefile: Prettify logging
Replace
	GEN  config-all-devices.mak
by
	GEN   config-all-devices.mak

Like this, the logging output is column aligned.

Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-11-12 11:23:53 -06:00
Paolo Bonzini 783c4f5835 Makefile: make qemu-io dependent on config-host.h
This is needed also for qemu-io, but not for qemu-nbd.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-11-09 08:43:03 -06:00
Uri Lublin fafce63d99 Makefile: make qemu-img dependant on config-host.h
Since config-host.h is generated by the Makefile (1215c6e76),
building (only) qemu-img fails:

[user@f12-uri qemu]$ make distclean (or git clone qemu)
[user@f12-uri qemu]$ ./configure ...
[user@f12-uri qemu]$ make qemu-img
GEN  config-all-devices.mak
GEN   qemu-img-cmds.h
CC    qemu-img.o
In file included from qemu-img.c:24:
qemu-common.h:32:25: error: config-host.h: No such file or directory

Signed-off-by: Uri Lublin <uril@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-11-09 08:43:03 -06:00
Anthony Liguori 74b12befba Switch from etherboot to gPXE
etherboot is deprecated and not under active development anymore.

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-10-30 09:42:36 -05:00
Mark McLoughlin c28b1c1007 net: move linux code into net/tap-linux.c
Signed-off-by: Mark McLoughlin <markmc@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-10-30 08:39:28 -05:00
Mark McLoughlin 88b3ec02b2 net: move AIX code into net/tap-aix.c
Okay, this makes the tap options available on AIX even though there's
no support, but if we want to do it right we should have not compile
the tap code at all on AIX using e.g. CONFIG_TAP.

Signed-off-by: Mark McLoughlin <markmc@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-10-30 08:39:28 -05:00
Mark McLoughlin 966ea5ec4f net: move solaris code to net/tap-solaris.c
Signed-off-by: Mark McLoughlin <markmc@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-10-30 08:39:27 -05:00
Mark McLoughlin e7e92325d9 net: split BSD tap_open() out into net/tap-bsd.c
Signed-off-by: Mark McLoughlin <markmc@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-10-30 08:39:27 -05:00
Mark McLoughlin 5281d757ef net: split all the tap code out into net/tap.c
Signed-off-by: Mark McLoughlin <markmc@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-10-30 08:39:27 -05:00
Mark McLoughlin 33ad161a04 net: move tap-win32.c under net/
Signed-off-by: Mark McLoughlin <markmc@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-10-30 08:39:27 -05:00
Mark McLoughlin 7200ac3c7c net: move net-checksum.c under net/
Also add a new net/checksum.h header

Signed-off-by: Mark McLoughlin <markmc@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-10-30 08:39:26 -05:00
Mark McLoughlin e1144d006d net: move net-queue.[ch] under net/
[v2: handle building in a separate dir]

Signed-off-by: Mark McLoughlin <markmc@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-10-30 08:39:26 -05:00
Stefan Weil 581d45f029 Makefile: Change make to be quiet again when doing nothing
This patch makes make quiet again.

There is already a similar patch from Juan Quintela,
but maybe this shorter form is preferred.

Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-10-27 12:28:35 -05:00
Mark McLoughlin f710584399 net: refactor packet queueing code
The packet queue code is fairly standalone, has some complex details and
easily reusable. It makes sense to split it out on its own. This patch
doesn't contain any functional changes.

Patchworks-ID: 35511
Signed-off-by: Mark McLoughlin <markmc@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-10-15 09:32:03 -05:00
Blue Swirl 6a8a280364 user: fix libuser build messages
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2009-10-13 16:57:32 +00:00
malc d56316388d Windows Waveform Audio driver (no ADC support yet)
Signed-off-by: malc <av1474@comtv.ru>
2009-10-10 01:18:24 +04:00
Luiz Capitulino 3aa3dcfff6 Introduce QList unit-tests
This suite contains tests to assure that QList API works as expected.

To execute it you should have check installed and build QEMU with
check support enabled (--enable-check-utests) and then run:

$ ./check-qlist

Patchworks-ID: 35333
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-10-08 21:17:18 -05:00
Luiz Capitulino a6fd08eb62 Introduce QList
QList is a high-level data type that can be used to store QObjects
in a singly-linked list.

The following functions are available:

- qlist_new()    Create a new QList
- qlist_append() Append a QObject to the list
- qlist_iter()   Iterate over stored QObjects

Patchworks-ID: 35334
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-10-08 21:17:18 -05:00
Juan Quintela c62c4551b8 Only compile ssi when one target uses it
Patchworks-ID: 35221
Signed-off-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-10-08 21:17:17 -05:00
Juan Quintela 93a604004a Only compile ssi-sd when one target uses it
Patchworks-ID: 35220
Signed-off-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-10-08 21:17:17 -05:00
Juan Quintela ee99ca01e8 Only compile max111x when one target uses it
Patchworks-ID: 35219
Signed-off-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-10-08 21:17:17 -05:00
Juan Quintela 20a4afc421 Only compile ads7846 when one target uses it
Patchworks-ID: 35218
Signed-off-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-10-08 21:17:17 -05:00
Juan Quintela 54bcf07471 Only compile sd0323 when one target uses it
Patchworks-ID: 35217
Signed-off-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-10-08 21:17:17 -05:00
Juan Quintela 6a559be594 Only compile sd0303 when one target uses it
Patchworks-ID: 35216
Signed-off-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-10-08 21:17:16 -05:00
Juan Quintela 4aa5b83fd1 Only compile stellaris_input when one target uses it
Patchworks-ID: 35213
Signed-off-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-10-08 21:17:16 -05:00
Juan Quintela d9b44620c5 Only compile tmp105 when one target uses it
Patchworks-ID: 35214
Signed-off-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-10-08 21:17:16 -05:00
Juan Quintela 03aba0e393 Only compile lm832x when one target uses it
Patchworks-ID: 35211
Signed-off-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-10-08 21:17:15 -05:00
Juan Quintela 3c848e2ad8 Only compile tsc2005 when one target uses it
Patchworks-ID: 35215
Signed-off-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-10-08 21:17:15 -05:00
Juan Quintela 92eb6b4e11 Only compile twl92230 when one target uses it
Patchworks-ID: 35212
Signed-off-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-10-08 21:17:15 -05:00
Juan Quintela 976ca9abee Only compile wm8750 when one target uses it
Patchworks-ID: 35209
Signed-off-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-10-08 21:17:14 -05:00
Juan Quintela ae573db3cf Only compile max7310 when one target uses it
Patchworks-ID: 35210
Signed-off-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-10-08 21:17:13 -05:00
Juan Quintela b21fd8e60a Only compile sd when one target uses it
Patchworks-ID: 35208
Signed-off-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-10-08 21:17:13 -05:00
Juan Quintela 5f74377c3d Only compile ptimer when one target uses it
Patchworks-ID: 35207
Signed-off-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-10-08 21:17:13 -05:00
Juan Quintela fe0d4d3f77 Generate config-devices.h
Generate config-devices.h for each target and config-all-devices.h for
common library.  We don't want to name both config-devices.h to avoid
path problems

Patchworks-ID: 35195
Signed-off-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-10-08 21:17:10 -05:00
Juan Quintela 1f3d3c8fd7 Add new config-devices.mak for each target
We generate config-devices.h from there automatically.
We need to do it in main Makefile, because we are going to need a main
Makefile for them.

Patchworks-ID: 35196
Signed-off-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-10-08 21:17:10 -05:00
Juan Quintela 25be210f69 Rename config.{h, mak} config-target.{h, mak}
Add config.h file that includes config-target.h and config-host.h

Patchworks-ID: 35193
Signed-off-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-10-08 21:17:03 -05:00
Juan Quintela e5efe7f5d2 Remove useless check for config-host.mak
If config-host.mak dont' exist, we have exited in the check at
the beginning of the file.
Once here, move the bits to the else part of the test at the beginning of
the file.

Patchworks-ID: 35191
Signed-off-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-10-08 21:17:03 -05:00
Juan Quintela 1215c6e761 Move generation of config-host.h to Makefile from configure
Use timestamp based appreach to avoid not needed recompilation.
Add it to rules.mak

Many thanks to Paolo Bonzini for helpding the design, and the debug.

Patchworks-ID: 35190
Signed-off-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-10-08 21:17:03 -05:00
Juan Quintela d9ace8b384 configure and Makefile are not generated in qemu
Just say it to make

Signed-off-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-10-06 14:46:11 -05:00
Juan Quintela 9c927650eb add build-all to .PHONY rules
Signed-off-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-10-06 14:46:10 -05:00
Edgar E. Iglesias bc6291a1b9 Include microblaze binaries in tarbin.
Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
2009-10-01 15:18:36 +02:00
Blue Swirl add16157d7 Compile some user files only once for all targets
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2009-09-27 16:26:02 +00:00
Blue Swirl c2b023b627 Compile host-utils only once
See also facd285778 and
34005a0060.

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2009-09-20 19:20:05 +00:00
Blue Swirl 96e132e24e Compile TCG runtime library only once
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2009-09-20 19:06:34 +00:00
Blue Swirl afcea8cbde ioports: remove unused env parameter and compile only once
The CPU state parameter is not used, remove it and adjust callers. Now we
can compile ioport.c once for all targets.

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2009-09-20 16:05:47 +00:00
Blue Swirl a333cd7166 Compile qemu-config only once
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2009-09-20 08:28:29 +00:00
Kirill A. Shutemov 34005a0060 Add configure option to compile user targets as PIE
Build uset targers as true PIE if user want to keep qemu
self-virtualizable.

v5:
  - Split into to patches: drop link hack and add PIE support
  - do not build PIE by default and drop toolchain check

v4:
  - Add test for toolchain if it has proper PIE support

v3:
  - One more pice of the hack was removed
  - Description updated

v2:
  - Add configure options do enable/disable PIE for usermode targets.
    Disabling can be useful if you build uswing toolchain which has
    broken PIE support. PIE for usermode targets enabled by default.

Signed-off-by: Kirill A. Shutemov <kirill@shutemov.name>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2009-09-12 13:17:45 +00:00
Gerd Hoffmann d52affa7f6 qdev/scsi: add scsi bus support to qdev, convert drivers.
* Add SCSIBus.
 * Add SCSIDeviceInfo, move device callbacks here.
 * add qdev/scsi helper functions.
 * convert drivers.

Adding scsi disks via -device works now, i.e. you can do:

 -drive id=sda,if=none,...
 -device lsi
 -device scsi-disk,drive=sda

legacy command lines (-drive if=scsi,...) continue to work.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-09-09 14:57:19 -05:00
Gerd Hoffmann 806b602482 qdev/usb: add usb bus support to qdev, convert drivers.
* Add USBBus.
 * Add USBDeviceInfo, move device callbacks here.
 * Add usb-qdev helper functions.
 * Switch drivers to qdev.

TODO:
 * make the rest of qemu aware of usb busses and kill the FIXMEs
   added by this patch.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-09-09 14:55:17 -05:00
Luiz Capitulino 7b8c51add7 Introduce QDict unit-tests
This suite contains tests to assure that QDict API works as expected.

To execute it you should have check installed and build QEMU with
check support enabled (--enable-check-utests) and then run:

$ ./check-qdict

Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-09-04 09:37:34 -05:00
Luiz Capitulino 5de65a07ee Introduce QString unit-tests
This suite contains tests to assure that QString API works as expected.

To execute it you should have check installed and build QEMU with
check support enabled (--enable-check-utests) and then run:

$ ./check-qstring

Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-09-04 09:37:34 -05:00
Luiz Capitulino 33837ba6c5 Introduce QInt unit-tests
This suite contains tests to assure that QInt API works as expected.

To execute it you should have check installed and build QEMU with
check support enabled (--enable-check-utests) and then run:

$ ./check-qint

Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-09-04 09:37:33 -05:00
Luiz Capitulino fb08dde098 Introduce QDict
QDict is a high-level dictionary data type that can be used to store a
collection of QObjects. A unique key is associated with only one
QObject.

The following functions are available:

- qdict_new()    Create a new QDict
- qdict_put()    Add a new 'key:object' pair
- qdict_get()    Get the QObject of a given key
- qdict_del()    Delete a 'key:object' pair
- qdict_size()   Return the size of the dictionary
- qdict_haskey() Check if a given 'key' exists

Some high-level helpers to operate on QStrings and QInts objects
are also provided.

Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-09-04 09:37:29 -05:00
Luiz Capitulino 66f7048712 Introduce QString
QString is a high-level data type that can be used to represent
C strings.

The following functions are available:

- qstring_from_str() Create a new QString
- qstring_get_str()  Get a pointer to the stored string

Note that qstring_get_str() is too low-level for a data type like
this, but it's interesting for quick read-only accesses.

Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-09-04 09:37:29 -05:00
Luiz Capitulino 6b8d1ece70 Introduce QInt
QInt is a high-level data type that can be used to represent integers,
internally it stores an int64_t value.

The following functions are available:

- qint_from_int() Create a new QInt
- qint_get_int()  Get the stored integer

Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-09-04 09:37:29 -05:00
Christoph Hellwig 5c6c3a6c54 raw-posix: add Linux native AIO support
Now that do have a nicer interface to work against we can add Linux native
AIO support.  It's an extremly thing layer just setting up an iocb for
the io_submit system call in the submission path, and registering an
eventfd with the qemu poll handler to do complete the iocbs directly
from there.

This started out based on Anthony's earlier AIO patch, but after
estimated 42,000 rewrites and just as many build system changes
there's not much left of it.

To enable native kernel aio use the aio=native sub-command on the
drive command line.  I have also added an option to qemu-io to
test the aio support without needing a guest.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-08-27 20:30:22 -05:00
Paolo Bonzini 5ac1fad324 add file descriptor migration
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Cc: Chris Lalancette <clalance@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-08-27 19:33:15 -05:00
Christoph Hellwig 4dd75c702c make pthreads mandatory
As requested by Anthony make pthreads mandatory.  This means we will always
have AIO available on posix hosts, and it will also allow enabling the I/O
thread unconditionally once it's ready.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-08-24 08:46:47 -05:00
Anthony Liguori a25a0ef51e Only build osdep once
We no longer need hackery to work around kqemu

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-08-24 08:02:55 -05:00
Chris Lalancette 4951f65bd3 Migration via unix sockets.
Implement migration via unix sockets.  While you can fake this using
exec and netcat, this involves forking another process and is
generally not very nice.  By doing this directly in qemu, we can avoid
the copy through the external nc command.  This is useful for
implementations (such as libvirt) that want to do "secure" migration;
we pipe the data on the sending side into the unix socket, libvirt
picks it up, encrypts it, and transports it, and then on the remote
side libvirt decrypts it, dumps it to another unix socket, and
feeds it into qemu.

The implementation is straightforward and looks very similar to
migration-exec.c and migration-tcp.c

Signed-off-by: Chris Lalancette <clalance@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-08-24 08:01:42 -05:00
Alexandre Bique 21d4e8e3ef Makefile: fixed rule TAGS
- still works if the build dir is not the src dir
- use find instead of *.c block/*.c etc...

Signed-off-by: Alexandre Bique <alexandre.bique@citrix.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-08-24 08:01:41 -05:00
Blue Swirl 7ecd8df89a Fix breakage of alpha, mips64, ppc64 and x86_64 targets on non-amd64 host
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2009-08-18 17:01:07 +00:00
Blue Swirl facd285778 user: compile host-utils.c only once
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2009-08-16 08:03:26 +00:00
Blue Swirl 6af5a25246 linux-user: compile envlist.c only once
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2009-08-15 08:47:42 +00:00
Blue Swirl 370220865b user: compile path.c only once
Also merge bsd-user/path.c and linux-user/path.c.

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2009-08-15 07:51:59 +00:00
Juan Quintela f03029354e CURL libs are used both by tools and softmmu
Signed-off-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Message-Id:
2009-08-10 13:05:47 -05:00
Juan Quintela 8e02e54cc4 VDE libs are used both by tools and softmmu
Signed-off-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Message-Id:
2009-08-10 13:05:46 -05:00
Juan Quintela 3e2e0e6ba8 Add libs_tools support
Libraries used by qemu-<tools>

Signed-off-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Message-Id:
2009-08-10 13:05:46 -05:00
Juan Quintela 96d409ebc0 CONFIG_POSIX makes more sense that not CONFIG_WIN32
Signed-off-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Message-Id:
2009-08-10 13:05:46 -05:00
Juan Quintela 67f86e8e2a Generate CONFIG_AUDIO_PT_INT in configure
Signed-off-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Message-Id:
2009-08-10 13:05:45 -05:00
Juan Quintela 611b0db5ae AUDIO_PT is not needed
AUDIO_PT only changes LDFLAGS to include -pthread, but it change it in
Makefile, and audio files are linked only on Makefile.target

Signed-off-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Message-Id:
2009-08-10 13:05:45 -05:00
Juan Quintela 98b068a9f1 FMOD_CFLAGS is not set when CONFIG_FMOD is undef
Signed-off-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Message-Id:
2009-08-10 13:05:45 -05:00
Juan Quintela 4de67f2fa7 Make slirp include dir globlal in cflags
We already include it everywhere

Signed-off-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Message-Id:
2009-08-10 13:05:45 -05:00
Juan Quintela 264606b3a9 Fold BRLAPI_LIBS into libs_softmmu
Signed-off-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Message-Id:
2009-08-10 13:05:41 -05:00
Juan Quintela 6c90361a7f move common QEMU_CFLAGS to configure
Signed-off-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Message-Id:
2009-08-10 13:05:39 -05:00
Juan Quintela a558ee1776 Rename CPPFLAGS to QEMU_CFLAGS
Now we have to variables: QEMU_CFLAGS: flags without which we can't compile
CFLAGS: "-g -O2"

We can now run:

make CFLAGS="-fbar" foo.o
make CFLAGS="" foo.o
make CFLAGS="-O3" foo.o

And it all should work.

Signed-off-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Message-Id:
2009-08-10 13:05:39 -05:00