Commit Graph

8398 Commits

Author SHA1 Message Date
Ulrich Hecht 12727917db linux-user: zero fstat buffer to initialize nsec fields
The fstat implementation does not initialize the nanosecond fields in the
stat buffer; this caused funny values to turn up there, preventing, for
instance, cp -p from preserving timestamps because utimensat rejected
the out-of-bounds nanosecond values. Resetting the entire structure
to zero fixes that.

Signed-off-by: Ulrich Hecht <uli@suse.de>
Signed-off-by: Riku Voipio <riku.voipio@iki.fi>
2009-08-25 17:15:35 +03:00
Ulrich Hecht e72d2cc781 linux-user: fadvise64 implementation
good enough to pass all LTP fadvise64 tests

Signed-off-by: Ulrich Hecht <uli@suse.de>
Signed-off-by: Riku Voipio <riku.voipio@iki.fi>
2009-08-25 17:15:35 +03:00
Ulrich Hecht d83c8733b7 linux-user: enable getdents for > 32-bit systems
works perfectly fine with the example from getdents(2) and passes the LTP
tests (tested with s390x on x86_64 emulation)

Signed-off-by: Ulrich Hecht <uli@suse.de>
Signed-off-by: Riku Voipio <riku.voipio@iki.fi>
2009-08-25 17:15:34 +03:00
Ulrich Hecht 7e22e54602 linux-user: fcntl fixes for LTP
Fixes swaps on l_pid which were pretty much of random size. Implements
F_SETLEASE, F_GETLEASE. Now passes all LTP fcntl tests.

Signed-off-by: Ulrich Hecht <uli@suse.de>
Signed-off-by: Riku Voipio <riku.voipio@iki.fi>
2009-08-25 17:15:34 +03:00
Nathan Froyd 8ec9cf8971 linux-user: fix mq_* compilation problems
mqueue.h is only available if __NR_mq_open is defined.  So don't include
it unconditionally.  Similarly, the mq_* family of syscalls depend on
__NR_mq_open.  Finally, the copy_{from,to}_user_mq_attr functions should
not be defined unconditionally, but only if we're going to use the mq_*
syscalls.

Signed-off-by: Nathan Froyd <froydnj@codesourcery.com
Signed-off-by: Riku Voipio <riku.voipio@iki.fi>
2009-08-25 17:15:34 +03:00
Laurent Vivier c761c15403 m68k, linux-user: enable sigaltstack()
As setup_frame() and setup_rt_frame() are now implemented we can now
enable sigaltstack().

Signed-off-by: Laurent Vivier <laurent@vivier.eu>
Signed-off-by: Riku Voipio <riku.voipio@iki.fi>
2009-08-25 17:15:34 +03:00
Laurent Vivier 7181155db9 m68k, linux-user: add setup_rt_frame
This patch implements setup_rt_frame().

Signed-off-by: Laurent Vivier <laurent@vivier.eu>
Signed-off-by: Riku Voipio <riku.voipio@iki.fi>
2009-08-25 17:15:34 +03:00
Laurent Vivier 492a87445b m68k,linux-user: add setup_frame
This patch adds signals management for linux-user.

It implements setup_frame() which allows to call the user signal
handler.

setup_rt_frame() is always unimplemented.

Signed-off-by: Laurent Vivier <laurent@vivier.eu>
Signed-off-by: Riku Voipio <riku.voipio@iki.fi>
2009-08-25 17:15:33 +03:00
Riku Voipio c2882b9654 linux-user: add eventfd support
Straightforward implementation. This syscall is rare enough that we
don't need to support the odder cases, just disable it if host glibc
is too old.

Signed-off-by: Riku Voipio <riku.voipio@iki.fi>
2009-08-25 17:15:26 +03:00
Laurent Desnogues 4e6f6d4c20 ARM back-end: Fix encode_imm
the encode_imm function in tcg/arm/tcg-target.c lacks shift declaration.

Laurent

