qemu
14 years agomicroblaze: Hook into the build-system.
Edgar E. Iglesias [Wed, 20 May 2009 19:17:31 +0000 (21:17 +0200)]
microblaze: Hook into the build-system.

Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>

14 years agomicroblaze: Add GDB stub support.
Edgar E. Iglesias [Wed, 20 May 2009 18:16:31 +0000 (20:16 +0200)]
microblaze: Add GDB stub support.

Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>

14 years agomicroblaze: Add petalogix s3a1800dsp MMU linux ref-design.
Edgar E. Iglesias [Wed, 20 May 2009 18:16:11 +0000 (20:16 +0200)]
microblaze: Add petalogix s3a1800dsp MMU linux ref-design.

This setup was designed by petalogix and is supported by upstream linux.
The design targets a xilinx spartan-3a-1800 dsp board with MMU.

Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>

14 years agoxilinx: Add ethlite emulation.
Edgar E. Iglesias [Wed, 20 May 2009 18:13:24 +0000 (20:13 +0200)]
xilinx: Add ethlite emulation.

Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>

14 years agoxilinx: Add uartlite emulation.
Edgar E. Iglesias [Wed, 20 May 2009 18:12:42 +0000 (20:12 +0200)]
xilinx: Add uartlite emulation.

Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>

14 years agoxilinx: Add OPB timer.
Edgar E. Iglesias [Wed, 20 May 2009 18:11:44 +0000 (20:11 +0200)]
xilinx: Add OPB timer.

Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>

14 years agoxilinx: Add interrupt controller.
Edgar E. Iglesias [Wed, 20 May 2009 18:11:30 +0000 (20:11 +0200)]
xilinx: Add interrupt controller.

Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>

14 years agomicroblaze: Add CPU interrupt wrapper logic.
Edgar E. Iglesias [Wed, 20 May 2009 18:08:59 +0000 (20:08 +0200)]
microblaze: Add CPU interrupt wrapper logic.

Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>

14 years agomicroblaze: Add MMU emulation.
Edgar E. Iglesias [Wed, 20 May 2009 18:08:24 +0000 (20:08 +0200)]
microblaze: Add MMU emulation.

Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>

14 years agomicroblaze: Add disassembler.
Edgar E. Iglesias [Wed, 20 May 2009 18:07:38 +0000 (20:07 +0200)]
microblaze: Add disassembler.

Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>

14 years agomicroblaze: linux-user support.
Edgar E. Iglesias [Wed, 20 May 2009 19:31:33 +0000 (21:31 +0200)]
microblaze: linux-user support.

Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>

14 years agomicroblaze: Add syscall, signal and termbits defs for linux-user.
Edgar E. Iglesias [Wed, 20 May 2009 17:45:05 +0000 (19:45 +0200)]
microblaze: Add syscall, signal and termbits defs for linux-user.

Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>

14 years agomicroblaze: Add translation routines.
Edgar E. Iglesias [Wed, 20 May 2009 17:37:39 +0000 (19:37 +0200)]
microblaze: Add translation routines.

Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>

14 years agoRemove temporary config-host.h
Paul Brook [Tue, 26 May 2009 14:07:56 +0000 (15:07 +0100)]
Remove temporary config-host.h

Signed-off-by: Paul Brook <paul@codesourcery.com>

14 years agoRemove qdev irq sink handling
Paul Brook [Tue, 26 May 2009 13:56:11 +0000 (14:56 +0100)]
Remove qdev irq sink handling

We have both IRQ sinks and GPIO inputs.  These are in principle exactly
the same thing, so remove the former.

Signed-off-by: Paul Brook <paul@codesourcery.com>

14 years agoAdd dummy command to submakefiles
Paul Brook [Mon, 25 May 2009 17:54:53 +0000 (18:54 +0100)]
Add dummy command to submakefiles

Add a dummy command to the all: rule in sub-makefiles.
This avoids "Nothing to be done for `all'." messages from make.

Signed-off-by: Paul Brook <paul@codesourcery.com>

14 years agoRemove unused variable
Paul Brook [Sun, 24 May 2009 20:24:33 +0000 (21:24 +0100)]
Remove unused variable

Signed-off-by: Paul Brook <paul@codesourcery.com>

14 years agoETRAX: Removed unused struct entry and fixed Windows build.
Stefan Weil [Sat, 23 May 2009 19:32:30 +0000 (21:32 +0200)]
ETRAX: Removed unused struct entry and fixed Windows build.

"struct timeval last" caused a compilation error with mingw32
(missing header for struct timeval).

It is unused, so it was possible to remove it.

