Commit Graph

9623 Commits

Author SHA1 Message Date
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
Anthony Liguori d30ec846ed Allow strings to grow in size
This lets us use QString for building larger strings

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-11-17 08:49:38 -06:00
Anthony Liguori 033815fe14 Add operations to qlist to allow it to be used as a stack
This makes lists no longer invariant. It's a very useful bit of functionality
though.

To deal with the fact that lists are no longer invariant, introduce a deep
copy mechanism for lists.

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-11-17 08:49:38 -06:00
Anthony Liguori c99ca93142 Properly escape QDECREF macro arguments
QDECREF does not properly escape the macro arguments which can lead to
unexpected syntax errors.

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-11-17 08:49:38 -06:00
Jan Kiszka 78f5d72602 Cleanup configure checks for dup3 and fallocate
We have a function for this which does not issue annoying warnings.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-11-17 08:49:38 -06:00
Jan Kiszka 0e607a80d3 kvm: x86: Refactor use of interrupt_bitmap
Drop interrupt_bitmap from the cpustate and solely rely on the integer
interupt_injected. This prepares us for the new injected-interrupt
interface, which will deprecate the bitmap, while preserving
compatibility.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-11-17 08:49:37 -06:00
Jan Kiszka caa5af0ff3 kvm: Add arch reset handler
Will be required by succeeding changes.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-11-17 08:49:37 -06:00
lirans@il.ibm.com fbc3d96cc4 Enable migration without shared storage from the monitor
This patch adds the option to activate non-shared storage migration from the
monitor.
The migration command is as follows:
(qemu) migrate -d tcp:0:4444 # for ordinary live migration
(qemu) migrate -d -b tcp:0:4444 # for live migration with complete storage copy
(qemu) migrate -d -i tcp:0:4444 # for live migration with incremental storage copy, storage is cow based.

Changes from v4:
- Minor coding style issues.

Signed-off-by: Liran Schour <lirans@il.ibm.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-11-17 08:49:37 -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
lirans@il.ibm.com 7cd1e32a86 Expose a mechanism to trace block writes
To support live migration without shared storage we need to be able to trace
writes to disk while migrating. This Patch expose dirty block tracking per
device to be polled from upper layer.

Changes from v4:
- Register dirty tracking for each block device.
- Minor coding style issues.
- Block.c will now manage a dirty bitmap per device once
  bdrv_set_dirty_tracking() is called. Bitmap is polled by the upper
  layer (block-migration.c).

Signed-off-by: Liran Schour <lirans@il.ibm.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-11-17 08:03:31 -06:00
Amit Shah 127338e610 char: rename qemu_chr_reset to qemu_chr_generic_open
This function sends out the OPENED event to backends that
have drive the chardevs. The 'reset' is now a historical
artifact and we can now just call the function for what it
is.

Signed-off-by: Amit Shah <amit.shah@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-11-17 08:03:31 -06:00
Amit Shah 57e073a3a1 char: Remove special init_reset handling
The initial_reset sent to chardevs doesn't do much other than setting
a bool to true. Char devices are interested in the open event and
that gets sent whenever the device is opened.

Moreover, the reset logic breaks as and when qemu's bh scheduling
changes.

Signed-off-by: Amit Shah <amit.shah@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-11-17 08:03:30 -06:00
Amit Shah 9bd7854e1e char: don't limit data sent to backends to 1k per buffer
chardevs have a 'can_read' function via which backends specify
the amount of data they can receive. When can_read returns > 0,
apps can start sending data. However, each chardev driver here
allows a max. of 1k bytes inspite of the backend being able to
receive more.

The best we can do here is to allocate s->max_size bytes from
the heap on each call (which is the number returned by the
backend from the can_read call).

This is an intermediate step to bump up the bytes written in
each call to 4k.

Signed-off-by: Amit Shah <amit.shah@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-11-17 08:03:30 -06:00
Paul Brook 0ef849d751 ARM PB-A8 support
Add ARM Realview PB-A8 board support.

