qemu
15 years agoadded -numa cmdline parameter parser (Andre Przywara)
aliguori [Tue, 21 Apr 2009 22:30:27 +0000 (22:30 +0000)]
added -numa cmdline parameter parser (Andre Przywara)

adds a -numa command line parameter and sets a QEMU global array with
the memory sizes. The CPU-to-node assignemnt is written into the
CPUState. If no specific values for memory and CPUs are given,
all resources will be split equally across all nodes.
This code currently support only up to 64 virtual CPUs.

Signed-off-by: Andre Przywara <andre.przywara@amd.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@7210 c046a42c-6fe2-441c-8c8c-71466251a162

15 years agoSafety net for the cases where disassembler/translator disagree over instruction...
malc [Tue, 21 Apr 2009 22:26:22 +0000 (22:26 +0000)]
Safety net for the cases where disassembler/translator disagree over instruction decoding

Noticed by Mark Karpeles.

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@7209 c046a42c-6fe2-441c-8c8c-71466251a162

15 years agonet: Prevent multiple slirp instances (Jan Kiszka)
aliguori [Tue, 21 Apr 2009 20:49:11 +0000 (20:49 +0000)]
net: Prevent multiple slirp instances (Jan Kiszka)

The slirp stack is full of global variables which prevents instantiating
it more than once. Catch this during net_slirp_init to prevent more harm
later on.

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

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@7208 c046a42c-6fe2-441c-8c8c-71466251a162

15 years agoslirp: Enhance host-guest redirection setup (Jan Kiszka)
aliguori [Tue, 21 Apr 2009 19:56:44 +0000 (19:56 +0000)]
slirp: Enhance host-guest redirection setup (Jan Kiszka)

Allow to establish a TCP/UDP connection redirection also via a monitor
command 'host_net_redir'. Moreover, assume TCP as connection type if
that parameter is omitted.

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

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@7204 c046a42c-6fe2-441c-8c8c-71466251a162

15 years agonet: Untangle nested qemu_send_packet (Jan Kiszka)
aliguori [Tue, 21 Apr 2009 19:56:41 +0000 (19:56 +0000)]
net: Untangle nested qemu_send_packet (Jan Kiszka)

Queue packets that are send during an ongoing packet delivery. This
ensures that packets will always arrive in their logical order at each
client of a VLAN. Currently, slirp generates such immediate relies, and
e.g. packet-sniffing clients on the same VLAN may get confused.

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

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@7203 c046a42c-6fe2-441c-8c8c-71466251a162

15 years agomonitor: Allow host_net_add/remove for all targets (Jan Kiszka)
aliguori [Tue, 21 Apr 2009 19:56:36 +0000 (19:56 +0000)]
monitor: Allow host_net_add/remove for all targets (Jan Kiszka)

There is nothing x86-specific in host_net_add/remove, so allow them for
all targets.

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

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@7202 c046a42c-6fe2-441c-8c8c-71466251a162

15 years agomonitor: Improve host_net_add (Jan Kiszka)
aliguori [Tue, 21 Apr 2009 19:56:32 +0000 (19:56 +0000)]
monitor: Improve host_net_add (Jan Kiszka)

Fix the documentation of the host_net_add monitor command and allow the
user to pass no options at all. Moreover, inform the user on the
monitor terminal if a request failed.

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

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@7201 c046a42c-6fe2-441c-8c8c-71466251a162

15 years agonet: Add support for capturing VLANs (Jan Kiszka)
aliguori [Tue, 21 Apr 2009 19:56:28 +0000 (19:56 +0000)]
net: Add support for capturing VLANs (Jan Kiszka)

This patch is derived from Tristan Gingold's patch. It adds a new VLAN
client type that writes all traffic on the VLAN it is attached to into a
pcap file. Such a file can then be analyzed offline with Wireshark or
tcpdump.