Acked-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
Signed-off-by: Stefan Weil <weil@mail.berlios.de>

14 years agoAdd common BusState
Paul Brook [Fri, 22 May 2009 23:05:19 +0000 (00:05 +0100)]
Add common BusState

Implement and use a common device bus state.  The main side-effect is
that creating a bus and attaching it to a parent device are no longer
separate operations.  For legacy code we allow a NULL parent, but that
should go away eventually.

Also tweak creation code to veriry theat a device in on the right bus.

Signed-off-by: Paul Brook <paul@codesourcery.com>

14 years agoFix lance segfaults
Paul Brook [Fri, 22 May 2009 16:44:32 +0000 (17:44 +0100)]
Fix lance segfaults

Signed-off-by: Paul Brook <paul@codesourcery.com>

14 years agoAvoid errors when curl-config does not exist
Paul Brook [Fri, 22 May 2009 16:22:38 +0000 (17:22 +0100)]
Avoid errors when curl-config does not exist

Signed-off-by: Paul Brook <paul@codesourcery.com>

14 years agobios: Use the correct mask to size the PCI option ROM BAR
Anthony Liguori [Fri, 22 May 2009 14:57:32 +0000 (09:57 -0500)]
bios: Use the correct mask to size the PCI option ROM BAR

Bit 0 is the enable bit, which we not only don't want to set, but
it will stick and make us think it's an I/O port resource.

Signed-off-by: Alex Williamson <alex.williamson@hp.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>

14 years agox86: Add support for resume flag
Jan Kiszka [Sun, 10 May 2009 20:30:53 +0000 (22:30 +0200)]
x86: Add support for resume flag

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>

14 years agonet: Fix dump time stamps
Jan Kiszka [Sun, 10 May 2009 20:23:23 +0000 (22:23 +0200)]
net: Fix dump time stamps

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>

14 years agoAdd HTTP protocol using curl v6
Alexander Graf [Mon, 11 May 2009 15:41:42 +0000 (17:41 +0200)]
Add HTTP protocol using curl v6

Currently Qemu can read from posix I/O and NBD. This patch adds a
third protocol to the game: HTTP.

In certain situations it can be useful to access HTTP data directly,
for example if you want to try out an http provided OS image, but
don't know if you want to download it yet.

Using this patch you can now try it on on the fly. Just use it like:

qemu -cdrom http://host/path/my.iso

Signed-off-by: Alexander Graf <agraf@suse.de>

14 years agoUSB serial device support
Jason Wessel [Mon, 18 May 2009 15:00:28 +0000 (10:00 -0500)]
USB serial device support

Add in a workaround to allow the usb serial devices to work with the
usb pass through mechanism.  The ioctl() to request an alternate
interface will always return < 0 for a usb-serial device based on the
kernel driver.  This means there is no alternate interface end point.

This was fully tested with a pl2303 usb serial device.

Signed-off-by: Jason Wessel <jason.wessel@windriver.com>

14 years agoserial: fix lost character after sysrq
Jason Wessel [Mon, 18 May 2009 15:00:27 +0000 (10:00 -0500)]
serial: fix lost character after sysrq

After creating an automated regression test to test the sysrq
responses while running a linux image in qemu, I found that the
simulated uart was eating the character right after the sysrq about
75% of the time.

The problem is that the qemu sets the LSR_DR (data ready) bit on a
serial break.  The automated tests can send a break and the sysrq
character quickly enough that the qemu serial fifo has a real
character available. When there is valid character in the fifo, it
gets consumed by the serial driver in the guest OS.

The real hardware also appears to set the LSR_DR but always appears to
have a null byte in this condition.  This patch changes the qemu
behavior to match the tested characteristics of a real 16550 chip.

Signed-off-by: Jason Wessel <jason.wessel@windriver.com>

14 years agousb-serial: implement break event.
Jason Wessel [Mon, 18 May 2009 15:00:26 +0000 (10:00 -0500)]
usb-serial: implement break event.

Implement the serial break via usb serial.

The second data byte in ftdi status packet contains the break status.
The values were already defined in usb-serial.c so it was a matter of
making use of the event_trigger to form a urb to send over to the host
controller with the serial break status set.

This was tested against a linux development image which enables sysrq
via a serial break on the ftdi usb console.

Signed-off-by: Jason Wessel <jason.wessel@windriver.com>

14 years agoslirp: Reassign same address to same DHCP client
Jan Kiszka [Thu, 21 May 2009 20:43:39 +0000 (22:43 +0200)]
slirp: Reassign same address to same DHCP client