Signed-off-by: Paul Brook <paul@codesourcery.com>
2009-11-16 17:06:43 +00:00
Paul Brook 2a42499017 LAN9118 emulation
Add SMSC LAN9118 ethernet emulation.

Signed-off-by: Paul Brook <paul@codesourcery.com>
2009-11-16 17:06:43 +00:00
Aurelien Jarno e90e795e8c mips_r4k: fix reset
(broken by 45a50b1668)

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2009-11-15 23:04:20 +01:00
Blue Swirl d27d06f21f PPC64: map Uni-North AGP bus aka fix Linux boot
Uni-North AGP device mapping was accidentally dropped in
2e29bd0478.

Map the device.

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2009-11-15 17:42:17 +00:00
Blue Swirl 603987488c PPC64: Partial fix to Linux crash: revert to old devfn
Before 2e29bd0478, Uni-North host and AGP
bridge were using the same devfn, 11 << 3. The net effect was that only
AGP bridge was visible. This was changed in the commit to 13 << 3 for AGP.

Some of the later crashes happened due to NULL pointer dereferences generated
by 07b7d05377 and insufficient return value
checks.

Disable host device and revert AGP to 11 << 3.

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2009-11-15 14:30:56 +00:00
Blue Swirl c364c974d9 PCI: make duplicate devfn allocation fatal
Only two callers of pci_create_simple/pci_register_device bothered
to check the return value. Other cases were prone to crashing with
spurious NULL pointer dereferences.

Make QEMU exit with an error message when devfn is attempted to
be duplicated, also applies to case when the bus is full. Remove
checks.

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2009-11-15 14:30:03 +00:00
malc 3e65aaf5b2 Do not execute shell scripts directly
Signed-off-by: malc <av1474@comtv.ru>
2009-11-14 23:32:43 +03:00
Aurelien Jarno 593c0d103c mips malta: fix indentation
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2009-11-14 13:10:43 +01:00
Aurelien Jarno 31e3104fdb target-mips: fix indentation
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2009-11-14 13:10:00 +01:00
Aurelien Jarno c938ada244 mips-malta: fix reset
(broken by 45a50b1668)

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2009-11-14 13:04:29 +01:00
Blue Swirl 51cc2e783a mips: fix cpu_reset memory leak
Remove cpu_mips_register()
- move mmu_init(), fpu_init() and mvp_init() into cpu_mips_init()
- move the other parts in cpu_mips_init()

Reported-by: Blue Swirl <blauwirbel@gmail.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2009-11-14 02:25:52 +01: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
Magnus Damm b4e1f07747 sh4 disasm fixes
Add the sh4 target to the monitor disassembly function,
and remove a duplicate "0x" printout from the sh4 dis-
assembly code.

Signed-off-by: Magnus Damm <damm@opensource.se>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2009-11-14 01:19:12 +01:00
Magnus Damm b785e4768b tcg/i386: remove duplicate sar opcode
Signed-off-by: Magnus Damm <damm@opensource.se>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2009-11-14 01:17:47 +01:00
Stefan Weil 91011d4f3b pci: Fix function pci_default_write_config
Change 260c0cd3d9
(pci: use range helper functions) introduced a
bug which made pci cirrus vga on mips malta
(and maybe other pci devices) fail.

Don't change addr - its original value is needed
by ranges_overlap() and range_covers().

Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Acked-by: Ryan Harper <ryanh@us.ibm.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2009-11-14 01:14:26 +01:00
Aurelien Jarno e16ad5b044 mips: fix CPU reset
Don't load the kernel twice during reset.
See f2d7497876.

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2009-11-14 01:11:27 +01:00
Blue Swirl bc90ff7742 Fix PPC crash
Because of a typo, structure field vga_bios_size was not initialized
properly and a bogus BAR6 for the nonexistent VGA BIOS appeared.

