sdk/emulator/qemu.git
13 years agoonenand: Add missing brace.
Andrzej Zaborowski [Sat, 30 Jul 2011 04:53:39 +0000 (06:53 +0200)]
onenand: Add missing brace.

Signed-off-by: Andrzej Zaborowski <andrew.zaborowski@intel.com>
13 years agohw/onenand: program actions can only clear bits
Juha Riihimäki [Fri, 29 Jul 2011 15:35:28 +0000 (16:35 +0100)]
hw/onenand: program actions can only clear bits

The program actions onenand_prog_main() and onenand_prog_spare()
can only set bits.

This implies a rewrite of onenand_erase() to not use the program
functions, since erase does need to set bits.

Signed-off-by: Juha Riihimäki <juha.riihimaki@nokia.com>
[Riku Voipio: Fixes and restructuring patchset]
Signed-off-by: Riku Voipio <riku.voipio@iki.fi>
[Peter Maydell: More fixes and cleanups for upstream submission]
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Andrzej Zaborowski <andrew.zaborowski@intel.com>
13 years agoonenand: Handle various ID fields separately
Juha Riihimäki [Fri, 29 Jul 2011 15:35:26 +0000 (16:35 +0100)]
onenand: Handle various ID fields separately

Handle the manufacturer, device and version IDs separately rather than
smooshing them all together into a single uint32_t. Note that the ID
registers are actually 16 bit, even though typically the top bits are 0
and the Read Identification Data command only returns the bottom 8 bits.

Signed-off-by: Juha Riihimäki <juha.riihimaki@nokia.com>
[Riku Voipio: Fixes and restructuring patchset]
Signed-off-by: Riku Voipio <riku.voipio@iki.fi>
[Peter Maydell: More fixes and cleanups for upstream submission]
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Andrzej Zaborowski <andrew.zaborowski@intel.com>
13 years agoonenand: Pass BlockDriverState to init function
Peter Maydell [Fri, 29 Jul 2011 15:35:25 +0000 (16:35 +0100)]
onenand: Pass BlockDriverState to init function

Pass the BlockDriverState to the onenand init function so it doesn't
need to look up the drive itself.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Andrzej Zaborowski <andrew.zaborowski@intel.com>
13 years agohw/nand: qdevify
Juha Riihimäki [Fri, 29 Jul 2011 15:35:24 +0000 (16:35 +0100)]
hw/nand: qdevify

Qdevify the NAND device.

Signed-off-by: Juha Riihimäki <juha.riihimaki@nokia.com>
[Riku Voipio: Fixes and restructuring patchset]
Signed-off-by: Riku Voipio <riku.voipio@iki.fi>
[Peter Maydell: More fixes and cleanups for upstream submission]
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Andrzej Zaborowski <andrew.zaborowski@intel.com>
13 years agohw/nand: Writing to NAND can only clear bits
Peter Maydell [Fri, 29 Jul 2011 15:35:23 +0000 (16:35 +0100)]
hw/nand: Writing to NAND can only clear bits

Writing to a NAND device cannot set bits, it can only clear them;
implement this rather than simply copying the data.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Andrzej Zaborowski <andrew.zaborowski@intel.com>
13 years agohw/nand: Support multiple reads following READ STATUS
Juha Riihimäki [Fri, 29 Jul 2011 15:35:22 +0000 (16:35 +0100)]
hw/nand: Support multiple reads following READ STATUS

After receiving READ STATUS command all subsequent IO reads should return
the status register value until another command is issued.

Signed-off-by: Juha Riihimäki <juha.riihimaki@nokia.com>
[Riku Voipio: Fixes and restructuring patchset]
Signed-off-by: Riku Voipio <riku.voipio@iki.fi>
[Peter Maydell: More fixes and cleanups for upstream submission]
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Andrzej Zaborowski <andrew.zaborowski@intel.com>
13 years agohw/nand: Support devices wider than 8 bits
Juha Riihimäki [Fri, 29 Jul 2011 15:35:21 +0000 (16:35 +0100)]
hw/nand: Support devices wider than 8 bits

Support NAND devices which are wider than 8 bits.

Signed-off-by: Juha Riihimäki <juha.riihimaki@nokia.com>
[Riku Voipio: Fixes and restructuring patchset]
Signed-off-by: Riku Voipio <riku.voipio@iki.fi>
[Peter Maydell: More fixes and cleanups for upstream submission]
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Andrzej Zaborowski <andrew.zaborowski@intel.com>
13 years agonand: Bump vmstate version after changing structure.
Andrzej Zaborowski [Sat, 30 Jul 2011 04:01:37 +0000 (06:01 +0200)]
nand: Bump vmstate version after changing structure.

Signed-off-by: Andrzej Zaborowski <andrew.zaborowski@intel.com>
13 years agohw/nand: Support large NAND devices
Juha Riihimäki [Fri, 29 Jul 2011 15:35:20 +0000 (16:35 +0100)]
hw/nand: Support large NAND devices

Add support for NAND devices of over 1Gb.

Signed-off-by: Juha Riihimäki <juha.riihimaki@nokia.com>
[Riku Voipio: Fixes and restructuring patchset]
Signed-off-by: Riku Voipio <riku.voipio@iki.fi>
[Peter Maydell: More fixes and cleanups for upstream submission]
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Andrzej Zaborowski <andrew.zaborowski@intel.com>
13 years agohw/nand: Pass block device state to init function
Peter Maydell [Fri, 29 Jul 2011 15:35:19 +0000 (16:35 +0100)]
hw/nand: Pass block device state to init function

Pass the BlockDeviceState to the nand_init() function rather
than having it look it up via drive_get() itself.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Andrzej Zaborowski <andrew.zaborowski@intel.com>
13 years agolm832x: Take DeviceState pointer in lm832x_key_event()
Peter Maydell [Fri, 29 Jul 2011 15:35:18 +0000 (16:35 +0100)]
lm832x: Take DeviceState pointer in lm832x_key_event()

Since lm832x has been qdev'ified, its users will generally
have a DeviceState pointer rather than an i2c_slave pointer,
so adjust lm832x_key_event's prototype to suit.