In case a client restarts a DHCP recovery without releasing its old
address, reassign the same address to prevent consuming free addresses
and moving away from the standard client address.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>

14 years agokvm: x86: Save/restore KVM-specific CPU states
Jan Kiszka [Sat, 2 May 2009 00:18:38 +0000 (02:18 +0200)]
kvm: x86: Save/restore KVM-specific CPU states

Save and restore all so far neglected KVM-specific CPU states. Handling
the TSC stabilizes migration in KVM mode. The interrupt_bitmap and
mp_state are currently unused, but will become relevant for in-kernel
irqchip support. By including proper saving/restoring already, we avoid
having to increment CPU_SAVE_VERSION later on once again.

v2:
 - initialize mp_state runnable (for the boot CPU)

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>

14 years agokvm: Rework VCPU reset
Jan Kiszka [Fri, 1 May 2009 22:29:37 +0000 (00:29 +0200)]
kvm: Rework VCPU reset

Use standard callback with highest order to synchronize VCPU on reset
after all device callbacks were execute. This allows to remove the
special kvm hook in qemu_system_reset.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>

14 years agoIntroduce reset notifier order
Jan Kiszka [Fri, 1 May 2009 22:29:37 +0000 (00:29 +0200)]
Introduce reset notifier order

Add the parameter 'order' to qemu_register_reset and sort callbacks on
registration. On system reset, callbacks with lower order will be
invoked before those with higher order. Update all existing users to the
standard order 0.

Note: At least for x86, the existing users seem to assume that handlers
are called in their registration order. Therefore, the patch preserves
this property. If someone feels bored, (s)he could try to identify this
dependency and express it properly on callback registration.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>

14 years agokvm: Fix framebuffer dirty log sync
Jan Kiszka [Fri, 1 May 2009 22:29:37 +0000 (00:29 +0200)]
kvm: Fix framebuffer dirty log sync

kvm_physical_sync_dirty_bitmap() takes the end address as second
argument, not the region size. Moverover, the kvm API should not be used
directly here, but cpu_physical_sync_dirty_bitmap().

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>

14 years agokvm: Add missing bits to support live migration
Jan Kiszka [Fri, 1 May 2009 22:22:51 +0000 (00:22 +0200)]
kvm: Add missing bits to support live migration

This patch adds the missing hooks to allow live migration in KVM mode.
It adds proper synchronization before/after saving/restoring the VCPU
states (note: PPC is untested), hooks into
cpu_physical_memory_set_dirty_tracking() to enable dirty memory logging
at KVM level, and synchronizes that drity log into QEMU's view before
running ram_live_save().

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>

14 years agokvm: Rework dirty bitmap synchronization
Jan Kiszka [Fri, 1 May 2009 18:52:47 +0000 (20:52 +0200)]
kvm: Rework dirty bitmap synchronization

Extend kvm_physical_sync_dirty_bitmap() so that is can sync across
multiple slots. Useful for updating the whole dirty log during
migration. Moreover, properly pass down errors the whole call chain.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>

14 years agokvm: Fix dirty log temporary buffer size
Jan Kiszka [Fri, 1 May 2009 18:52:47 +0000 (20:52 +0200)]
kvm: Fix dirty log temporary buffer size

The buffer passed to KVM_GET_DIRTY_LOG requires one bit per page. Fix
the size calculation in kvm_physical_sync_dirty_bitmap accordingly,
avoiding allocation of extremly oversized buffers.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>

14 years agokvm: Introduce kvm_set_migration_log
Jan Kiszka [Fri, 1 May 2009 18:52:46 +0000 (20:52 +0200)]
kvm: Introduce kvm_set_migration_log

Introduce a global dirty logging flag that enforces logging for all
slots. This can be used by the live migration code to enable/disable
global logging withouth destroying the per-slot setting.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>

14 years agokvm: Conditionally apply workaround for KVM slot handling bug
Jan Kiszka [Fri, 1 May 2009 18:42:15 +0000 (20:42 +0200)]
kvm: Conditionally apply workaround for KVM slot handling bug

Only apply the workaround for broken slot joining in KVM when the
capability was not found that signals the corresponding fix existence.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>

14 years agoqcow2: Allow different cluster sizes
Kevin Wolf [Tue, 19 May 2009 15:57:21 +0000 (17:57 +0200)]
qcow2: Allow different cluster sizes

Add an option to specify the cluster size of a newly created qcow2 image.
Default is 4k which is the same value that was hard-coded before.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>

14 years agoConvert qemu-img convert to new bdrv_create
Kevin Wolf [Mon, 18 May 2009 14:42:12 +0000 (16:42 +0200)]
Convert qemu-img convert to new bdrv_create