Besides rebasing and some minor cleanups, the major differences to the
original version are:
 - support for enabling/disabling via the monitor (host_net_add/remove)
 - no special ordering of VLAN client list, qemu_send_packet now takes
   care of properly ordered packets
 - 64k default capturing limit (I hate tcpdump's default)

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

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@7200 c046a42c-6fe2-441c-8c8c-71466251a162

15 years agoAllow empty params for check_params (Jan Kiszka)
aliguori [Tue, 21 Apr 2009 19:56:23 +0000 (19:56 +0000)]
Allow empty params for check_params (Jan Kiszka)

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

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@7199 c046a42c-6fe2-441c-8c8c-71466251a162

15 years agoslirp: Handle DHCP requests for specific IP (Jan Kiszka)
aliguori [Tue, 21 Apr 2009 19:56:20 +0000 (19:56 +0000)]
slirp: Handle DHCP requests for specific IP (Jan Kiszka)

This adds proper handling of the ciaddr field as well as the "Requested
IP Address" option to slirp's DHCP server. If the client requests an
invalid or used IP, a NAK reply is sent, if it requests a specific but
valid IP, this is now respected.

NAK'ing invalid IPs is specifically useful when changing the slirp IP
range via '-net user,ip=...' while the client saved its previously used
address and tries to reacquire it. Now this will be NAK'ed and the
client will start a new discovery round.

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

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@7198 c046a42c-6fe2-441c-8c8c-71466251a162

15 years agonet: Add parameter checks for VLAN clients (Jan Kiszka)
aliguori [Tue, 21 Apr 2009 19:56:15 +0000 (19:56 +0000)]
net: Add parameter checks for VLAN clients (Jan Kiszka)

This aims at helping the user to find typos or other mistakes in
parameter lists passed for VLAN client initialization. The existing
parsing infrastructure does not allow a leaner approach, but this is
better than nothing IMHO.

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

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@7197 c046a42c-6fe2-441c-8c8c-71466251a162

15 years agonet: Fix -net socket,listen (Jan Kiszka)
aliguori [Tue, 21 Apr 2009 19:56:11 +0000 (19:56 +0000)]
net: Fix -net socket,listen (Jan Kiszka)

In case no symbolic name is provided when requesting VLAN connection via
listening TCP socket ('-net socket,listen=...'), qemu crashes. This
fixes the cause.

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

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@7196 c046a42c-6fe2-441c-8c8c-71466251a162

15 years agonet: Check device passed to host_net_remove (Jan Kiszka)
aliguori [Tue, 21 Apr 2009 19:56:08 +0000 (19:56 +0000)]
net: Check device passed to host_net_remove (Jan Kiszka)

Make sure that we do not delete guest NICs via host_net_remove.

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

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@7195 c046a42c-6fe2-441c-8c8c-71466251a162

15 years agoMIPS signal handling fixes.
pbrook [Tue, 21 Apr 2009 01:41:10 +0000 (01:41 +0000)]
MIPS signal handling fixes.

Also fixes a register corruption bug in do_sigreturn. When "returning"
from sigreturn we are actually restoring the virtual cpu state from the
signal frame.  This is actually surprisingly hard to observe in practice.

Typically an thread be blocked in a FUTEX_WAIT call when the signal arrives,
so the effect is a spurious syscall success and the introduction of a
subtle race condition.

On x86/arm a syscall modifies a single word sized register, so
do_sigreturn can just return that value.  On MIPS a syscall clobbers
multiple registers, so we need additional smarts.  My solution is to
invent a magic errno value that means "don't touch CPU state".

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@7194 c046a42c-6fe2-441c-8c8c-71466251a162

15 years agoMIPS: Raise SIGSEGV, not SIGILL when an access faults.
pbrook [Tue, 21 Apr 2009 01:03:10 +0000 (01:03 +0000)]
MIPS: Raise SIGSEGV, not SIGILL when an access faults.

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

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@7193 c046a42c-6fe2-441c-8c8c-71466251a162

15 years agoFix target_siginfo ordering for MIPS.
pbrook [Tue, 21 Apr 2009 00:59:40 +0000 (00:59 +0000)]
Fix target_siginfo ordering for MIPS.

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

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@7192 c046a42c-6fe2-441c-8c8c-71466251a162

15 years agoEnable access to SYNCI_Step register in usermode emulation.
pbrook [Mon, 20 Apr 2009 23:55:57 +0000 (23:55 +0000)]
Enable access to SYNCI_Step register in usermode emulation.

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

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@7191 c046a42c-6fe2-441c-8c8c-71466251a162

15 years agoBuild system: Fix dependency of qemu.1
blueswir1 [Sun, 19 Apr 2009 10:25:05 +0000 (10:25 +0000)]
Build system: Fix dependency of qemu.1

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

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@7190 c046a42c-6fe2-441c-8c8c-71466251a162

15 years agokqemu: merge CONFIG_KQEMU and USE_KQEMU
blueswir1 [Sun, 19 Apr 2009 10:18:01 +0000 (10:18 +0000)]
kqemu: merge CONFIG_KQEMU and USE_KQEMU

Basically a recursive ":%s/USE_KQEMU/CONFIG_KQEMU/g".

Signed-off-by: Paul Bolle <pebolle@tiscali.nl>

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@7189 c046a42c-6fe2-441c-8c8c-71466251a162

15 years agoAdds SM501 usb host emulation feature.
aurel32 [Sun, 19 Apr 2009 09:15:50 +0000 (09:15 +0000)]
Adds SM501 usb host emulation feature.
It makes usb keyboard available for sh4/r2d system emulation.

The changes for "hw/usb-ohci.c" are as follows.
 - 'localmem_base' is introduced as OHCIState struct member.
   SM501 has a local memory, and it is used to pass and receive data with
   OHCI driver.  OHCI driver accesses it with SH4 physical memory address,
   and SM501 accesses it with SM501 local address.  'localmem_base' holds
   where the SM501 local memory is mapped into SH4 physical address space.
 - Memory access functions modified to adjust address with 'localmem_base'.
   The functions are, ohci_read_*(), ohci_put_*(), and ohci_copy_*().
 - ohci_read_hcca() and ohci_put_hcca() are introduced for more consistent
   implementation.

For other source files, it does,
 - introduces usb_ohci_init_sm501().
 - adds irq argument for SM501 initialization, to emulate USB interrupts.

Signed-off-by: Shin-ichiro KAWASAKI <kawasaki@juno.dti.ne.jp>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@7188 c046a42c-6fe2-441c-8c8c-71466251a162

15 years agolinux-user: Linux kernel's fchmodat and faccessat have three args (no 4th arg)
aurel32 [Sun, 19 Apr 2009 08:52:17 +0000 (08:52 +0000)]
linux-user: Linux kernel's fchmodat and faccessat have three args (no 4th arg)

In Linux kernel, fchmodat() and faccessat() take tree args.
4th value <int flags> is only processed by libc.

Signed-off-by: Takashi YOSHII <takasi-y@ops.dti.ne.jp>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@7187 c046a42c-6fe2-441c-8c8c-71466251a162

15 years agoFix indices in Menelaus save/load.
balrog [Sun, 19 Apr 2009 00:26:31 +0000 (00:26 +0000)]
Fix indices in Menelaus save/load.

Version increase won't be helpful here.  Spotted by Sergei Steshenko / Blau
Wirbel.

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@7186 c046a42c-6fe2-441c-8c8c-71466251a162

15 years agokqemu: only compile kqemu.o if actually needed
blueswir1 [Sat, 18 Apr 2009 19:25:43 +0000 (19:25 +0000)]
kqemu: only compile kqemu.o if actually needed

kqemu.o is compiled even if kqemu support is disabled. This is useless
(kqemu.o should provide nothing that is actually used in that case) and
slightly confusing. So introduce CONFIG_KQEMU for optionally compiling
kqemu.o.

Signed-off-by: Paul Bolle <pebolle@tiscali.nl>

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@7185 c046a42c-6fe2-441c-8c8c-71466251a162

15 years agolinux-user: fix IPCOP_sem* and implement sem*
aurel32 [Sat, 18 Apr 2009 16:16:12 +0000 (16:16 +0000)]
linux-user: fix IPCOP_sem* and implement sem*

Fix and cleanup IPCOP_sem* ipc calls handling and
implement sem* syscalls.

Riku:

1) Uglify whitespace so that diff gets smaller and easier
to review

