Anthony Liguori [Thu, 14 May 2009 18:29:53 +0000 (19:29 +0100)]
Constructor support
Allow devices/drivers to register themselves via constructors.
Destructors are not needed (can be registered from a constructor)
and "priority" has been renamed and changed to an enum for clarity.
Paul Brook [Wed, 13 May 2009 21:21:47 +0000 (22:21 +0100)]
Add tool_osdep.c
osdep.c is built in both as a toplevel target independant object, and
as a per-target object because of kqemu dependencies. Under some
circumstances make picks up the wrong one.
Build the former as tool-osdep to avoid this conflict.
Paul Brook [Wed, 13 May 2009 16:56:25 +0000 (17:56 +0100)]
Remove vga_ram_size
The vga_ram_size argument to machine init functions always has the same
value, and is ignored by many machines (including SPARC32 which has an
obsolete ifdef for VGA_RAM_SIZE).
Paul Brook [Tue, 12 May 2009 11:02:38 +0000 (12:02 +0100)]
Make AUD_init failure fatal
Failure to initialize the audio subsystem is not handled consistently.
Where it is handled it has guest visible effects, which is wrong.
We already have a "nosound" audio driver as a last resort, so trying to
proceed without an audio backend seems pointless.
Also protect against multiple calls to AUD_init so that this can be
pushed down into individual devices.
vibi [Wed, 6 May 2009 09:57:03 +0000 (15:27 +0530)]
Fix in file qemu-sockets.c
1) Changed usage of malloc,free,strdup to qemu_malloc,qemu_free,qemu_strdup
2) Some coding style fixes (based on CODING_STYLE document)
3) Free struct addrinfo *res after failure of listen
Avi Kivity [Sun, 3 May 2009 19:25:16 +0000 (22:25 +0300)]
vga: Replace VGA_COMMON with a structure
All VGA devices share a common field subset; currently they do so by
a macro which defines the common fields inline their state structures,
relying on the the common state being placed at offset 0 in the structure.
This makes refactoring the code difficult and requires a lot of error prone
casts.
Replace the macro by a new VGACommonState structure, and the casts by
regular field access and container_of() for upcasts.
Kevin Wolf [Fri, 8 May 2009 12:47:24 +0000 (14:47 +0200)]
Improve block range checks
This patch makes the range checks for block requests more strict: It fixes a
potential integer overflow and checks for negative offsets. Also, it adds the
check for compressed writes.
Avi Kivity [Sun, 3 May 2009 14:04:03 +0000 (17:04 +0300)]
Fix x86 feature modifications for features that set multiple bits
QEMU allows adding or removing cpu features by using the syntax '-cpu +feature'
or '-cpu -feature'. Some cpuid features cause more than one bit to be set or
cleared; but QEMU stops after just one bit has been modified, causing the
feature bits to be inconsistent.
Fix by allowing all feature bits corresponding to a given name to be set.
Alexander Graf [Wed, 6 May 2009 00:58:48 +0000 (02:58 +0200)]
AIO deletion race fix
When deleting an fd event there is a chance the object doesn't get
deleted, but only ->deleted set positive and deleted somewhere later.
Now, if we create a handler for the fd again before the actual
deletion occurs, we end up writing data into an object that has
->deleted set, which is obviously wrong.
I see two ways to fix this:
1. Don't return ->deleted objects in the search
2. Unset ->deleted in the search
This patch implements 1. which feels safer to do. It fixes AIO issues
I've seen with curl, as libcurl unsets fd event listeners pretty
frequently.
Glauber Costa [Fri, 8 May 2009 05:22:13 +0000 (02:22 -0300)]
reset state for load_linux
The linux loader is just an option rom like any other, just with
some special requirements. Right now, our option rom resetting
mechanism is not being applied to it. As a result, users using
-kernel will not be able to successfully reboot their machines
This patch fixes it by saving all the data we generated in
the load_linux() function, to be used later by the option rom
resetting mechanism.
Glauber Costa [Fri, 8 May 2009 05:22:12 +0000 (02:22 -0300)]
register reset handler for option_roms
Currently, boot options are not preserved across a system reset.
option roms can modify themselves, or can for instance restore the real
int 0x19 vector after they tried to boot from it.
To properly do that, we need a reset handler registered to deal with option
roms. This patch is based on current version on qemu-kvm.git
Jan Kiszka [Fri, 8 May 2009 07:01:00 +0000 (09:01 +0200)]
Drop CONFIG_GDBSTUB
This is no user-flippable switch, and no arch makes use of disabling
gdbstub support. So it's pointless to keep the related #ifdefs and
configure hunks around - and risking breakages like 711c410fdd again.
Blue Swirl [Thu, 7 May 2009 17:14:07 +0000 (17:14 +0000)]
Fix disassembler memory accesses
Sparc disassembler wants to check previous addresses for some stuff
and this may actually cause faults to be generated to the guest if the
address is close to page start, because of the function used for the
memory access.
Fix by changing ldub_code to cpu_memory_rw_debug, which doesn't trigger
exceptions.
Chris Wright [Mon, 21 Apr 2008 23:02:48 +0000 (16:02 -0700)]
Pci nic: pci_register_device can fail
The pci_register_device() call in PCI nic initialization routines can
fail. Handle this failure and propagate a meaningful error message to
the user instead of generating a SEGV.
Glauber Costa [Thu, 23 Apr 2009 19:20:55 +0000 (15:20 -0400)]
suport device driver initialization model
According to PnP specification, Appendix B, Option ROMs
that support DDIM (device driver initialization model) should
have their memory space writeable.
KVM deviates from us here, by removing the IO_MEM_ROM flag,
to allow for PCI option ROMs (they require DDIM). However,
there's absolutely no reason we can't do the same.
Kevin Wolf [Thu, 23 Apr 2009 13:11:13 +0000 (15:11 +0200)]
qemu-io: Optionally verify only part of read data
There are reasonable test cases where a read must span areas that are not
uniformly filled with one pattern but contains several parts. This makes -P
useless for them currently.
Introducing additional options which determine the part of the read data that
should be verified with the given pattern allows to check such reads.
Jan Kiszka [Sun, 26 Apr 2009 16:53:42 +0000 (18:53 +0200)]
net: Fix -net socket parameter checks
My commit ea053add700d8abe203cd79a9ffb082aee4eabc0 broke -net socket by
overwriting an intermediate buffer in the added check_param. Fix this
by switching check_param to automatic buffer allocation and release, ie.
callers no longer have to worry about providing a scratch buffer.