This is part two of the qemu-img conversion. This really works the same as the
previous conversion of qemu-img create: It introduces a new -o option for the
generic approach and adds the old-style options to this option set.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>

14 years agoConvert qemu-img create to new bdrv_create
Kevin Wolf [Mon, 18 May 2009 14:42:11 +0000 (16:42 +0200)]
Convert qemu-img create to new bdrv_create

This patch changes qemu-img to actually use the new bdrv_create interface. It
translates the old-style qemu-img options which have been bdrv_create2
parameters or flags so far to option structures. As the generic approach, it
introduces an -o option which accepts any parameter the driver knows.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>

14 years agoConvert all block drivers to new bdrv_create
Kevin Wolf [Mon, 18 May 2009 14:42:10 +0000 (16:42 +0200)]
Convert all block drivers to new bdrv_create

Now we can make use of the newly introduced option structures. Instead of
having bdrv_create carry more and more parameters (which are format specific in
most cases), just pass a option structure as defined by the driver itself.

bdrv_create2() contains an emulation of the old interface to simplify the
transition.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>

14 years agoCreate qemu-option.h
Kevin Wolf [Mon, 18 May 2009 14:42:09 +0000 (16:42 +0200)]
Create qemu-option.h

This patch creates a new header file and the corresponding implementation file
for parsing of parameter strings for options (like used in -drive). Part of
this is code moved from vl.c (so qemu-img can use it later).

The idea is to have a data structure describing all accepted parameters. When
parsing a parameter string, the structure is copied and filled with the
parameter values.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>

14 years agoallow changing the speed of a running migration
Glauber Costa [Wed, 20 May 2009 22:26:58 +0000 (18:26 -0400)]
allow changing the speed of a running migration

This patch allow us to call migrate_set_speed on running
migrations. This should allow mgmt tools to increase the allocated
bandwidth of a running migration if there is no progress, and they
really want the migration to succeed.

Signed-off-by: Glauber Costa <glommer@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>

14 years agointroduce set_rate_limit function for QEMUFile
Glauber Costa [Wed, 20 May 2009 22:26:57 +0000 (18:26 -0400)]
introduce set_rate_limit function for QEMUFile

This patch converts the current callers of qemu_fopen_ops().

Signed-off-by: Glauber Costa <glommer@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>

14 years agoaugment info migrate with page status
Glauber Costa [Thu, 21 May 2009 21:38:01 +0000 (17:38 -0400)]
augment info migrate with page status

This patch augments info migrate output with status about:
* ram bytes remaining
* ram bytes transferred
* ram bytes total

This should be enough for management tools to realize
whether or not there is progress in migration. We can
add more information later on, if the need arrives

[v2: fixes bytes_transferred type]

Signed-off-by: Glauber Costa <glommer@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>

14 years agoDon't send all gratuitous packets at once.
Gleb Natapov [Thu, 21 May 2009 14:17:44 +0000 (17:17 +0300)]
Don't send all gratuitous packets at once.

Use timer to separate them in time.

Signed-off-by: Gleb Natapov <gleb@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>

14 years agoMinimal ethernet frame length is 64 bytes.
Gleb Natapov [Thu, 21 May 2009 14:17:43 +0000 (17:17 +0300)]
Minimal ethernet frame length is 64 bytes.

Signed-off-by: Gleb Natapov <gleb@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>

14 years agoFix segv when passing an unknown protocol
Anthony Liguori [Fri, 22 May 2009 13:17:55 +0000 (08:17 -0500)]
Fix segv when passing an unknown protocol

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>

14 years agoPartially revert e20a8dff4c0da3827764924139d3bb73962f5d5a
Anthony Liguori [Fri, 22 May 2009 15:10:36 +0000 (10:10 -0500)]
Partially revert e20a8dff4c0da3827764924139d3bb73962f5d5a

From Paul Brook:

 "the fdc is tied to the ISA DMA engine. We don't currently have a target
  independent method of handling inter-device data transfer."

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>

14 years agoRevert "Fix arm-softmmu breakage"
Anthony Liguori [Fri, 22 May 2009 14:23:45 +0000 (09:23 -0500)]
Revert "Fix arm-softmmu breakage"

This reverts commit ec6bd8dea77478f32981a5df49f66ca2430ad19d.

This broke any target that uses virtio.  Virtio devices live in libhw and
without whole-archive, the constructors will never be called for virtio.

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>