This allows the n810 (its only user) to actually pass a correct
pointer to it rather than NULL. The effect is that we no longer
segfault when a key is pressed.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Andrzej Zaborowski <andrew.zaborowski@intel.com>
13 years agohw/omap_gpio.c: Convert to qdev
Juha Riihimäki [Fri, 29 Jul 2011 15:35:17 +0000 (16:35 +0100)]
hw/omap_gpio.c: Convert to qdev

Convert the OMAP GPIO module to qdev.

Signed-off-by: Juha Riihimäki <juha.riihimaki@nokia.com>
[Riku Voipio: Fixes and restructuring patchset]
Signed-off-by: Riku Voipio <riku.voipio@iki.fi>
[Peter Maydell: More fixes and cleanups for upstream submission]
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Andrzej Zaborowski <andrew.zaborowski@intel.com>
13 years agohw/omap_clk: Add the clock for the OMAP2430-specific fifth GPIO module
Peter Maydell [Fri, 29 Jul 2011 15:35:16 +0000 (16:35 +0100)]
hw/omap_clk: Add the clock for the OMAP2430-specific fifth GPIO module

The OMAP2430 has a fifth GPIO module which earlier OMAP2 models lack; add
the clock definition for it.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Andrzej Zaborowski <andrew.zaborowski@intel.com>
13 years agohw/omap_l4.c: Add helper function omap_l4_region_base
Juha Riihimäki [Fri, 29 Jul 2011 15:35:14 +0000 (16:35 +0100)]
hw/omap_l4.c: Add helper function omap_l4_region_base

Add helper function omap_l4_region_base() to return the base address
of a particular region of an L4 target agent.

Signed-off-by: Juha Riihimäki <juha.riihimaki@nokia.com>
[Riku Voipio: Fixes and restructuring patchset]
Signed-off-by: Riku Voipio <riku.voipio@iki.fi>
[Peter Maydell: More fixes and cleanups for upstream submission]
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Andrzej Zaborowski <andrew.zaborowski@intel.com>
13 years agoMerge remote-tracking branch 'stefanha/trivial-patches' into staging
Anthony Liguori [Fri, 29 Jul 2011 14:46:16 +0000 (09:46 -0500)]
Merge remote-tracking branch 'stefanha/trivial-patches' into staging

13 years agoMerge remote-tracking branch 'alon/pull-libcacard.afe' into staging
Anthony Liguori [Fri, 29 Jul 2011 14:43:36 +0000 (09:43 -0500)]
Merge remote-tracking branch 'alon/pull-libcacard.afe' into staging

13 years agoMerge remote-tracking branch 'agraf/xen-next' into staging
Anthony Liguori [Fri, 29 Jul 2011 14:42:12 +0000 (09:42 -0500)]
Merge remote-tracking branch 'agraf/xen-next' into staging

13 years agoMerge remote-tracking branch 'kraxel/migration.2' into staging
Anthony Liguori [Fri, 29 Jul 2011 14:39:37 +0000 (09:39 -0500)]
Merge remote-tracking branch 'kraxel/migration.2' into staging

13 years agomonitor: fix build breakage with --disable-vnc
TeLeMan [Mon, 25 Jul 2011 08:29:14 +0000 (16:29 +0800)]
monitor: fix build breakage with --disable-vnc

The breakage was introduced by the commit 13661089810d3e59931f3e80d7cb541b99af7071

Signed-off-by: TeLeMan <geleman@gmail.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
13 years agoAllow to leave type on default in -machine
Jan Kiszka [Mon, 25 Jul 2011 16:11:20 +0000 (18:11 +0200)]
Allow to leave type on default in -machine

This allows to specify -machine options without setting an explicit
machine type. We will pick the default machine in this case. Requesting
the list of available machines is still possible via '-machine ?' e.g.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
13 years agoCODING_STYLE: explicitly allow braceless 'else if'
Avi Kivity [Mon, 25 Jul 2011 15:55:53 +0000 (18:55 +0300)]
CODING_STYLE: explicitly allow braceless 'else if'

It's already allowed by the example; there are about 1800 instances in the
tree; and disallowing it would lead to

    if (a) {
        ...
    } else {
        if (b) {
            ...
        } else {
            if (c) {
                ...
            } else {
                if (d) {
                    ...
                } else {
                    ...
                }
            }
        }
    }

instead of

    if (a) {
        ...
    } else if (b) {
        ...
    } else if (c) {
        ...
    } else if (d) {
        ...
    } else {
        ...
    }

which is more readable.

Acked-by: Blue Swirl <blauwirbel@gmail.com>
Signed-off-by: Avi Kivity <avi@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
13 years agoFix a compilation error in xen-mapcache.c
Stefan Berger [Tue, 26 Jul 2011 14:33:11 +0000 (10:33 -0400)]
Fix a compilation error in xen-mapcache.c

This patch fixes a compilation error in xen-mapcache.c .

/home/stefanb/qemu/qemu-git/xen-mapcache.c: In function ‘xen_ram_addr_from_mapcache’:
/home/stefanb/qemu/qemu-git/xen-mapcache.c:240:42: error: variable ‘pentry’ set but not used [-Werror=unused-but-set-variable]
cc1: all warnings being treated as errors

Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
13 years agomultiboot: Fix bss segment support
Göran Weinholt [Sun, 24 Jul 2011 15:55:58 +0000 (17:55 +0200)]
multiboot: Fix bss segment support

Multiboot images can specify a bss segment. The boot loader must clear
the memory of the bss and ensure that no modules or structures are
allocated inside it. Several fields are provided in the Multiboot
header that were previously not used properly. The header is now used
to determine how much data should be read from the image and how much
memory should be reserved to the bss segment.

Signed-off-by: Göran Weinholt <goran@weinholt.se>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
13 years agoconfigure: add --disable-zlib-test
Alon Levy [Tue, 26 Jul 2011 09:30:40 +0000 (12:30 +0300)]
configure: add --disable-zlib-test

This is required for building libcacard which doesn't itself require
zlib without bringing in this requirement to the build environment.