2) use __get_user in target_to_host_sembuf

Signed-off-by: Kirill A. Shutemov <kirill@shutemov.name>
Signed-off-by: Riku Voipio <riku.voipio@iki.fi>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@7184 c046a42c-6fe2-441c-8c8c-71466251a162

15 years agoqemu-io: Verify read data by patterns (Kevin Wolf)
aliguori [Sat, 18 Apr 2009 15:36:23 +0000 (15:36 +0000)]
qemu-io: Verify read data by patterns (Kevin Wolf)

This patch adds a -P option to read and readv which allows to compare the read
data to a given pattern. This can be used to verify data written by write -P.

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

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@7182 c046a42c-6fe2-441c-8c8c-71466251a162

15 years agoqemu-io: Fix handling of bdrv_is_allocated() return value (Kevin Wolf)
aliguori [Sat, 18 Apr 2009 15:36:19 +0000 (15:36 +0000)]
qemu-io: Fix handling of bdrv_is_allocated() return value (Kevin Wolf)

bdrv_is_allocated() returns a boolean which indicates if the offset is
allocated, not 0 on success and everything else is an error.

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

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@7181 c046a42c-6fe2-441c-8c8c-71466251a162

15 years agomonitor: Update command help (Jan Kiszka)
aliguori [Sat, 18 Apr 2009 15:36:15 +0000 (15:36 +0000)]
monitor: Update command help (Jan Kiszka)

Align some monitor help texts to the related command parameter
definitions. host_net_add is skipped intentionally, will be slightly
reworked in a separate patch later.

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

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@7180 c046a42c-6fe2-441c-8c8c-71466251a162

15 years agox86: Enhanced dump of segment registers (Jan Kiszka)
aliguori [Sat, 18 Apr 2009 15:36:11 +0000 (15:36 +0000)]
x86: Enhanced dump of segment registers (Jan Kiszka)

Parse the descriptor flags that segment registers refer to and show the
result in a more human-friendly format. The output of info registers eg.
then looks like this:

[...]
ES =007b 00000000 ffffffff 00cff300 DPL=3 DS   [-WA]
CS =0060 00000000 ffffffff 00c09b00 DPL=0 CS32 [-RA]
SS =0068 00000000 ffffffff 00c09300 DPL=0 DS   [-WA]
DS =007b 00000000 ffffffff 00cff300 DPL=3 DS   [-WA]
FS =0000 00000000 00000000 00000000
GS =0033 b7dd66c0 ffffffff b7dff3dd DPL=3 DS   [-WA]
LDT=0000 00000000 00000000 00008200 DPL=0 LDT
TR =0080 c06da700 0000206b 00008900 DPL=0 TSS32-avl
[...]

Changes in this version:
 - refactoring so that only a single helper is used for dumping the
   segment descriptor cache
 - tiny typo fixed that broke 64-bit segment type names

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

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@7179 c046a42c-6fe2-441c-8c8c-71466251a162

15 years agoa couple of qemu-io fixes (Christoph Hellwig)
aliguori [Sat, 18 Apr 2009 15:36:06 +0000 (15:36 +0000)]
a couple of qemu-io fixes (Christoph Hellwig)

Fix two stupid bugs that I forgot to push out:

 - qiov->size already is in bytes, no need to shift it
 - actually use the supplied patter in the writev command

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@7178 c046a42c-6fe2-441c-8c8c-71466251a162

15 years agobuildsytem: consistently use install (Christoph Egger)
aliguori [Sat, 18 Apr 2009 15:36:02 +0000 (15:36 +0000)]
buildsytem: consistently use install (Christoph Egger)

attached patch makes qemu use install consistently.

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

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@7177 c046a42c-6fe2-441c-8c8c-71466251a162

15 years agoUse ANSI prototypes to please sparse
blueswir1 [Sat, 18 Apr 2009 07:32:41 +0000 (07:32 +0000)]
Use ANSI prototypes to please sparse

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@7176 c046a42c-6fe2-441c-8c8c-71466251a162

15 years agoAdd 'static' to avoid a sparse warning
blueswir1 [Sat, 18 Apr 2009 07:29:59 +0000 (07:29 +0000)]
Add 'static' to avoid a sparse warning

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@7175 c046a42c-6fe2-441c-8c8c-71466251a162

15 years agoMove bootp_filename to avoid a sparse warning
blueswir1 [Sat, 18 Apr 2009 07:29:30 +0000 (07:29 +0000)]
Move bootp_filename to avoid a sparse warning

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@7174 c046a42c-6fe2-441c-8c8c-71466251a162

15 years agoFix non-ACPI Timer Interrupt Routing (Beth Kon)
aliguori [Fri, 17 Apr 2009 21:01:11 +0000 (21:01 +0000)]
Fix non-ACPI Timer Interrupt Routing (Beth Kon)

Replicate ACPI irq0->inti2 override in mp table for non-acpi case.

v1 -> v2 adds comment suggested by Ryan.

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

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@7169 c046a42c-6fe2-441c-8c8c-71466251a162

15 years agohpet: Fix emulation of HPET_TN_SETVAL (Jan Kiszka)
aliguori [Fri, 17 Apr 2009 20:50:58 +0000 (20:50 +0000)]
hpet: Fix emulation of HPET_TN_SETVAL (Jan Kiszka)