14 years agoIntroduce is_default field for QEMUMachine
Anthony Liguori [Fri, 22 May 2009 01:41:01 +0000 (20:41 -0500)]
Introduce is_default field for QEMUMachine

f80f9ec changed the order that machines are registered which had the effect of
changing the default machine.  This changeset introduces a new is_default field
so that machine types can declare that they are the default for an architecture.

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>

14 years agoRefactor how display drivers are selected
Anthony Liguori [Thu, 21 May 2009 21:54:00 +0000 (16:54 -0500)]
Refactor how display drivers are selected

My previous commit, f92f8afebe,  broke -vnc (spotted by Glauber Costa).  This
is because it's necessary to tell when the no special display parameters have
been passed and default to SDL or VNC appropriately.

This refactors the display selection logic to be less complicated which has
the effect of fixing the regression mentioned above.

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>

14 years agoFix arm-softmmu breakage
Blue Swirl [Thu, 21 May 2009 18:22:59 +0000 (21:22 +0300)]
Fix arm-softmmu breakage

Don't use whole-archive for hwlib or libqemu objects

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>

14 years agoCompile most Xen files only once
Blue Swirl [Thu, 21 May 2009 15:54:48 +0000 (15:54 +0000)]
Compile most Xen files only once

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>

14 years agoCompile fdc, escc and SCSI controllers only once
Blue Swirl [Thu, 21 May 2009 15:54:36 +0000 (15:54 +0000)]
Compile fdc, escc and SCSI controllers only once

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>

14 years agoLet the venomous poison spread to more identifiers
Blue Swirl [Thu, 21 May 2009 15:54:22 +0000 (18:54 +0300)]
Let the venomous poison spread to more identifiers

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>

14 years agoConvert machine registration to use module init functions
Anthony Liguori [Wed, 20 May 2009 23:38:09 +0000 (18:38 -0500)]
Convert machine registration to use module init functions

This cleans up quite a lot of #ifdefs, extern variables, and other ugliness.

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>

14 years agoEliminate --disable-gfx-check and make VNC default when SDL not available
Anthony Liguori [Wed, 20 May 2009 18:01:02 +0000 (13:01 -0500)]
Eliminate --disable-gfx-check and make VNC default when SDL not available

 --disable-gfx-check predates VNC server support.  It made sense back then
because the only thing you could do without SDL was use -nographic mode or
similar tricks.  Since this is a very advanced mode of operation, gfx-check
provided a good safety net for casual users.

A casual user is very likely to use VNC to interact with a guest.  In fact, it's
often frustrating to install QEMU on a server and have to specify
disable-gfx-check when you only want to use VNC.

This patch eliminates disable-gfx-check and makes SDL behave like every other
optional dependency.  If SDL is not available, instead of failing ungracefully
if no special options are specified, we default to -vnc localhost:0,to=99.
When we do default to VNC, we also print a message to tell the user that we've
done this include which port we're currently listening on.

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>

14 years agoDo not attempt to allocate sn_tab when there are no snapshots
malc [Thu, 21 May 2009 01:40:23 +0000 (05:40 +0400)]
Do not attempt to allocate sn_tab when there are no snapshots

This was caught by a7d27b536ffc0773028a90f14580552c0c3ddb2a which
aborted on this attempt, thanks to Alex Ivanov for report.

Signed-off-by: malc <av1474@comtv.ru>

14 years agoCast pointer arguments of get/setsockopt, send to void * to keep GCC
malc [Thu, 21 May 2009 01:26:23 +0000 (05:26 +0400)]
Cast pointer arguments of get/setsockopt, send to void * to keep GCC
from producing a warning about pointer type mismatches with Winsock

Signed-off-by: malc <av1474@comtv.ru>

14 years agokvm: add error message for when SMP is requested
Mark McLoughlin [Tue, 12 May 2009 11:43:19 +0000 (12:43 +0100)]
kvm: add error message for when SMP is requested

Right now, if you try e.g. '-smp 2' you just get 'failed to
initialize KVM'.

Signed-off-by: Mark McLoughlin <markmc@redhat.com>

14 years agoRemove initrd warning message
Richard W.M. Jones [Tue, 12 May 2009 07:12:05 +0000 (08:12 +0100)]
Remove initrd warning message

Signed-off-by: Richard W.M. Jones <rjones@redhat.com>

14 years agoinitialize struct sigevent before timer_create
Jean-Christophe Dubois [Sun, 17 May 2009 16:41:16 +0000 (18:41 +0200)]
initialize struct sigevent before timer_create

When qemu is run under valgrind, valgrind shows the following output
on exit:

==3648== 1 errors in context 2 of 2:
==3648== Syscall param timer_create(evp) points to uninitialised byte(s)
==3648==    at 0x54E936A: timer_create (in /lib/librt-2.9.so)
==3648==    by 0x405DCF: dynticks_start_timer (vl.c:1549)
==3648==    by 0x40A966: main (vl.c:1726)
==3648==  Address 0x7fefffb34 is on thread 1's stack
==3648==  Uninitialised value was created by a stack allocation
==3648==    at 0x405D60: dynticks_start_timer (vl.c:1534)

This patch is a simple fix to remove this potential problem.

Signed-off-by: Jean-Christophe DUBOIS <jcd@tribudubois.net>

14 years agoFix NULL alarm_timer pointer at exit
Jean-Christophe Dubois [Sun, 17 May 2009 16:38:39 +0000 (18:38 +0200)]
Fix NULL alarm_timer pointer at exit

This fixes a SIGSEGV error on qemu exit.

Here is the valgrind output related to this error

==3648== Process terminating with default action of signal 11 (SIGSEGV)
==3648==  Access not within mapped region at address 0x8
==3648==    at 0x40636B: host_alarm_handler (vl.c:1345)
==3648==    by 0x52D807F: (within /lib/libpthread-2.9.so)
==3648==    by 0x5C0A12E: tcsetattr (in /lib/libc-2.9.so)
==3648==    by 0x4DD601: term_exit (qemu-char.c:700)
==3648==    by 0x5B636EC: exit (in /lib/libc-2.9.so)
==3648==    by 0x5B4B5AC: (below main) (in /lib/libc-2.9.so)

This simple fix check for a valid pointer as host_alarm_handler is
also called after alarm_timer is released in the exit path.

Signed-off-by: Jean-Christophe DUBOIS <jcd@tribudubois.net>

14 years agokeep initrd in below 4g area.
Glauber Costa [Mon, 18 May 2009 20:35:58 +0000 (16:35 -0400)]
keep initrd in below 4g area.

initrd must be kept on the memory area below 4g. By not doing this,
we're seeing guests break while using -initrd and values of -mem
superior to 4096.

Signed-off-by: Glauber Costa <glommer@redhat.com>

14 years agomigrate.c: migrate_fd_put_buffer: Do not busyloop: stop writing if EWOULDBLOCK
Uri Lublin [Tue, 19 May 2009 11:08:53 +0000 (14:08 +0300)]
migrate.c: migrate_fd_put_buffer: Do not busyloop: stop writing if EWOULDBLOCK

The migration code is non-blocking, designed for live migration.

Practically migrate_fd_put_buffer busy-loops trying to write, as
on many machines EWOULDBLOCK==EAGAIN (look in include/asm-generic/errno.h).

Signed-off-by: Uri Lublin <uril@redhat.com>

14 years agokvm: work around supported cpuid ioctl() brokenness
Mark McLoughlin [Tue, 19 May 2009 17:55:21 +0000 (18:55 +0100)]
kvm: work around supported cpuid ioctl() brokenness

KVM_GET_SUPPORTED_CPUID has been known to fail to return -E2BIG
when it runs out of entries. Detect this by always trying again
with a bigger table if the ioctl() fills the table.

Signed-off-by: Mark McLoughlin <markmc@redhat.com>

14 years agoremove gcc 3.x requirement from documentation
Hollis Blanchard [Tue, 19 May 2009 20:08:25 +0000 (15:08 -0500)]
remove gcc 3.x requirement from documentation

This text is no longer accurate. After the patch is applied, the
generated version at http://www.nongnu.org/qemu/qemu-doc.html should be
regenerated.

This patch is also a candidate for the stable branch. (The URL above is
probably generated from the stable branch anyways, so maybe it goes
without saying.)

Signed-off-by: Hollis Blanchard <hollisb@us.ibm.com>

14 years agoRemove dead code
malc [Tue, 19 May 2009 23:25:22 +0000 (03:25 +0400)]
Remove dead code

Signed-off-by: malc <av1474@comtv.ru>

14 years agoFormat per CODING_STYLE
malc [Tue, 19 May 2009 18:28:26 +0000 (22:28 +0400)]
Format per CODING_STYLE

Signed-off-by: malc <av1474@comtv.ru>

14 years agoAbort on attempts to allocate zero bytes
malc [Tue, 19 May 2009 18:26:42 +0000 (22:26 +0400)]
Abort on attempts to allocate zero bytes

http://marc.info/?t=124267873300015&r=1&w=2

Signed-off-by: malc <av1474@comtv.ru>