Signed-off-by: Alon Levy <alevy@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
13 years agoAdd missing trace call to oslib-posix.c:qemu_vmalloc()
Jes Sorensen [Mon, 25 Jul 2011 15:13:36 +0000 (17:13 +0200)]
Add missing trace call to oslib-posix.c:qemu_vmalloc()

Acked-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
13 years agoFix last sector write on sd card
Dr. David Alan Gilbert [Mon, 25 Jul 2011 12:21:30 +0000 (13:21 +0100)]
Fix last sector write on sd card

    When writing the last sector of an SD card using WRITE_MULTIPLE_BLOCK
QEmu throws an error saying that we've run off the end, and leaves
itself in the wrong state.

    Tested on ARM Vexpress model.

Signed-off-by: Dr. David Alan Gilbert <david.gilbert@linaro.org>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
13 years agomove unaligned memory access functions to bswap.h
Paolo Bonzini [Thu, 28 Jul 2011 10:10:30 +0000 (12:10 +0200)]
move unaligned memory access functions to bswap.h

This is just code movement, and moving the fpu/ include path from
target-dependent to target-independent Make variables.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
13 years agosoftfloat: change default nan definitions to variables
Paolo Bonzini [Thu, 28 Jul 2011 10:10:29 +0000 (12:10 +0200)]
softfloat: change default nan definitions to variables

Most definitions in softfloat.h are really target-independent, but the
file is not because it includes definitions of the default NaN values.
Change those to variables to allow including softfloat.h from files that
are not compiled per-target.  By making them const, the compiler is
allowed to optimize them into softfloat functions that use them.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
13 years agomove WORDS_ALIGNED to qemu-common.h
Paolo Bonzini [Thu, 28 Jul 2011 10:10:28 +0000 (12:10 +0200)]
move WORDS_ALIGNED to qemu-common.h

This is not a CPU interface, and a configure test would not be too
precise.  So just add it to qemu-common.h.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
13 years agoshowing a splash picture when start
wayne [Wed, 27 Jul 2011 10:04:55 +0000 (18:04 +0800)]
showing a splash picture when start

    Added options to let qemu transfer two configuration files to bios:
"bootsplash.bmp" and "etc/boot-menu-wait", which could be specified by command
    -boot splash=P,splash-time=T
P is jpg/bmp file name or an absolute path, T have a max value of 0xffff, unit
is ms. With these two options, if user invoke qemu with menu=on option, then
a splash picture would be showed in a given time. For example:
    qemu -boot menu=on,splash=/root/boot.bmp,splash-time=5000
would make boot.bmp shown as a brand with 5 seconds in the booting up process.
This feature need the new seabios's support, which could be got from git.

Signed-off-by: Wayne Xia <xiawenc@linux.vnet.ibm.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
13 years agousb-ohci: convert to MemoryRegion
Avi Kivity [Tue, 26 Jul 2011 11:26:22 +0000 (14:26 +0300)]
usb-ohci: convert to MemoryRegion

Reviewed-by: Anthony Liguori <aliguori@us.ibm.com>
Signed-off-by: Avi Kivity <avi@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
13 years agosysbus: add MemoryRegion based memory management API
Avi Kivity [Tue, 26 Jul 2011 11:26:21 +0000 (14:26 +0300)]
sysbus: add MemoryRegion based memory management API

Allow registering sysbus device memory using a MemoryRegion.  Once all users
are converted, sysbus_init_mmio() and sysbus_init_mmio_cb() will be removed.

Reviewed-by: Anthony Liguori <aliguori@us.ibm.com>
Signed-off-by: Avi Kivity <avi@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
13 years agopci: add MemoryRegion based BAR management API
Avi Kivity [Tue, 26 Jul 2011 11:26:20 +0000 (14:26 +0300)]
pci: add MemoryRegion based BAR management API

Allow registering a BAR using a MemoryRegion.  Once all users are converted,
pci_register_bar() and pci_register_bar_simple() will be removed.

Reviewed-by: Anthony Liguori <aliguori@us.ibm.com>
Signed-off-by: Avi Kivity <avi@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
13 years agopci: pass address space to pci bus when created
Avi Kivity [Tue, 26 Jul 2011 11:26:19 +0000 (14:26 +0300)]
pci: pass address space to pci bus when created

This is now done sloppily, via get_system_memory().  Eventually callers
will be converted to stop using that.

Reviewed-by: Anthony Liguori <aliguori@us.ibm.com>
Signed-off-by: Avi Kivity <avi@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
13 years agopc: move global memory map out of pc_init1() and into its callers
Avi Kivity [Tue, 26 Jul 2011 11:26:18 +0000 (14:26 +0300)]
pc: move global memory map out of pc_init1() and into its callers

Signed-off-by: Avi Kivity <avi@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
13 years agopc: convert pc_memory_init() to memory API
Avi Kivity [Tue, 26 Jul 2011 11:26:17 +0000 (14:26 +0300)]
pc: convert pc_memory_init() to memory API

Reviewed-by: Anthony Liguori <aliguori@us.ibm.com>
Signed-off-by: Avi Kivity <avi@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
13 years agopc: grab system_memory
Avi Kivity [Tue, 26 Jul 2011 11:26:16 +0000 (14:26 +0300)]
pc: grab system_memory

While eventually this should come from the machine initialization function,
take a short cut to avoid converting all machines now.

Reviewed-by: Anthony Liguori <aliguori@us.ibm.com>
Signed-off-by: Avi Kivity <avi@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
13 years agoioport: register ranges by byte aligned addresses always
Avi Kivity [Tue, 26 Jul 2011 11:26:15 +0000 (14:26 +0300)]
ioport: register ranges by byte aligned addresses always

The I/O port space is byte addressable, even for word and long accesses.

An example is the VMware svga card, which has long ports on offsets 0,
1, and 2.

Reviewed-by: Anthony Liguori <aliguori@us.ibm.com>
Signed-off-by: Avi Kivity <avi@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
13 years agoexec.c: initialize memory map
Avi Kivity [Tue, 26 Jul 2011 11:26:14 +0000 (14:26 +0300)]
exec.c: initialize memory map

Allocate the root memory region and initialize it.

Signed-off-by: Avi Kivity <avi@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
13 years agomemory: transaction API
Avi Kivity [Tue, 26 Jul 2011 11:26:13 +0000 (14:26 +0300)]
memory: transaction API