While Intel's spec is not that clear here, latest changes to Linux' HPET
code (commit c23e253e67c9d8a91a0ffa33c1f571a17f0a2403, "x86: hpet: stop
HPET_COUNTER when programming periodic mode") strongly suggest that
HPET_TN_SETVAL rather means: Set _both_ the comparator value and
register.

With this patch applied, I'm again able to boot 2.6.30-rc kernels as
they no longer panic like this (which was due to the comparator
register remaining 0):

ENABLING IO-APIC IRQs
..TIMER: vector=0x30 apic1=0 pin1=2 apic2=-1 pin2=-1
..MP-BIOS bug: 8254 timer not connected to IO-APIC
...trying to set up timer (IRQ0) through the 8259A ...
..... (found apic 0 pin 2) ...
....... failed.
...trying to set up timer as Virtual Wire IRQ...
..... failed.
...trying to set up timer as ExtINT IRQ...
..... failed :(.
Kernel panic - not syncing: IO-APIC + timer doesn't work! [...]

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

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@7168 c046a42c-6fe2-441c-8c8c-71466251a162

15 years agokvm: Fix cpuid initialization (Jan Kiszka)
aliguori [Fri, 17 Apr 2009 20:50:54 +0000 (20:50 +0000)]
kvm: Fix cpuid initialization (Jan Kiszka)

Fix (more or less) spurious guest boot failures due to corrupted cpuid
states. The reason was insufficient initialization of cpuid entries
before passing them to the kernel.

At this chance also fix improper entry pointer progression and simplify
the code a bit.

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

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@7167 c046a42c-6fe2-441c-8c8c-71466251a162

15 years agoqcow2 corruption: Fix alloc_cluster_link_l2 (Kevin Wolf)
aliguori [Fri, 17 Apr 2009 20:44:06 +0000 (20:44 +0000)]
qcow2 corruption: Fix alloc_cluster_link_l2 (Kevin Wolf)

This patch fixes a qcow2 corruption bug introduced in SVN Rev 5861. L2 tables
are big endian, so entries must be converted before being passed to functions.

This bug is easy to trigger. The following script will create and destroy a
qcow2 image (the header is gone after three loop iterations):

    #!/bin/bash
    qemu-img create -f qcow2 test.qcow 1M
    for i in $(seq 1 10); do
    qemu-system-x86_64 -hda test.qcow -monitor stdio > /dev/null 2>&1 <<EOF
    savevm test-$i
    quit
    EOF
    done

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

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@7165 c046a42c-6fe2-441c-8c8c-71466251a162

15 years agoMake the sed script also work with OpenBSD and OpenSolaris seds
blueswir1 [Fri, 17 Apr 2009 20:01:12 +0000 (20:01 +0000)]
Make the sed script also work with OpenBSD and OpenSolaris seds

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@7164 c046a42c-6fe2-441c-8c8c-71466251a162

15 years agoqemu: Add support for SMBIOS command line otions (Alex Williamson)
aliguori [Fri, 17 Apr 2009 18:59:56 +0000 (18:59 +0000)]
qemu: Add support for SMBIOS command line otions (Alex Williamson)

Create a new -smbios option (x86-only) to allow binary SMBIOS entries
to be passed through to the BIOS or modify the default values of
individual fields of type 0 and 1 entries on the command line.

Binary SMBIOS entries can be generated as follows:

dmidecode -t 1 -u | grep $'^\t\t[^"]' | xargs -n1 | \
        perl -lne 'printf "%c", hex($_)' > smbios_type_1.bin

These can then be passed to the BIOS using this switch:

 -smbios file=smbios_type_1.bin

Command line generation supports the following syntax:

 -smbios type=0[,vendor=str][,version=str][,date=str][,release=%d.%d]
 -smbios type=1[,manufacturer=str][,product=str][,version=str][,serial=str]
              [,uuid=$(uuidgen)][,sku=str][,family=str]

For instance, to add a serial number to the type 1 table:

 -smbios type=1,serial=0123456789

Interface is extensible to support more fields/tables as needed.

aliguori: remove texi formatting from help output

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

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@7163 c046a42c-6fe2-441c-8c8c-71466251a162

15 years agoqemu: Add prototype and make qemu_uuid_parse() non-static (Alex Williamson)
aliguori [Fri, 17 Apr 2009 18:58:14 +0000 (18:58 +0000)]
qemu: Add prototype and make qemu_uuid_parse() non-static (Alex Williamson)

SMBIOS parameters can also provide a UUID outside of vl.c.

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

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@7162 c046a42c-6fe2-441c-8c8c-71466251a162

15 years agoFree VLANClientState using qemu_free() (Mark McLoughlin)
aliguori [Fri, 17 Apr 2009 17:11:12 +0000 (17:11 +0000)]
Free VLANClientState using qemu_free() (Mark McLoughlin)

It's allocated using qemu_mallocz(), so ...

The name and model strings are strdup() allocated, so free()
is still appropriate for them.

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

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@7151 c046a42c-6fe2-441c-8c8c-71466251a162

15 years agoIntroduce VLANClientState::cleanup() (Mark McLoughlin)
aliguori [Fri, 17 Apr 2009 17:11:08 +0000 (17:11 +0000)]
Introduce VLANClientState::cleanup() (Mark McLoughlin)

We're currently leaking memory and file descriptors on device
hot-unplug.

Signed-off-by: Mark McLoughlin <markmc@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@7150 c046a42c-6fe2-441c-8c8c-71466251a162

15 years agoUse NICInfo::model for eepro100 savevm ID string (Mark McLoughlin)
aliguori [Fri, 17 Apr 2009 17:11:03 +0000 (17:11 +0000)]
Use NICInfo::model for eepro100 savevm ID string (Mark McLoughlin)

NICInfo::model will always be identical to the device name strings
we're currently passing to nic_init(). Just re-use NICInfo::model.

This makes it clear why we use vc->model for unregister_savevm()
in a subsequent patch.

Signed-off-by: Mark McLoughlin <markmc@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@7149 c046a42c-6fe2-441c-8c8c-71466251a162

15 years agoAdd unregister_savevm() (Mark McLoughlin)
aliguori [Fri, 17 Apr 2009 17:10:59 +0000 (17:10 +0000)]
Add unregister_savevm() (Mark McLoughlin)

Currently there's no way to unregister a savevm callback, so
e.g. if a NIC is hot-unplugged and a savevm is issued, we'll
segfault.

Signed-off-by: Mark McLoughlin <markmc@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@7148 c046a42c-6fe2-441c-8c8c-71466251a162

15 years agoRemove NICInfo from e1000 and mipsnet state (Mark McLoughlin)
aliguori [Fri, 17 Apr 2009 17:10:56 +0000 (17:10 +0000)]
Remove NICInfo from e1000 and mipsnet state (Mark McLoughlin)

NICInfo isn't used after initialization, so remove it from the driver
state structures.

Signed-off-by: Mark McLoughlin <markmc@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@7147 c046a42c-6fe2-441c-8c8c-71466251a162

15 years agoRemove some useless malloc() checking (Mark McLoughlin)
aliguori [Fri, 17 Apr 2009 17:10:51 +0000 (17:10 +0000)]
Remove some useless malloc() checking (Mark McLoughlin)

Now that we abort() on malloc, neither qemu_find_vlan() nor
net_tap_fd_init() can fail.

Signed-off-by: Mark McLoughlin <markmc@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@7146 c046a42c-6fe2-441c-8c8c-71466251a162

15 years agoDon't fail PCI hotplug if no NIC model is supplied (Mark McLoughlin)
aliguori [Fri, 17 Apr 2009 17:10:47 +0000 (17:10 +0000)]
Don't fail PCI hotplug if no NIC model is supplied (Mark McLoughlin)

It's perfectly fine to not supply a NIC model when adding
a new NIC - we supply the default model to pci_nic_init()
and it uses that if one wasn't explicitly supplied.

Signed-off-by: Mark McLoughlin <markmc@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@7145 c046a42c-6fe2-441c-8c8c-71466251a162

15 years agoFix error handling in net_client_init() (Mark McLoughlin)
aliguori [Fri, 17 Apr 2009 17:10:43 +0000 (17:10 +0000)]
Fix error handling in net_client_init() (Mark McLoughlin)

We weren't freeing the name string everywhere.

Signed-off-by: Mark McLoughlin <markmc@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@7144 c046a42c-6fe2-441c-8c8c-71466251a162

15 years agostruct iovec is now universally available (Mark McLoughlin)
aliguori [Fri, 17 Apr 2009 17:10:39 +0000 (17:10 +0000)]
struct iovec is now universally available (Mark McLoughlin)

struct iovec is now defined in qemu-common.h if needed, so we don't need
the tap code to handle !defined(HAVE_IOVEC).

Signed-off-by: Mark McLoughlin <markmc@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@7143 c046a42c-6fe2-441c-8c8c-71466251a162

15 years agoRemove stray GSO code from virtio_net (Mark McLoughlin)
aliguori [Fri, 17 Apr 2009 17:10:34 +0000 (17:10 +0000)]
Remove stray GSO code from virtio_net (Mark McLoughlin)

Obviously merged from kvm-userspace accidentally.

Signed-off-by: Mark McLoughlin <markmc@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@7142 c046a42c-6fe2-441c-8c8c-71466251a162

15 years agovga: Cleanup dirty logging (Jan Kiszka)
aliguori [Fri, 17 Apr 2009 14:26:41 +0000 (14:26 +0000)]
vga: Cleanup dirty logging (Jan Kiszka)

In theory, there are no more quirks in the KVM slot management that
requires dirty log start/stop all over the place. We just have to start
the logging each time the mapping may have changed. This patch drops
vga_dirty_log_stop for both standard and cirrus VGA. It also reverts
#6851 as it was obviously a tribute to the old slot system.

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

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@7141 c046a42c-6fe2-441c-8c8c-71466251a162

15 years agovga: Fix inconsistent tracking of map_addr (Jan Kiszka)
aliguori [Fri, 17 Apr 2009 14:26:37 +0000 (14:26 +0000)]
vga: Fix inconsistent tracking of map_addr (Jan Kiszka)

Only track video RAM mapping in map_addr and use the correct RAM size.
Furthermore, make sure the reset the address in case unmapping took
place via PCI reconfiguration.

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

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@7140 c046a42c-6fe2-441c-8c8c-71466251a162

15 years agokvm: improve handling of overlapping slots (Jan Kiszka)
aliguori [Fri, 17 Apr 2009 14:26:33 +0000 (14:26 +0000)]
kvm: improve handling of overlapping slots (Jan Kiszka)

This reworks the slot management to handle more patterns of
cpu_register_physical_memory*, finally allowing to reset KVM guests (so
far address remapping on reset broke the slot management).

We could actually handle all possible ones without failing, but a KVM
kernel bug in older versions would force us to track all previous
fragmentations and maintain them (as that bug prevents registering
larger slots that overlap also deleted ones). To remain backward
compatible but avoid overly complicated workarounds, we apply a simpler
workaround that covers all currently used patterns.

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

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@7139 c046a42c-6fe2-441c-8c8c-71466251a162

15 years agokvm: Add sanity checks to slot management (Jan Kiszka)
aliguori [Fri, 17 Apr 2009 14:26:29 +0000 (14:26 +0000)]
kvm: Add sanity checks to slot management (Jan Kiszka)

Fail loudly if we run out of memory slot.

Make sure that dirty log start/stop works with consistent memory regions
by reporting invalid parameters. This reveals several inconsistencies in
the vga code, patch to fix them follows later in this series.

And, for simplicity reasons, also catch and report unaligned memory
regions passed to kvm_set_phys_mem (KVM works on page basis).

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

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@7138 c046a42c-6fe2-441c-8c8c-71466251a162

15 years agokvm: Cleanup unmap condition in kvm_set_phys_mem (Jan Kiszka)
aliguori [Fri, 17 Apr 2009 14:26:25 +0000 (14:26 +0000)]
kvm: Cleanup unmap condition in kvm_set_phys_mem (Jan Kiszka)

Testing for TLB_MMIO on unmap makes no sense as A) that flag belongs to
CPUTLBEntry and not to io_memory slots or physical addresses and B) we
already use a different condition before mapping. So make this test
consistent.

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

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@7137 c046a42c-6fe2-441c-8c8c-71466251a162