Signed-off-by: Laurent Desnogues <laurent.desnogues@gmail.com>
Signed-off-by: Andrzej Zaborowski <andrew.zaborowski@intel.com>
2009-08-25 01:14:14 +02:00
Anthony Liguori 0d6b0b1d81 Make the e1000 the default network adapter for the pc target.
The ne2k is an ancient card that performs pretty terribly under QEMU.  In many
modern OSes, there is no longer drivers available for the ne2k.

Switch the default network adapter to e1000.  This card is more widely
suppported and performs rather well under QEMU.  There may be very old OSes
that had a ne2k driver but not an e1000 driver but I think this is likely the
exception.

I think the average user is better served with an e1000 vs ne2k.

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-08-24 08:46:48 -05:00
Nathan Froyd 5ec4d682d2 eliminate errors about unused results in block/vpc.c
These errors come up when compiling with gcc-4.3.3 and some older headers:

/scratch/froydnj/qemu.git/block/vpc.c: In function 'vpc_create':
/scratch/froydnj/qemu.git/block/vpc.c:514: error: value computed is not used
/scratch/froydnj/qemu.git/block/vpc.c:516: error: value computed is not used
/scratch/froydnj/qemu.git/block/vpc.c:517: error: value computed is not used
/scratch/froydnj/qemu.git/block/vpc.c:566: error: value computed is not used

Use memcpy to copy the strings instead of strncpy.

Signed-off-by: Nathan Froyd <froydnj@codesourcery.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-08-24 08:46:48 -05:00
Gerd Hoffmann 177539e06d virtio-blk: add msi support.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-08-24 08:46:48 -05:00
Gerd Hoffmann aa7116cbc8 qdev/prop: convert isa-bus to helper macros.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-08-24 08:46:48 -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
Michael S. Tsirkin 3987e1cf6d qemu: move virtio-pci.o to near pci.o
virtio-pci depends, and will always depend, on pci.c
so it makes sense to keep it in the same makefile,
(unlike the rest of virtio files which should eventually
 be moved out to Makefile.hw).

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-08-24 08:46:47 -05:00
Amit Shah 793cbfb5d1 char: Emit 'CLOSED' events on char device close
Notify users of the char interface whenever the file / connection is
closed.

Signed-off-by: Amit Shah <amit.shah@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-08-24 08:21:42 -05:00
Nathan Froyd 0b5c1ce846 cleanup cpu-exec.c, part 0/N: consolidate handle_cpu_signal
handle_cpu_signal is very nearly copy-paste code for each target, with a
few minor variations.  This patch sets up appropriate defaults for a
generic handle_cpu_signal and provides overrides for particular targets
that did things differently.  Fixing things like the persistent (XXX:
use sigsetjmp) should now become somewhat easier.

Previous comments on this patch suggest that the "activate soft MMU for
this block" comments refer to defunct functionality.  I have removed
such blocks for the appropriate targets in this patch.

Signed-off-by: Nathan Froyd <froydnj@codesourcery.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-08-24 08:21:42 -05:00
Paolo Bonzini 7f79dd281c unify popen/fopen qemu wrappers
While reading Chris's code for fd migration I noticed the duplication
between QEMUFilePopen and QEMUFileStdio.  This fixes it, and makes
qemu_fopen more similar qemu_popen.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-08-24 08:02:55 -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
Anthony Liguori 4a1418e07b Unbreak large mem support by removing kqemu
kqemu introduces a number of restrictions on the i386 target.  The worst is that
it prevents large memory from working in the default build.

Furthermore, kqemu is fundamentally flawed in a number of ways.  It relies on
the TSC as a time source which will not be reliable on a multiple processor
system in userspace.  Since most modern processors are multicore, this severely
limits the utility of kqemu.

kvm is a viable alternative for people looking to accelerate qemu and has the
benefit of being supported by the upstream Linux kernel.  If someone can
implement work arounds to remove the restrictions introduced by kqemu, I'm
happy to avoid and/or revert this patch.

N.B. kqemu will still function in the 0.11 series but this patch removes it from
the 0.12 series.