Allow changes to the memory hierarchy to be accumulated and
made visible all at once.  This reduces computational effort,
especially when an accelerator (e.g. kvm) is involved.

Useful when a single register update causes multiple changes
to an address space.

Signed-off-by: Avi Kivity <avi@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
13 years agomemory: separate building the final memory map into two steps
Avi Kivity [Tue, 26 Jul 2011 11:26:12 +0000 (14:26 +0300)]
memory: separate building the final memory map into two steps

Instead of adding and deleting regions in one pass, do a delete
pass followed by an add pass.  This fixes the following case:

from:
  0x0000-0x0fff ram  (a1)
  0x1000-0x1fff mmio (a2)
  0x2000-0x2fff ram  (a3)

to:
  0x0000-0x2fff ram  (b1)

The single pass algorithm removed a1, added b2, then removed a2 and a3,
which caused the wrong memory map to be built.  The two pass algorithm
removes a1, a2, and a3, then adds b1.

Signed-off-by: Avi Kivity <avi@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
13 years agomemory: add ioeventfd support
Avi Kivity [Tue, 26 Jul 2011 11:26:11 +0000 (14:26 +0300)]
memory: add ioeventfd support

As with the rest of the memory API, the caller associates an eventfd
with an address, and the memory API takes care of registering or
unregistering when the address is made visible or invisible to the
guest.

Signed-off-by: Avi Kivity <avi@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
13 years agomemory: add backward compatibility for old mmio registration
Avi Kivity [Tue, 26 Jul 2011 11:26:10 +0000 (14:26 +0300)]
memory: add backward compatibility for old mmio registration

This eases the transition to the new API.

Reviewed-by: Anthony Liguori <aliguori@us.ibm.com>
Signed-off-by: Avi Kivity <avi@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
13 years agomemory: add backward compatibility for old portio registration
Avi Kivity [Tue, 26 Jul 2011 11:26:09 +0000 (14:26 +0300)]
memory: add backward compatibility for old portio registration

Reviewed-by: Anthony Liguori <aliguori@us.ibm.com>
Signed-off-by: Avi Kivity <avi@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
13 years agomemory: I/O address space support
Avi Kivity [Tue, 26 Jul 2011 11:26:08 +0000 (14:26 +0300)]
memory: I/O address space support

Allow registering I/O ports via the same mechanism as mmio ranges.

Reviewed-by: Anthony Liguori <aliguori@us.ibm.com>
Signed-off-by: Avi Kivity <avi@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
13 years agomemory: late initialization of ram_addr
Avi Kivity [Tue, 26 Jul 2011 11:26:07 +0000 (14:26 +0300)]
memory: late initialization of ram_addr

For non-RAM memory regions, we cannot tell whether this is an I/O region
or an MMIO region.  Since the qemu backing registration is different for
the two, we have to defer initialization until we know which address
space we are in.

These shenanigans will be removed once the backing registration is unified
with the memory API.

Signed-off-by: Avi Kivity <avi@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
13 years agomemory: rename MemoryRegion::has_ram_addr to ::terminates
Avi Kivity [Tue, 26 Jul 2011 11:26:06 +0000 (14:26 +0300)]
memory: rename MemoryRegion::has_ram_addr to ::terminates

I/O regions will not have ram_addrs, so this is a better name.

Reviewed-by: Anthony Liguori <aliguori@us.ibm.com>
Signed-off-by: Avi Kivity <avi@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
13 years agomemory: abstract address space operations
Avi Kivity [Tue, 26 Jul 2011 11:26:05 +0000 (14:26 +0300)]
memory: abstract address space operations

Prepare for multiple address space support by abstracting away the details
of registering a memory range with qemu's flat representation into an
AddressSpace object.

Note operations which are memory specific are not abstracted, since they will
never be called on I/O address spaces anyway.

Reviewed-by: Anthony Liguori <aliguori@us.ibm.com>
Signed-off-by: Avi Kivity <avi@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
13 years agoInternal interfaces for memory API
Avi Kivity [Tue, 26 Jul 2011 11:26:04 +0000 (14:26 +0300)]
Internal interfaces for memory API

get_system_memory() provides the root of the memory hierarchy.

This interface is intended to be private between memory.c and exec.c.
If this file is included elsewhere, it should be regarded as a bug (or
TODO item).  However, it will be temporarily needed for the conversion
to hierarchical memory routing.

Reviewed-by: Anthony Liguori <aliguori@us.ibm.com>
Signed-off-by: Avi Kivity <avi@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
13 years agomemory: merge adjacent segments of a single memory region
Avi Kivity [Tue, 26 Jul 2011 11:26:03 +0000 (14:26 +0300)]
memory: merge adjacent segments of a single memory region

Simple implementations of memory routers, for example the Cirrus VGA memory banks
or the 440FX PAM registers can generate adjacent memory regions which are contiguous.
Detect these and merge them; this saves kvm memory slots and shortens lookup times.

Signed-off-by: Avi Kivity <avi@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
13 years agomemory: implement dirty tracking
Avi Kivity [Tue, 26 Jul 2011 11:26:02 +0000 (14:26 +0300)]
memory: implement dirty tracking

Currently dirty tracking is implemented by passing through
all calls to the underlying cpu_physical_memory_*() calls.

Reviewed-by: Anthony Liguori <aliguori@us.ibm.com>
Signed-off-by: Avi Kivity <avi@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
13 years agoHierarchical memory region API
Avi Kivity [Tue, 26 Jul 2011 11:26:01 +0000 (14:26 +0300)]
Hierarchical memory region API

The memory API separates the attributes of a memory region (its size, how
reads or writes are handled, dirty logging, and coalescing) from where it
is mapped and whether it is enabled.  This allows a device to configure
a memory region once, then hand it off to its parent bus to map it according
to the bus configuration.

Hierarchical registration also allows a device to compose a region out of
a number of sub-regions with different properties; for example some may be
RAM while others may be MMIO.

Reviewed-by: Anthony Liguori <aliguori@us.ibm.com>
Signed-off-by: Avi Kivity <avi@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
13 years agoAdd memory API documentation
Avi Kivity [Tue, 26 Jul 2011 11:26:00 +0000 (14:26 +0300)]
Add memory API documentation