15 years agokvm: Apply SMM-already-initialized workaround on reset (Jan Kiszka)
aliguori [Fri, 17 Apr 2009 14:26:21 +0000 (14:26 +0000)]
kvm: Apply SMM-already-initialized workaround on reset (Jan Kiszka)

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

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@7136 c046a42c-6fe2-441c-8c8c-71466251a162

15 years agokvm: Sync CPU state on reset (Jan Kiszka)
aliguori [Fri, 17 Apr 2009 14:26:17 +0000 (14:26 +0000)]
kvm: Sync CPU state on reset (Jan Kiszka)

Make sure KVM gets informed about the reset CPU state.

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

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@7135 c046a42c-6fe2-441c-8c8c-71466251a162

15 years agolinux-user: fix inotify syscalls
aurel32 [Fri, 17 Apr 2009 13:50:32 +0000 (13:50 +0000)]
linux-user: fix inotify syscalls

Configure test was broken, so the breakage of the #ifdef'd
code was not noticed.

Signed-off-by: Riku Voipio <riku.voipio@iki.fi>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@7134 c046a42c-6fe2-441c-8c8c-71466251a162

15 years agoRevert "target-mips: fix call to check_*() functions"
aurel32 [Fri, 17 Apr 2009 13:17:26 +0000 (13:17 +0000)]
Revert "target-mips: fix call to check_*() functions"