14 years agoUnbreak out-of-tree builds
malc [Tue, 19 May 2009 16:55:09 +0000 (20:55 +0400)]
Unbreak out-of-tree builds

Signed-off-by: malc <av1474@comtv.ru>

14 years agoHardware convenience library
Paul Brook [Tue, 19 May 2009 15:17:58 +0000 (16:17 +0100)]
Hardware convenience library

The only target dependency for most hardware is sizeof(target_phys_addr_t).
Build these files into a convenience library, and use that instead of
building for every target.

Remove and poison various target specific macros to avoid bogus target
dependencies creeping back in.

Big/Little endian is not handled because devices should not know or care
about this to start with.

Signed-off-by: Paul Brook <paul@codesourcery.com>

14 years agoDisable >4G ram support on 32-bit targets
Paul Brook [Tue, 19 May 2009 15:05:00 +0000 (16:05 +0100)]
Disable >4G ram support on 32-bit targets

If the target only has a 32-bit physical address space then
the code to map >4G ram breaks horribly, and causes compiler warnings.

Signed-off-by: Paul Brook <paul@codesourcery.com>

14 years agoOnly define __llseek if it is going to be used
Paul Brook [Tue, 19 May 2009 14:58:52 +0000 (15:58 +0100)]
Only define __llseek if it is going to be used

Signed-off-by: Paul Brook <paul@codesourcery.com>

14 years agoAvoid implicit truncation compiler warnings
Paul Brook [Tue, 19 May 2009 14:42:39 +0000 (15:42 +0100)]
Avoid implicit truncation compiler warnings

Signed-off-by: Paul Brook <paul@codesourcery.com>

14 years agoRemove obsolete BIOS_SIZE from sysemu.h
Paul Brook [Tue, 19 May 2009 13:52:42 +0000 (14:52 +0100)]
Remove obsolete BIOS_SIZE from sysemu.h

BIOS_SIZE is no longer needed by vl.c, so there's no point having it in
sysemu.h.

Signed-off-by: Paul Brook <paul@codesourcery.com>

14 years agocris: First shot at qdev for CRIS interrupts.
Edgar E. Iglesias [Mon, 18 May 2009 20:24:22 +0000 (22:24 +0200)]
cris: First shot at qdev for CRIS interrupts.

Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>

14 years agoetrax: Don't keep the passed irq pointer.
Edgar E. Iglesias [Mon, 18 May 2009 19:44:10 +0000 (21:44 +0200)]
etrax: Don't keep the passed irq pointer.

Copy passed irq object at channel connect.

Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>

14 years agoetrax: Remove unused eth irq line.
Edgar E. Iglesias [Mon, 18 May 2009 19:34:00 +0000 (21:34 +0200)]
etrax: Remove unused eth irq line.

The ethernet blocks irq line to report errors is unimplemented in QEMU.
Remove it for now.

Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>

14 years agoSyborg virtio bindings.
Paul Brook [Mon, 18 May 2009 15:45:48 +0000 (16:45 +0100)]
Syborg virtio bindings.

Implement Syborg device bindings for virtio-net.

Signed-off-by: Paul Brook <paul@codesourcery.com>

14 years agoSeparate virtio PCI code
Paul Brook [Mon, 18 May 2009 13:51:59 +0000 (14:51 +0100)]
Separate virtio PCI code

Split the PCI host bindings from the VRing transport implementation.

Signed-off-by: Paul Brook <paul@codesourcery.com>

14 years agoOnly shutdown video subsytem in sdl_cleanup
malc [Sun, 17 May 2009 14:26:05 +0000 (18:26 +0400)]
Only shutdown video subsytem in sdl_cleanup

Depending on the order in which atexit handlers are called SDL might
try to join on an audio thread without said thread ever being notified
that it must stop, hence QEMU will forever block in pthread_join call.

Signed-off-by: malc <av1474@comtv.ru>

14 years agoConsistently use uint64_t for int properties
Paul Brook [Sun, 17 May 2009 13:55:55 +0000 (14:55 +0100)]
Consistently use uint64_t for int properties

I apparently failed to do this properly on the first attempt.

Signed-off-by: Paul Brook <paul@codesourcery.com>

14 years agoETRAX-PIC: Untabify.
Edgar E. Iglesias [Sat, 16 May 2009 10:28:33 +0000 (12:28 +0200)]
ETRAX-PIC: Untabify.

Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>

14 years agoETRAX-TIMER: qdevify.
Edgar E. Iglesias [Sat, 16 May 2009 00:08:16 +0000 (02:08 +0200)]
ETRAX-TIMER: qdevify.

Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>