Paul, please Ack or Nack this patch.

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-08-24 08:02:55 -05:00
Zachary Amsden 0953a80f04 Add a configure switch to enable / disable all user targets. I felt compelled to do it for symmetry, mostly it is useful to disable user targets when you don't want to build them.
Signed-off-by: Zachary Amsden <zamsden@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-08-24 08:01:42 -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
Avi Kivity 1632dc6a8f Route IOAPIC interrupts via ISA bus
Instead of calling the IOAPIC from the PIC, raise IOAPIC irqs via the ISA bus.
As a side effect, IOAPIC lines 16-23 are enabled.

Signed-off-by: Avi Kivity <avi@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-08-24 08:01:42 -05:00
Avi Kivity 1452411b25 Route PC irqs to ISA bus instead of i8259 directly
A PC has its motherboard IRQ lines connected to both the PIC and IOAPIC.
Currently, qemu routes IRQs to the PIC which then calls the IOAPIC, an
incestuous arrangement.  In order to clean this up, create a new ISA IRQ
abstraction, and have devices raise ISA IRQs (which in turn raise the i8259
IRQs as usual).

Signed-off-by: Avi Kivity <avi@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-08-24 08:01:41 -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
Jes Sorensen 6b35e7bf48 QEMU set irq0override in fw_cfg
Hi,

After discussing the issue with Avi, Gleb and a couple others on irq,
we came to the conclusion that it is preferred to have QEMU request
features from the BIOS, rather than notifying the BIOS that it is
running on QEMU or KVM. This way memory ranges can change etc. and
an older BIOS will continue to work on newer QEMU if it receives the
info as a fw_cfg value.

This one also matches what qemu-kvm does for irq0override, except I
haven't made it configurable. I leave that as an exercise for whoever
would be interested in switching off irq0override.

Thanks,
Jes

Set irq0 override in fw_cfg, informing the BIOS that QEMU expects
override on irq0. This matches qemu-kvm, and will help sharing a
single BIOS binary.

Signed-off-by: Jes Sorensen <jes@sgi.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-08-24 08:01:41 -05:00
Brian Wheeler e8b5439495 SMART ATA Functionality
For the lulz I implemented basic SMART functionality in ide.c.  smartctl
on linux recognizes it just fine and starting self tests with it
complete successfully.

Signed-off-by: Brian Wheeler <bdwheele@indiana.edu>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-08-24 08:01:41 -05:00
Stefan Weil 7dc3fa0913 Add missing linefeed in error message
The error message for an unknown network device given to
monitor command set_link looks better with a terminating
linefeed.

Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-08-24 08:01:40 -05:00
Zachary Amsden 861767594b Clean up VGA type selection; far too many variables being used to track one state leads to confusion if new variables are added.
Signed-off-by: Zachary Amsden <zamsden@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-08-24 08:01:40 -05:00
Zachary Amsden 52c18be9e9 When using stdio monitor and VNC display, one can set or clear a VNC password; this should set or turn off VNC authentication as well.
Signed-off-by: Zachary Amsden <zamsden@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-08-24 08:01:40 -05:00
Zachary Amsden 7ef923310a Don't segfault when changing VNC password on an SDL display.
Signed-off-by: Zachary Amsden <zamsden@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-08-24 08:01:40 -05:00
Chris Lalancette 9075000958 Fix detached migration with exec.
When trying to do detached migration with exec, I found that
the monitor wouldn't always return in a timely manner.  I
tracked this down to exec_start_outgoing_migration.  It
appeared we were setting the fd to NONBLOCK'ing, but in
point of fact we weren't.

This bugfix should also go onto the stable 0.10 branch

Signed-off-by: Chris Lalancette <clalance@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-08-24 08:01:40 -05:00
Avi Kivity 6b99dadc4a Do not disable autostart for live migration
If the user does not want autostart, they can specify -S.

Signed-off-by: Avi Kivity <avi@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-08-24 08:01:39 -05:00
Stefano Stabellini 04a52b4120 make vga screen_dump use DisplayState properly
Hi all,
currently the vga screen_dump code doesn't use the DisplayState
interface properly and tries to replace it temporarily while taking the
screenshot.
A better approach is to register a DisplayChangeListener, call
vga_hw_update, and finally write the ppm in the next call from dpy_update.