This reverts commit r7127, r7132 is a better fix for that.

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@7133 c046a42c-6fe2-441c-8c8c-71466251a162

15 years agotarget-mips: simplify exception generation
aurel32 [Fri, 17 Apr 2009 13:11:42 +0000 (13:11 +0000)]
target-mips: simplify exception generation

There is no need to exit the tb after a call to helper_raise_exception
as it already calls cpu_loop_exit().

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@7132 c046a42c-6fe2-441c-8c8c-71466251a162

15 years agoTranslate signal values in exit status.
pbrook [Thu, 16 Apr 2009 15:17:02 +0000 (15:17 +0000)]
Translate signal values in exit status.

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

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@7131 c046a42c-6fe2-441c-8c8c-71466251a162

15 years agolinux-user: fix getcwd syscall
aurel32 [Thu, 16 Apr 2009 14:17:14 +0000 (14:17 +0000)]
linux-user: fix getcwd syscall

The patch called "prefer glibc over direct syscalls" (commit 7118) has
replaced the getcwd syscall with a call to the glibc. With this change,
the syscall is returning -1 in error case and 0 otherwise.
This is problematic as the sys_getcwd syscall should return the number
of bytes written to the buffer including the '\0'.

Signed-off-by: Arnaud Patard <arnaud.patard@rtp-net.org>
Acked-By: Riku Voipio <riku.voipio@iki.fi>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@7130 c046a42c-6fe2-441c-8c8c-71466251a162

15 years agotarget-ppc: mark a few helpers TCG_CALL_CONST and/or TCG_CALL_PURE
aurel32 [Thu, 16 Apr 2009 12:57:58 +0000 (12:57 +0000)]
target-ppc: mark a few helpers TCG_CALL_CONST and/or TCG_CALL_PURE

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@7129 c046a42c-6fe2-441c-8c8c-71466251a162

15 years agotarget-mips: fix revision r7126
aurel32 [Thu, 16 Apr 2009 12:57:50 +0000 (12:57 +0000)]
target-mips: fix revision r7126

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@7128 c046a42c-6fe2-441c-8c8c-71466251a162

15 years agotarget-mips: fix call to check_*() functions
aurel32 [Thu, 16 Apr 2009 11:51:19 +0000 (11:51 +0000)]
target-mips: fix call to check_*() functions

check_*() functions may in fine call generate_exception(), which ends
by a call to tcg_gen_exit_tb(). As a consequence, we have to make sure
that no TCG temp variables are crossing a check_*() function.

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@7127 c046a42c-6fe2-441c-8c8c-71466251a162

15 years agotarget-mips: optimize gen_flt3_ldst()
aurel32 [Thu, 16 Apr 2009 11:51:11 +0000 (11:51 +0000)]
target-mips: optimize gen_flt3_ldst()

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@7126 c046a42c-6fe2-441c-8c8c-71466251a162

15 years agotarget-mips: optimize gen_flt_ldst()
aurel32 [Thu, 16 Apr 2009 11:51:03 +0000 (11:51 +0000)]
target-mips: optimize gen_flt_ldst()

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@7125 c046a42c-6fe2-441c-8c8c-71466251a162

15 years agoStop translation after a syscall instruciton.
pbrook [Thu, 16 Apr 2009 10:56:43 +0000 (10:56 +0000)]
Stop translation after a syscall instruciton.

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

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@7124 c046a42c-6fe2-441c-8c8c-71466251a162

15 years agoconfigure: display debug tcg status in summary
aurel32 [Thu, 16 Apr 2009 09:58:41 +0000 (09:58 +0000)]
configure: display debug tcg status in summary

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@7123 c046a42c-6fe2-441c-8c8c-71466251a162

15 years agotcg: make sure NDEBUG is defined before including <assert.h>
aurel32 [Thu, 16 Apr 2009 09:58:30 +0000 (09:58 +0000)]
tcg: make sure NDEBUG is defined before including <assert.h>

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@7122 c046a42c-6fe2-441c-8c8c-71466251a162

15 years agofix a typo introduced in r7118
aurel32 [Wed, 15 Apr 2009 19:48:17 +0000 (19:48 +0000)]
fix a typo introduced in r7118

Reported by Stefan Weil

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@7121 c046a42c-6fe2-441c-8c8c-71466251a162