14 years agoETRAX-TIMER: Untabify.
Edgar E. Iglesias [Fri, 15 May 2009 23:46:26 +0000 (01:46 +0200)]
ETRAX-TIMER: Untabify.

Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>

14 years agoETRAX-SER: Untabify.
Edgar E. Iglesias [Fri, 15 May 2009 23:44:24 +0000 (01:44 +0200)]
ETRAX-SER: Untabify.

Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>

14 years agoETRAX-SER: qdevify.
Edgar E. Iglesias [Fri, 15 May 2009 23:40:46 +0000 (01:40 +0200)]
ETRAX-SER: qdevify.

Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>

14 years agoETRAX: Simplify PIC interface.
Edgar E. Iglesias [Fri, 15 May 2009 22:23:15 +0000 (00:23 +0200)]
ETRAX: Simplify PIC interface.

Instead of exporting a custom structure to represent different
interrupt types, just export the irq array and have the top
elements point to the NMI lines.

Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>

14 years agosupport ELF_HWCAP for PPPC
Nathan Froyd [Tue, 12 May 2009 19:26:59 +0000 (12:26 -0700)]
support ELF_HWCAP for PPPC

Signed-off-by: Nathan Froyd <froydnj@codesourcery.com>
Signed-off-by: malc <av1474@comtv.ru>

14 years agolinux-user: ppc signal handling
Nathan Froyd [Wed, 13 May 2009 02:13:18 +0000 (19:13 -0700)]
linux-user: ppc signal handling

Implement setup_{,rt_}frame and do_{,rt_}sigreturn for PPC 32-bit.  Use
the same TARGET_QEMU_ESIGRETURN hack as for MIPS to avoid clobbering
register state on a sigreturn.

Signed-off-by: Nathan Froyd <froydnj@codesourcery.com>
Signed-off-by: malc <av1474@comtv.ru>

14 years agotarget-ppc: expose cpu capability flags
Nathan Froyd [Tue, 12 May 2009 19:26:57 +0000 (12:26 -0700)]
target-ppc: expose cpu capability flags

Do this so other pieces of code can make decisions based on the
capabilities of the CPU we're emulating.

Signed-off-by: Nathan Froyd <froydnj@codesourcery.com>
Signed-off-by: malc <av1474@comtv.ru>

14 years agoETRAX: Correct passing of kernel command line.
Edgar E. Iglesias [Fri, 15 May 2009 14:53:53 +0000 (16:53 +0200)]
ETRAX: Correct passing of kernel command line.

Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>

14 years agofix ARMv7 data processing instructions
Juha Riihimäki [Wed, 6 May 2009 06:16:12 +0000 (09:16 +0300)]
fix ARMv7 data processing instructions

ARMv7 defines a new behavior for ARM data processing instructions
compared to earlier architecture revisions; when the destination
register is R15, a Branch and Exchange operation is executed rather
than a simple Branch to the target address. This patch corrects the
behavior of the emulation for the aforementioned operations. To be
applied after applying the previous patch in this patch set.

Signed-off-by: Juha Riihimäki <juha.riihimaki@nokia.com>
Signed-off-by: Paul Brook <paul@codesourcery.com>

14 years agofix ARMv7 data processing instructions
Juha Riihimäki [Wed, 6 May 2009 06:15:38 +0000 (09:15 +0300)]
fix ARMv7 data processing instructions

Modernize parts of target-arm/translate.c in preparation for the
modifications in the subsequent patch in this patch set. This is done
in order to avoid writing new code to target-arm/translate.c that
would use deprecated methods and/or variables.

Signed-off-by: Juha Riihimäki <juha.riihimaki@nokia.com>
Signed-off-by: Paul Brook <paul@codesourcery.com>

14 years agoFix module initialization when more than 1 class is in use
Anthony Liguori [Thu, 14 May 2009 22:57:31 +0000 (17:57 -0500)]
Fix module initialization when more than 1 class is in use

Now that we're using enums for module types, it makes no sense to bother keeping
a list of module types when we know exactly how many they are.

Switching to an array simplifies the code and eliminates the aforementioned bug.

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>

14 years agoSyborg (Symbian Virtual Platform) board
Paul Brook [Thu, 14 May 2009 22:11:09 +0000 (23:11 +0100)]
Syborg (Symbian Virtual Platform) board

A virtual reference platform for SymbianOS development/debugging.

Signed-off-by: Paul Brook <paul@codesourcery.com>

14 years agoFix warning on WIN32
Anthony Liguori [Thu, 14 May 2009 21:57:03 +0000 (16:57 -0500)]
Fix warning on WIN32

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>