Testing is appreciated.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-08-24 08:01:39 -05:00
malc b6f6d0e2f8 Restore consistent formatting
Signed-off-by: malc <av1474@comtv.ru>
2009-08-24 15:18:40 +04:00
Juan Quintela e5944641ab es1370: Remove unused indirection of PCIES1370State and ES1370State
Signed-off-by: Juan Quintela <quintela@redhat.com>
2009-08-24 15:15:31 +04:00
Blue Swirl 2a1704a71d Fix device name completion for 'eject'
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2009-08-23 20:10:28 +00:00
Andrzej Zaborowski 4445b0a624 Revert my commit c00a9de060
was incorrect.
2009-08-23 19:00:58 +02:00
Torsten Duwe 8d30b794ce Fix segfault of qemu-system-arm with PXA target
qemu-system-arm (0.10.5) segfaults when invoked with a PXA machine target,
e.g. -M tosa. The reason is fairly obvious:

Signed-off-by: Torsten Duwe <duwe@lst.de>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Andrzej Zaborowski <balrogg@gmail.com>
2009-08-23 18:08:14 +02:00
Reimar Döffinger 699960b272 sdl.c: support 32 bpp cursors
Hello,
currently when a 32 bpp cursor gets defined the result is all-black in
the areas that are not transparent (you'll get a 32 bpp cursor if you
use my previous patch to allow vmware_vga to use a 32 bpp framebuffer).
This is because the switch in sdl.c lacks a 32 bpp case.
The thing I am unsure about though is which byte is the unused one and
should be skipped, the first or the last - for the black-and-white
cursors I tested it doesn't make a difference...

Signed-off-by: Reimar Döffinger <Reimar.Doeffinger@gmx.de>
Signed-off-by: Andrzej Zaborowski <balrogg@gmail.com>
2009-08-23 18:03:34 +02:00
Reimar Döffinger c00a9de060 Use corect depth from DisplaySurface in vmware_vga.c
Hello,
for what I can tell, there is no way for vmware_vga to work correctly
right now. It assumes that the framebuffer bits-per-pixel and the one
from the DisplaySurface are identical (it uses directly the VRAM from
vga.c), but it always assumes 3 bytes per pixel, which is never possible
with the current version of DisplaySurface.
Attached patch fixes that by using ds_get_bits_per_pixel.
2009-08-23 18:00:33 +02:00
Andrzej Zaborowski 13f59cbfe3 Remove the unnecessary and only global in musicpal.c 2009-08-23 17:44:20 +02:00
Andrzej Zaborowski 7ef6e71c59 Merge with balrog@git.sv.gnu.org:/srv/git/qemu.git 2009-08-23 17:19:44 +02:00
Andrzej Zaborowski d074769c5a Make musicpal.c use the I2C device and the Marvell 88w8618 audio device
Signed-off-by: Benoit Canet <benoit.canet@gmail.com>
Signed-off-by: Andrzej Zaborowski <balrogg@gmail.com>
2009-08-23 15:51:14 +02:00
Andrzej Zaborowski ef07b49145 Extract the Marvell 88w8618 audio device from musicpal.c
Signed-off-by: Benoit Canet <benoit.canet@gmail.com>
Signed-off-by: Andrzej Zaborowski <balrogg@gmail.com>
2009-08-23 15:44:15 +02:00
Andrzej Zaborowski 3ead03bd0a Extract musicpal.c I2C bitbanging code and make it gpio aware
Signed-off-by: Benoit Canet <benoit.canet@gmail.com>
Signed-off-by: Andrzej Zaborowski <balrogg@gmail.com>
2009-08-23 15:38:50 +02:00
Benoit Canet 343ec8e485 Musicpal qdev conversion: gpio (except I2C part), keyboard and lcd
Signed-off-by: Benoit Canet <benoit.canet@gmail.com>
Signed-off-by: Andrzej Zaborowski <balrogg@gmail.com>
2009-08-23 14:38:07 +02:00
Blue Swirl d453c2c32e Sparc32: fix monitor commands 'info pic' and 'info irq'
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2009-08-23 12:23:30 +00:00
Blue Swirl 7432ff5d6b Rearrange to suppress gcc 3.3.5 warning about unused variable
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2009-08-23 06:12:54 +00:00