Signed-off-by: Avi Kivity <avi@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
13 years agoqdev: Reset hot-plugged devices
Jan Kiszka [Sun, 24 Jul 2011 17:38:36 +0000 (19:38 +0200)]
qdev: Reset hot-plugged devices

Device models rely on the core invoking their reset handlers after init.
We do this in the cold-plug case, but so far we miss this step after
hot-plug.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
13 years agoxen_mapcache: remove unused variable
Juan Quintela [Mon, 11 Jul 2011 16:15:11 +0000 (18:15 +0200)]
xen_mapcache: remove unused variable

Signed-off-by: Juan Quintela <quintela@redhat.com>
Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
13 years agoMakefile: add missing deps on $(GENERATED_HEADERS)
Michael Roth [Tue, 26 Jul 2011 16:39:24 +0000 (11:39 -0500)]
Makefile: add missing deps on $(GENERATED_HEADERS)

This fixes a build issue with make -j6+ due to qapi-generated files
being built before $(GENERATED_HEADERS) have been created.

Tested-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
13 years agoqmp: fix efect -> effect typo in qmp-commands.hx
Zhi Yong Wu [Wed, 27 Jul 2011 06:32:56 +0000 (14:32 +0800)]
qmp: fix efect -> effect typo in qmp-commands.hx

Signed-off-by: Zhi Yong Wu <wuzhy@linux.vnet.ibm.com>
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
13 years agoslirp: Fix unusual "comments" in unused code
Stefan Weil [Thu, 21 Jul 2011 19:46:45 +0000 (21:46 +0200)]
slirp: Fix unusual "comments" in unused code

cppcheck detected two rather strange comments which were not
correctly written as C comments.

They did not cause any harm because they were framed by
#ifdef notdef ... #endif, so they were never compiled.

Fix them nevertheless (we could also remove the unused code).

Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
13 years agoMakefile: Minor cscope fixups
Alexandre Raymond [Thu, 21 Jul 2011 03:12:15 +0000 (23:12 -0400)]
Makefile: Minor cscope fixups

Create cscope symbols for assembly files in addition to .c/.h files.
Create cscope database with full path instead of relative path so cscope
can be used with CSCOPE_DB in any directory.

Signed-off-by: Alexandre Raymond <cerbere@gmail.com>
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
13 years agovhost build fix for i386
Wolfgang Mauerer [Mon, 11 Jul 2011 12:57:43 +0000 (14:57 +0200)]
vhost build fix for i386