15 years agolinux-user: fix warnings introduced by r7118
aurel32 [Wed, 15 Apr 2009 17:12:01 +0000 (17:12 +0000)]
linux-user: fix warnings introduced by r7118

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@7120 c046a42c-6fe2-441c-8c8c-71466251a162

15 years agolinux-user: proper exit code for uncaught signals
aurel32 [Wed, 15 Apr 2009 16:18:38 +0000 (16:18 +0000)]
linux-user: proper exit code for uncaught signals

The proper exit code for dieing from an uncaught signal is -<signal>.
The kernel doesn't allow exit() or _exit() to pass a negative value.
To get the proper exit code we need to actually die from an uncaught signal.

A default signal handler is installed, we send ourself a signal
and we wait for it to arrive.

Patch originates from Scratchbox

Signed-off-by: Riku Voipio <riku.voipio@iki.fi>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@7119 c046a42c-6fe2-441c-8c8c-71466251a162

15 years agolinux-user: prefer glibc over direct syscalls
aurel32 [Wed, 15 Apr 2009 16:12:13 +0000 (16:12 +0000)]
linux-user: prefer glibc over direct syscalls

The openat/*at syscalls are incredibly common with modern coreutils,
calling them directly via syscalls breaks for example fakeroot. Use
glibc stubs whenever directly available and provide old syscall
calling for people still using older libc.

Patch originally from Mika Westerberg, Adapted to
apply to current trunk and cleaned up by Riku Voipio.

Signed-off-by: Riku Voipio <riku.voipio@iki.fi>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@7118 c046a42c-6fe2-441c-8c8c-71466251a162

15 years agolinux-user: removed unnecessary MAX_SOCK_ADDR checks for socket syscalls
aurel32 [Wed, 15 Apr 2009 16:12:06 +0000 (16:12 +0000)]
linux-user: removed unnecessary MAX_SOCK_ADDR checks for socket syscalls

- This check is not needed because kernel will check whether given
  buffer is too small and there is no upper limit for size of the buffer.

From: Mika Westerberg <mika.westerberg@iki.fi>

Signed-off-by: Riku Voipio <riku.voipio@iki.fi>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@7117 c046a42c-6fe2-441c-8c8c-71466251a162

15 years agolinux-user: unix sockets - fix running dbus
aurel32 [Wed, 15 Apr 2009 16:11:59 +0000 (16:11 +0000)]
linux-user: unix sockets - fix running dbus

dbus sends too short (according to man 7 unix) addrlen for it's
unix socket. I've been told that happens with other applications
as well. Linux kernel doesn't appear to mind, so I guess
we whould be tolerant as well. Expand sockaddr with +1 to fit
the \0 of the pathname passed.

(scratchbox1 qemu had a very different workaround for the same issue).

Signed-off-by: Riku Voipio <riku.voipio@iki.fi>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@7116 c046a42c-6fe2-441c-8c8c-71466251a162

15 years agolinux-user: add support for passing contents of argv0
aurel32 [Wed, 15 Apr 2009 16:11:52 +0000 (16:11 +0000)]
linux-user: add support for passing contents of argv0

Added switch -0 (zero) which can be used to pass argv[0] to
target process. The main use is for a binfmt_misc wrapper when
the "P - preserve-argv[0]" setting is used.

From: Mika Westerberg

Signed-off-by: Riku Voipio <riku.voipio@iki.fi>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@7115 c046a42c-6fe2-441c-8c8c-71466251a162

15 years agolinux-user: Added posix message queue syscalls except mq_notify
aurel32 [Wed, 15 Apr 2009 16:11:43 +0000 (16:11 +0000)]
linux-user: Added posix message queue syscalls except mq_notify

Signed-off-by: Lionel Landwerlin <lionel.landwerlin@openwide.fr>
Signed-off-by: Kirill A. Shutemov <kirill@shutemov.name>
Signed-off-by: Riku Voipio <riku.voipio@iki.fi>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@7114 c046a42c-6fe2-441c-8c8c-71466251a162

15 years agoSimplify reconfiguration
malc [Wed, 15 Apr 2009 16:04:03 +0000 (16:04 +0000)]
Simplify reconfiguration

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@7113 c046a42c-6fe2-441c-8c8c-71466251a162

15 years agoImplement sonic netcard (MIPS Jazz)
aurel32 [Wed, 15 Apr 2009 14:57:54 +0000 (14:57 +0000)]
Implement sonic netcard (MIPS Jazz)

Attached patch adds emulation of a SONIC netcard. This card has been used
in MIPS Jazz machines and in some Apple Mac 68K.

Emulation has been done using dp83932 specification, but can be enhanced
(if needed) to also emulate dp83916, dp83934 or dp83936 chipsets.

This has been tested in Linux 2.1, NetBSD 1.6.2 and MS Windows NT/MIPS

Signed-off-by: Hervé Poussineau <hpoussin@reactos.org>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@7112 c046a42c-6fe2-441c-8c8c-71466251a162

15 years agotarget-alpha: fix emulation of ecb
aurel32 [Wed, 15 Apr 2009 14:43:11 +0000 (14:43 +0000)]
target-alpha: fix emulation of ecb

As ECB is a hint, it can be safely emulated as a nop.

This change is necessary to boot Tru64.

Signed-off-by: Tristan Gingold <gingold@adacore.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@7111 c046a42c-6fe2-441c-8c8c-71466251a162

15 years agoCall configure automatically when needed
aurel32 [Wed, 15 Apr 2009 14:42:57 +0000 (14:42 +0000)]
Call configure automatically when needed

Automatically rerun configure when it is needed.

Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@7110 c046a42c-6fe2-441c-8c8c-71466251a162

15 years agoblock-vpc: Don't silently create smaller image than requested
aurel32 [Wed, 15 Apr 2009 14:42:46 +0000 (14:42 +0000)]
block-vpc: Don't silently create smaller image than requested

The algorithm from the VHD specification for CHS calculation silently limits
images to 127 GB which may confuse a user who requested a larger image. Better
output an error message and abort.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@7109 c046a42c-6fe2-441c-8c8c-71466251a162

15 years agotarget-alpha: lower parent irq when irq is lowered.
aurel32 [Wed, 15 Apr 2009 14:42:30 +0000 (14:42 +0000)]
target-alpha: lower parent irq when irq is lowered.

Signed-off-by: Tristan Gingold <gingold@adacore.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@7108 c046a42c-6fe2-441c-8c8c-71466251a162

15 years agotarget-mips: mark zero register as unused.
aurel32 [Wed, 15 Apr 2009 14:42:00 +0000 (14:42 +0000)]
target-mips: mark zero register as unused.

Suggested by Stuart Brady.

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@7107 c046a42c-6fe2-441c-8c8c-71466251a162

15 years agotarget-mips: variable names consistency
aurel32 [Wed, 15 Apr 2009 14:41:44 +0000 (14:41 +0000)]
target-mips: variable names consistency

Use a consistent naming of arguments and TCG variables across the whole
file, the same as in tcg/tcg-op.h:
- arg1, arg2, ... for arguments
- t0, t1, t2, ... for variables

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@7106 c046a42c-6fe2-441c-8c8c-71466251a162

15 years agoAdd a --enable-debug-tcg option to configure
aurel32 [Mon, 13 Apr 2009 18:45:38 +0000 (18:45 +0000)]
Add a --enable-debug-tcg option to configure

This patch allows DEBUG_TCGV to be defined (and also prevents NDEBUG
from being defined) when passing an option to the configure script.
This should help to prevent any accidental changes that enable
DEBUG_TCGV in tcg/tcg.h from being committed in future, and may
help to encourage testing with DEBUG_TCGV enabled.

Signed-off-by: Stuart Brady <stuart.brady@gmail.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@7105 c046a42c-6fe2-441c-8c8c-71466251a162

15 years agoProbe via #define check for OpenBSD and *Solaris
blueswir1 [Mon, 13 Apr 2009 17:19:26 +0000 (17:19 +0000)]
Probe via #define check for OpenBSD and *Solaris

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@7104 c046a42c-6fe2-441c-8c8c-71466251a162

15 years agoFix OpenSolaris gcc4 warnings: iovec type mismatches, missing 'static'
blueswir1 [Mon, 13 Apr 2009 16:31:01 +0000 (16:31 +0000)]
Fix OpenSolaris gcc4 warnings: iovec type mismatches, missing 'static'

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@7103 c046a42c-6fe2-441c-8c8c-71466251a162

15 years agoFix OpenSolaris softfloat warnings
blueswir1 [Mon, 13 Apr 2009 16:27:08 +0000 (16:27 +0000)]
Fix OpenSolaris softfloat warnings

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@7102 c046a42c-6fe2-441c-8c8c-71466251a162

15 years agoSkip KVM probe for OpenSolaris
blueswir1 [Mon, 13 Apr 2009 16:23:22 +0000 (16:23 +0000)]
Skip KVM probe for OpenSolaris

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@7101 c046a42c-6fe2-441c-8c8c-71466251a162

15 years agoProbe for OpenSolaris curses missing resize_term
blueswir1 [Mon, 13 Apr 2009 16:18:34 +0000 (16:18 +0000)]
Probe for OpenSolaris curses missing resize_term

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@7100 c046a42c-6fe2-441c-8c8c-71466251a162

15 years agoFix ppc-softmmu warnings on OpenBSD host
blueswir1 [Mon, 13 Apr 2009 16:06:19 +0000 (16:06 +0000)]
Fix ppc-softmmu warnings on OpenBSD host

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@7099 c046a42c-6fe2-441c-8c8c-71466251a162

15 years agoRecognise evdev(xx)_aliases(yy) and xfree86(xx)_aliases(yy) as keymap names.
balrog [Mon, 13 Apr 2009 11:33:46 +0000 (11:33 +0000)]
Recognise evdev(xx)_aliases(yy) and xfree86(xx)_aliases(yy) as keymap names.

Newer Xorg use these with non-default kemaps (such as the ThinkPad keymap).

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@7097 c046a42c-6fe2-441c-8c8c-71466251a162

15 years agotarget-mips: fix commits 7040 and 7042
aurel32 [Mon, 13 Apr 2009 08:53:12 +0000 (08:53 +0000)]
target-mips: fix commits 7040 and 7042

CPU state should also be saved for helpers that in fine call
cpu_unlink_tb(). Reported by Stefan Weil.

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@7096 c046a42c-6fe2-441c-8c8c-71466251a162

15 years agotarget-mips: fix commit 7046
aurel32 [Sun, 12 Apr 2009 08:32:45 +0000 (08:32 +0000)]
target-mips: fix commit 7046

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@7095 c046a42c-6fe2-441c-8c8c-71466251a162

15 years agotarget-mips: don't map zero register as a TCG global
aurel32 [Sat, 11 Apr 2009 18:43:20 +0000 (18:43 +0000)]
target-mips: don't map zero register as a TCG global

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@7094 c046a42c-6fe2-441c-8c8c-71466251a162

15 years agotarget-mips: optimize gen_ldst()
aurel32 [Sat, 11 Apr 2009 18:42:55 +0000 (18:42 +0000)]
target-mips: optimize gen_ldst()

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@7093 c046a42c-6fe2-441c-8c8c-71466251a162

15 years agotarget-mips: optimize gen_arith_imm()
aurel32 [Sat, 11 Apr 2009 18:42:17 +0000 (18:42 +0000)]
target-mips: optimize gen_arith_imm()

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@7092 c046a42c-6fe2-441c-8c8c-71466251a162

15 years agoAdd named initializers.
pbrook [Sat, 11 Apr 2009 17:41:32 +0000 (17:41 +0000)]
Add named initializers.

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

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@7091 c046a42c-6fe2-441c-8c8c-71466251a162