The bug was uncovered by c169998802.

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2009-11-13 19:00:11 +00:00
Paul Brook c988bfadc9 ARM MPCore tweaks
Allow the user to specify the number of cores present on the
RealView EB + ARM11MPCore board.  Also split into its own config
rather than guessing from the CPU name.

Signed-off-by: Paul Brook <paul@codesourcery.com>
2009-11-13 04:31:22 +00:00
Paul Brook 26e92f6552 Realview/EB procid hacks
Guess core tile ID based on CPU type.

Signed-off-by: Paul Brook <paul@codesourcery.com>
2009-11-13 04:04:18 +00:00
Juan Quintela dbe73d7f3b pci: fix the conversion of config field from array to pointer
Signed-off-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-11-12 11:23:57 -06:00
Juan Quintela 504c2948d3 qemu_system_reset: we need to call it before loadvm/migration
Signed-off-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-11-12 11:23:56 -06:00
Juan Quintela 2966b390d0 fdc: fix vmstate variable passed
When code was transformed to use qdev_reset/vmstate registration, vmstate
was passed a variable of the wrong type

Signed-off-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-11-12 11:23:56 -06:00
Gerd Hoffmann 6b1325029d vnc: improve capslock handling.
When capslock is toggled while the vnc window hasn't the focus qemu
will miss the state change.  Add sanity checks for the capslock state
and toggle it if needed, so hosts and guests idea of capslock state
stay in sync.  Simliar logic for numlock is present in qemu already.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-11-12 11:23:56 -06:00
Kay Ackermann a00b233528 e1000 fix: read access to some registers is missing.
While writing working on an e1000 driver for my university's OS I
noticed that some registers aren't readable in QEMU, but they should
be readable as stated in Intels Driver Developer Manual (and also
verified on real hardware).

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-11-12 11:23:56 -06:00
David Woodhouse c34d2451ed Fix 32-bit overflow in parallels image support
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-11-12 11:23:56 -06:00
Hollis Blanchard 812151f290 kvm ppc: Remove unused label
Signed-off-by: Hollis Blanchard <hollisb@us.ibm.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-11-12 11:23:55 -06:00
Hollis Blanchard 9bdbe550f0 kvm: Move KVM mp_state accessors to i386-specific code
Unbreaks PowerPC and S390 KVM builds.

Signed-off-by: Hollis Blanchard <hollisb@us.ibm.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-11-12 11:23:55 -06:00
Kevin Wolf 49c3c8dca7 virtio-blk: Pass read errors to the guest
We need to signal not only write errors, but also read errors to the guest
driver. This fixes a regression introduced by 869a5c6d.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-11-12 11:23:55 -06:00
Kevin Wolf cb499fb295 savevm: Delete existing snapshots in all images
When creating a snapshot we can run into the situation that the first disk
doesn't have a snapshot, but the second one does have one with the same name as
the new snapshot.

In this case, qemu doesn't recognize that there is a snapshot to be
overwritten, so it starts to save the new snapshot and errors out later when it
tries to snapshot the second image. With this patch, snapshots on secondary
images are overwritten just like on the first image.

Reported-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-11-12 11:23:55 -06:00
Juan Quintela 14f26b00d1 Fix incoming migration
commit b04c4134d6
broke incoming migration.  After talking with Gleb, code was intended
to be the way is in this fix.  This fixes migration here.

Signed-off-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-11-12 11:23:55 -06:00
Juan Quintela ef2fad6592 fix type in CFLAGS name
Signed-off-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-11-12 11:23:55 -06: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
Amit Shah 593831de5d qdev: Check if unplug handler exists before calling it
A bus may have hotplugging enabled but not have the 'unplug'
callback defined, which would lead to a crash on trying to
unplug a device on the bus.

Fix by introducing an assert to check if the callback is valid.

Signed-off-by: Amit Shah <amit.shah@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