vhost.c uses __sync_fetch_and_and(), which is only
available for -march=i486 and above (see
https://bugzilla.redhat.com/show_bug.cgi?id=624279).

Signed-off-by: Wolfgang Mauerer <wolfgang.mauerer@siemens.com>
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
13 years agolibcacard: add pc file, install it + includes
Alon Levy [Mon, 27 Jun 2011 09:58:20 +0000 (11:58 +0200)]
libcacard: add pc file, install it + includes

Additionally:
 + add --includedir configure parameters
 + make install-libcacard install vscclient as well

13 years agoxen: implement unplug protocol in xen_platform
Stefano Stabellini [Mon, 18 Jul 2011 06:07:02 +0000 (06:07 +0000)]
xen: implement unplug protocol in xen_platform

The unplug protocol is necessary to support PV drivers in the guest: the
drivers expect to be able to "unplug" emulated disks and nics before
initializing the Xen PV interfaces.
It is responsibility of the guest to make sure that the unplug is done
before the emulated devices or the PV interface start to be used.

We use pci_for_each_device to walk the PCI bus, identify the devices and
disks that we want to disable and dynamically unplug them.

Changes in v2:

- use PCI_CLASS constants;

- replace pci_unplug_device with qdev_unplug;

- do not import hw/ide/internal.h in xen_platform.c;

Changes in v3:

- introduce piix3-ide-xen, that support hot-unplug;

- move the unplug code to hw/ide/piix.c;

- just call qdev_unplug from xen_platform.c to unplug the IDE disks;

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Acked-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Alexander Graf <agraf@suse.de>
13 years agovl.c: Check the asked ram_size later.
Anthony PERARD [Wed, 20 Jul 2011 08:17:44 +0000 (08:17 +0000)]
vl.c: Check the asked ram_size later.

As a Xen guest can have more than 2GB of RAM on a 32bit host, we move
the conditions after than we now if we run one Xen or not.

[agraf] separate xen branch from ram_size check

Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
Signed-off-by: Alexander Graf <agraf@suse.de>
13 years agoxen: Fix the memory registration to reflect of what is done by Xen.
Anthony PERARD [Wed, 20 Jul 2011 08:17:43 +0000 (08:17 +0000)]
xen: Fix the memory registration to reflect of what is done by Xen.

A Xen guest memory is allocated by libxc. But this memory is not
allocated continuously, instead, it leaves the VGA IO memory space not
allocated, same for the MMIO space (at HVM_BELOW_4G_MMIO_START of size
HVM_BELOW_4G_MMIO_LENGTH).

So to reflect that, we do not register the physical memory for this two
holes. But we still keep only one RAMBlock for the all RAM as it is more
easier than have two separate blocks (1 above 4G). Also this prevent QEMU
from use the MMIO space for a ROM.

Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
Signed-off-by: Alexander Graf <agraf@suse.de>
13 years agocpu-common: Have a ram_addr_t of uint64 with Xen.
Anthony PERARD [Wed, 20 Jul 2011 08:17:42 +0000 (08:17 +0000)]
cpu-common: Have a ram_addr_t of uint64 with Xen.

In Xen case, memory can be bigger than the host memory. that mean a
32bits host (and QEMU) should be able to handle a RAM address of 64bits.

Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
Signed-off-by: Alexander Graf <agraf@suse.de>
13 years agoxen: make xen_enabled even more clever
Alexander Graf [Sun, 17 Jul 2011 05:30:29 +0000 (07:30 +0200)]
xen: make xen_enabled even more clever

When using xen_enabled() we're currently only checking if xen is enabled
at all during the build. But what if you want to build multiple targets
out of which only one can potentially run xen code?

That means that for generic code we'll still have to fall back to the
variable and potentially slow the code down, but it's not as important as
that is mostly xen device emulation which is not touched for non-xen targets.

The target specific code however can with this patch see that it's unable to
ever execute xen code. We can thus always return 0 on xen_enabled(), giving
gcc enough hints to evict the mapcache code from the target memory management
code.

Signed-off-by: Alexander Graf <agraf@suse.de>
Acked-by: Anthony PERARD <anthony.perard@citrix.com>
13 years agoxen: remove CONFIG_XEN_MAPCACHE
Alexander Graf [Sun, 17 Jul 2011 05:22:06 +0000 (07:22 +0200)]
xen: remove CONFIG_XEN_MAPCACHE

We were still exporting CONFIG_XEN_MAPCACHE, even though it's completely
unused by now. Remove it.

Signed-off-by: Alexander Graf <agraf@suse.de>
13 years agoexec.c: Use ram_addr_t in cpu_physical_memory_rw(...).
Anthony PERARD [Fri, 15 Jul 2011 04:32:53 +0000 (04:32 +0000)]
exec.c: Use ram_addr_t in cpu_physical_memory_rw(...).

As the variable pd and addr1 inside the function cpu_physical_memory_rw
are mean to handle a RAM address, they should be of the ram_addr_t type
instead of unsigned long.

Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
Acked-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Alexander Graf <agraf@suse.de>
13 years agoxen: Fix xen_enabled().
Anthony PERARD [Fri, 15 Jul 2011 04:32:52 +0000 (04:32 +0000)]
xen: Fix xen_enabled().

Use the "host" CONFIG_ define instead of the "target" one.

Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
Acked-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Alexander Graf <agraf@suse.de>
13 years agoxen: introduce xen_change_state_handler
Anthony PERARD [Fri, 15 Jul 2011 00:33:42 +0000 (00:33 +0000)]
xen: introduce xen_change_state_handler

Remove the call to xenstore_record_dm_state from xen_main_loop_prepare
that is HVM specific.
Add a new vm_change_state_handler shared between xen_pv and xen_hvm
machines to record the VM state to xenstore.

Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Signed-off-by: Alexander Graf <agraf@suse.de>
13 years agoLet users select their pythons
Blue Swirl [Fri, 22 Jul 2011 21:08:09 +0000 (21:08 +0000)]
Let users select their pythons

Add configure check for python, exit if not found. Add switches
for specifying the path to python, use the path in Makefile.

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
13 years agosimpletrace: suppress a warning from unused variable
Blue Swirl [Sat, 23 Jul 2011 21:21:14 +0000 (21:21 +0000)]
simpletrace: suppress a warning from unused variable

Avoid this warning:
  CC    simpletrace.o
/src/qemu/simpletrace.c: In function 'writeout_thread':
/src/qemu/simpletrace.c:122:12: error: variable 'unused' set but not used [-Werror=unused-but-set-variable]
by adding GCC attribute unused to the variable.

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
13 years agoWrap recv to avoid warnings
Blue Swirl [Sat, 23 Jul 2011 20:04:29 +0000 (20:04 +0000)]
Wrap recv to avoid warnings

Avoid warnings like these by wrapping recv():
  CC    slirp/ip_icmp.o
/src/qemu/slirp/ip_icmp.c: In function 'icmp_receive':
/src/qemu/slirp/ip_icmp.c:418:5: error: passing argument 2 of 'recv' from incompatible pointer type [-Werror]
/usr/local/lib/gcc/i686-mingw32msvc/4.6.0/../../../../i686-mingw32msvc/include/winsock2.h:547:32: note: expected 'char *' but argument is of type 'struct icmp *'

Remove also casts used to avoid warnings.

Reviewed-by: Anthony Liguori <aliguori@us.ibm.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
13 years agoFix chrdev return value conversion
Blue Swirl [Sat, 23 Jul 2011 19:26:08 +0000 (19:26 +0000)]
Fix chrdev return value conversion

6e1db57b2ac9025c2443c665a0d9e78748637b26 didn't
convert brlapi or win32 chrdevs, breaking build for those.

Fix by converting the chrdevs.

Acked-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
13 years agoqemu-ga: remove dependency on gio and gthread
Anthony Liguori [Sat, 23 Jul 2011 22:57:47 +0000 (17:57 -0500)]
qemu-ga: remove dependency on gio and gthread

As far as I can tell, there isn't a dependency on gthread.  Also, the only use
of gio was to enable GSocket to accept a unix domain socket.

Since GSocket isn't available on OpenSuSE 11.1, let's just remove that
dependency.

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
13 years agoguest-agent: only enable FSFREEZE when it's supported by the kernel
Anthony Liguori [Sat, 23 Jul 2011 21:14:37 +0000 (16:14 -0500)]
guest-agent: only enable FSFREEZE when it's supported by the kernel

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
13 years agoOpen 1.0 development branch.
Anthony Liguori [Sat, 23 Jul 2011 16:57:53 +0000 (11:57 -0500)]
Open 1.0 development branch.

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
13 years agoBump version to reflect v0.15.0-rc0
Anthony Liguori [Sat, 23 Jul 2011 16:56:07 +0000 (11:56 -0500)]
Bump version to reflect v0.15.0-rc0

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
13 years agoCorrect spelling of licensed
Matthew Fernandez [Sun, 26 Jun 2011 02:21:35 +0000 (12:21 +1000)]
Correct spelling of licensed

Correct typos of "licenced" to "licensed".

Reviewed-by: Stefan Weil <weil@mail.berlios.de>
Reviewed-by: Andreas F=E4rber <andreas.faerber@web.de>
Signed-off-by: Matthew Fernandez <matthew.fernandez@gmail.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
13 years agoRegister Linux dyntick timer as per-thread signal
Jan Kiszka [Fri, 17 Jun 2011 09:25:49 +0000 (11:25 +0200)]
Register Linux dyntick timer as per-thread signal

Derived from kvm-tool patch
http://thread.gmane.org/gmane.comp.emulators.kvm.devel/74309

Ingo Molnar pointed out that sending the timer signal to the whole
process, just blocking it everywhere, is suboptimal with an increasing
number of threads. QEMU is also using this pattern so far.

Linux provides a (non-portable) way to restrict the signal to a single
thread: We can use SIGEV_THREAD_ID unless we are forced to emulate
signalfd via an additional thread. That case could theoretically be
optimized as well, but it doesn't look worth bothering.

Reviewed-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
13 years agomc146818rtc: Handle host clock resets
Jan Kiszka [Mon, 20 Jun 2011 12:06:28 +0000 (14:06 +0200)]
mc146818rtc: Handle host clock resets

Make use of the new clock reset notifier to update the RTC whenever
rtc_clock is the host clock and that happens to jump backward. This
avoids that the RTC stalls for the period the host clock was set back.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
13 years agoqemu-timer: Introduce clock reset notifier
Jan Kiszka [Mon, 20 Jun 2011 12:06:27 +0000 (14:06 +0200)]
qemu-timer: Introduce clock reset notifier

QEMU_CLOCK_HOST is based on the system time which may jump backward in
case the admin or NTP adjusts it. RTC emulations and other device models
can suffer in this case as timers will stall for the period the clock
was tuned back.

This adds a detection mechanism that checks on every host clock readout
if the new time is before the last result. If that is the case a
notifier list is informed. Device models interested in this event can
register a notifier with the clock.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
13 years agonotifier: Pass data argument to callback
Jan Kiszka [Mon, 20 Jun 2011 12:06:26 +0000 (14:06 +0200)]
notifier: Pass data argument to callback

This allows to pass additional information to the notifier callback
which is useful if sender and receiver do not share any other distinct
data structure.

Will be used first for the clock reset notifier.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
13 years agoide: Turn properties any IDE device must have into bus properties
Markus Armbruster [Thu, 19 May 2011 11:37:17 +0000 (13:37 +0200)]
ide: Turn properties any IDE device must have into bus properties

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
13 years agovirtio-serial: Turn props any virtio-serial-bus device must have into bus props
Markus Armbruster [Thu, 19 May 2011 11:37:16 +0000 (13:37 +0200)]
virtio-serial: Turn props any virtio-serial-bus device must have into bus props

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
13 years agovirtio-serial: Clean up virtser_bus_dev_print() output
Markus Armbruster [Thu, 19 May 2011 11:37:15 +0000 (13:37 +0200)]
virtio-serial: Clean up virtser_bus_dev_print() output

Old version looks like this in info qtree (last four lines):

          dev: virtconsole, id ""
            dev-prop: is_console = 1
            dev-prop: nr = 0
            dev-prop: chardev = <null>
            dev-prop: name = <null>
             dev-prop-int: id: 0
             dev-prop-int: guest_connected: 1
             dev-prop-int: host_connected: 0
             dev-prop-int: throttled: 0

Indentation is off, and "dev-prop-int" suggests these are properties
you can configure with -device, which isn't the case.  The other
buses' print_dev() callbacks don't do that.  For instance, PCI's
output looks like this:

        class Ethernet controller, addr 00:03.0, pci id 1af4:1000 (sub 1af4:0001)
        bar 0: i/o at 0xffffffffffffffff [0x1e]
        bar 1: mem at 0xffffffffffffffff [0xffe]
        bar 6: mem at 0xffffffffffffffff [0xfffe]

Change virtser_bus_dev_print() to that style.  Result:

          dev: virtconsole, id ""
            dev-prop: is_console = 1
            dev-prop: nr = 0
            dev-prop: chardev = <null>
            dev-prop: name = <null>
            port 0, guest on, host off, throttle off

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
13 years agousb-ccid: Drop unused CCIDCardInfo callback print()
Markus Armbruster [Thu, 19 May 2011 11:37:14 +0000 (13:37 +0200)]
usb-ccid: Drop unused CCIDCardInfo callback print()

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
13 years agoRemove unused USES_X509_AUTH macro from VNC sasl code
Daniel P. Berrange [Thu, 23 Jun 2011 12:31:43 +0000 (13:31 +0100)]
Remove unused USES_X509_AUTH macro from VNC sasl code

The USES_X509_AUTH macro is defined in several VNC files,
but not used in all of them. Remove the unused definition.

* ui/vnc-auth-sasl.c: Remove USES_X509_AUTH macro

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
13 years agoIntroduce a 'client_add' monitor command accepting an open FD
Daniel P. Berrange [Thu, 23 Jun 2011 12:31:42 +0000 (13:31 +0100)]
Introduce a 'client_add' monitor command accepting an open FD

Allow client connections for VNC and socket based character
devices to be passed in over the monitor using SCM_RIGHTS.

One intended usage scenario is to start QEMU with VNC on a
UNIX domain socket. An unprivileged user which cannot access
the UNIX domain socket, can then connect to QEMU's VNC server
by passing an open FD to libvirt, which passes it onto QEMU.

 { "execute": "get_fd", "arguments": { "fdname": "myclient" } }
 { "return": {} }
 { "execute": "add_client", "arguments": { "protocol": "vnc",
                                           "fdname": "myclient",
                                           "skipauth": true } }
 { "return": {} }

In this case 'protocol' can be 'vnc' or 'spice', or the name
of a character device (eg from -chardev id=XXXX)

The 'skipauth' parameter can be used to skip any configured
VNC authentication scheme, which is useful if the mgmt layer
talking to the monitor has already authenticated the client
in another way.

* console.h: Define 'vnc_display_add_client' method
* monitor.c: Implement 'client_add' command
* qemu-char.c, qemu-char.h: Add 'qemu_char_add_client' method
* qerror.c, qerror.h: Add QERR_ADD_CLIENT_FAILED
* qmp-commands.hx: Declare 'client_add' command
* ui/vnc.c: Implement 'vnc_display_add_client' method

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
13 years agoStore VNC auth scheme per-client as well as per-server
Daniel P. Berrange [Thu, 23 Jun 2011 12:31:41 +0000 (13:31 +0100)]
Store VNC auth scheme per-client as well as per-server

A future patch will introduce a situation where different
clients may have different authentication schemes set.
When a new client arrives, copy the 'auth' and 'subauth'
fields from VncDisplay into the client's VncState, and
use the latter in all authentication functions.

* ui/vnc.h: Add 'auth' and 'subauth' to VncState
* ui/vnc-auth-sasl.c, ui/vnc-auth-vencrypt.c,
  ui/vnc.c: Make auth functions pull auth scheme
  from VncState instead of VncDisplay

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
13 years agodo not reset no_shutdown after we shutdown the vm
Wen Congyang [Fri, 17 Jun 2011 02:25:22 +0000 (10:25 +0800)]
do not reset no_shutdown after we shutdown the vm

Daniel P. Berrange sent a libvirt's patch to support
reboots with the QEMU driver. He implements it in
json model like this:
1. add -no-shutdown in the qemu's option:
   qemu -no-shutdown xxxx
2. shutdown the vm by monitor command system_powerdown
3. wait for shutdown event
4. reset the vm by monitor command system_reset

no_shutdown will be reset to 0 if the vm is powered down.
We only can reboot the vm once.

If no_shutdown is not reset to 0, we can reboot the vm
many times.

Signed-off-by: Wen Congyang <wency@cn.fujitsu.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
13 years agovl.c: Don't limit node count by smp count
Sasha Levin [Thu, 30 Jun 2011 03:29:39 +0000 (23:29 -0400)]
vl.c: Don't limit node count by smp count

[I've sent this patch couple of months ago and noticed it
 didn't make it's way in - so I'm sending it again]

It is possible to create CPU-less NUMA nodes, node amount shouldn't be
limited by amount of CPUs.

Tested-by: Michael Roth <mdroth@linux.vnet.ibm.com>
Acked-by: Andre Przywara <andre.przywara@amd.com>
Signed-off-by: Sasha Levin <levinsasha928@gmail.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
13 years agovga: Fix type of lfb/map_addr/end.
Richard Henderson [Tue, 14 Jun 2011 19:53:08 +0000 (12:53 -0700)]
vga: Fix type of lfb/map_addr/end.

These addresses have been passed through pci_to_cpu_addr,
and thus need to be full target_phys_addr_t.

Acked-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Richard Henderson <rth@twiddle.net>
Cc: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
13 years agoqemu-char: Print strerror message on failure
Kevin Wolf [Wed, 1 Jun 2011 11:29:11 +0000 (13:29 +0200)]
qemu-char: Print strerror message on failure

The only way for chardev drivers to communicate an error was to return a NULL
pointer, which resulted in an error message that said _that_ something went
wrong, but not _why_.

This patch changes the interface to return 0/-errno and updates
qemu_chr_open_opts to use strerror to display a more helpful error message.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
13 years agoqemu-timer: change unix timer to dynticks
Paolo Bonzini [Thu, 9 Jun 2011 11:10:25 +0000 (13:10 +0200)]
qemu-timer: change unix timer to dynticks

A timer that wakes up every millisecond puts a lot of stress on the
iothread.  The large amount of IPIs causes very high context switch
activity, making emulation slow and the UI unusable.  This is by the
way the same reason why the Windows timers were switched to dynticks.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Tested-by: Alexander Graf <agraf@suse.de>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
13 years agoiothread: replace fair_mutex with a condition variable
Paolo Bonzini [Thu, 9 Jun 2011 11:10:24 +0000 (13:10 +0200)]
iothread: replace fair_mutex with a condition variable

This conveys the intention better, and scales to more than >1
threads contending the mutex with the iothread (as long as all
of them have a "quiescent point" like the TCG thread has).

Also, on Mac OS X the fair_mutex somehow didn't work as intended
and deadlocked.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Tested-by: Alexander Graf <agraf@suse.de>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
13 years agomultiboot: Support commas in module parameters
Adam Lackorzynski [Wed, 6 Jul 2011 08:03:57 +0000 (10:03 +0200)]
multiboot: Support commas in module parameters

Support commas in the parameter list of multiboot modules as well as for the
kernel command line, by using double commas (via get_opt_value()).

Signed-off-by: Adam Lackorzynski <adam@os.inf.tu-dresden.de>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
13 years agoreport serial devices created with -device in the PIIX4 config space
Paolo Bonzini [Fri, 15 Jul 2011 15:10:15 +0000 (17:10 +0200)]
report serial devices created with -device in the PIIX4 config space

Serial and parallel devices created with -device are not reported in
the PIIX4 configuration space, and are hence not picked up by the DSDT.
This upsets Windows, which hides them altogether from the guest.

To avoid this, check at the end of machine initialization whether the
corresponding I/O ports have been registered.  The new function in
ioport.c does this; this also requires a tweak to isa_unassign_ioport.

I left the comment in piix4_pm_initfn since the registers I moved do
seem to match the 82371AB datasheet.  There are some quirks though.
We are setting this bit:

    "Device 8 EIO Enable (EIO_EN_DEV8)—R/W. 1=Enable PCI access to the
    device 8 enabled I/O ranges to be claimed by PIIX4 and forwarded
    to the ISA/EIO bus. 0=Disable. The LPT_MON_EN must be set to enable
    the decode."

but not LPT_MON_EN (bit 18 at 50h):

    LPT Port Enable (LPT_MON_EN)—R/W. 1=Enable accesses to parallel
    port address range (LPT_DEC_SEL) to generate a device 8 (parallel
    port) decode event. 0=Disable.

We're also setting the LPT_DEC_SEL field (that's the 0x60 written to
63h) to 11, which means reserved, rather than to 01 (378h-37Fh).

Likewise we're not setting SA_MON_EN, SB_MON_EN (respectively bit 14
and bit 16 at address 50h) for the serial ports.  However, we're setting
COMA_DEC_SEL and COMB_DEC_SEL correctly, unlike the corresponding register
for the parallel port.

All these fields are left as they are, since they are probably only
meant to be used in the DSDT.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
13 years ago.gitignore: ignore qemu-ga and qapi-generated
Alexandre Raymond [Sat, 23 Jul 2011 05:41:57 +0000 (01:41 -0400)]
.gitignore: ignore qemu-ga and qapi-generated

Add a new binary and generation directory to the gitignore file

Signed-off-by: Alexandre Raymond <cerbere@gmail.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>