]> git.proxmox.com Git - qemu.git/log
qemu.git
11 years agovmdk: Add option to create zeroed-grain image
Fam Zheng [Thu, 2 May 2013 02:25:24 +0000 (10:25 +0800)]
vmdk: Add option to create zeroed-grain image

Add image create option "zeroed-grain" to enable zeroed-grain GTE
feature of vmdk sparse extents. When this option is on, header version
of newly created extent will be 2 and VMDK4_FLAG_ZERO_GRAIN flag bit
will be set.

Signed-off-by: Fam Zheng <famz@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
11 years agovmdk: add support for “zeroed‐grain” GTE
Fam Zheng [Thu, 2 May 2013 02:25:23 +0000 (10:25 +0800)]
vmdk: add support for “zeroed‐grain” GTE

Introduced support for zeroed-grain GTE, as specified in Virtual Disk
Format 5.0[1].

    Recent VMware hosted platform products support a new “zeroed‐grain”
    grain table entry (GTE). The zeroed‐grain GTE returns all zeros on
    read.  In other words, the zeroed‐grain GTE indicates that a grain
    in the child disk is zero‐filled but does not actually occupy space
    in storage.  A sparse extent with zeroed‐grain GTE has the following
    in its header:

     * SparseExtentHeader.version = 2
     * SparseExtentHeader.flags has bit 2 set

    Other than the new flag and the possibly zeroed‐grain GTE, version 2
    sparse extents are identical to version 1.  Also, a zeroed‐grain GTE
    has value 0x1 in the GT table.

[1] Virtual Disk Format 5.0, http://www.vmware.com/support/developer/vddk/vmdk_50_technote.pdf?src=vmdk
Signed-off-by: Fam Zheng <famz@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
11 years agovmdk: named return code.
Fam Zheng [Thu, 2 May 2013 02:25:22 +0000 (10:25 +0800)]
vmdk: named return code.

Internal routines in vmdk.c previously return -1 on error and 0 on
success. More return values are useful for future changes such as
zeroed-grain GTE. Change all the magic `return 0` and `return -1` to
macro names:

 * VMDK_OK      0
 * VMDK_ERROR   (-1)
 * VMDK_UNALLOC (-2)
 * VMDK_ZEROED  (-3)

Signed-off-by: Fam Zheng <famz@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
11 years agoblockdev: Replace "undefined error" in qmp_block_resize
Kevin Wolf [Thu, 2 May 2013 13:32:55 +0000 (15:32 +0200)]
blockdev: Replace "undefined error" in qmp_block_resize

We have an errno value that can be displayed, so we should just do that.
An easy way to reproduce this case is to resize a raw image to a size
that is too large for the host file system.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
11 years agoblock: add read-only support to VHDX image format.
Jeff Cody [Mon, 29 Apr 2013 18:48:19 +0000 (14:48 -0400)]
block: add read-only support to VHDX image format.

This adds in read-only support to the VHDX image format.  This supports
reads for fixed-size, and dynamic sized VHDX images.

Differencing files are still unsupported.

The image must be opened without BDRV_O_RDWR set, because we do not
yet update the headers.  I.e., pass 'readonly=on' in the drive image
options from the QEMU commandline.

Signed-off-by: Jeff Cody <jcody@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
11 years agoblock: initial VHDX driver support framework - supports open and probe
Jeff Cody [Mon, 29 Apr 2013 18:48:18 +0000 (14:48 -0400)]
block: initial VHDX driver support framework - supports open and probe

This is the initial block driver framework for VHDX image support
(i.e. Hyper-V image file formats), that supports opening VHDX files, and
parsing the headers.

This commit does not yet enable:
    - reading
    - writing
    - updating the header
    - differencing files (images with parents)
    - log replay / dirty logs (only clean images)

This is based on Microsoft's VHDX specification:
    "VHDX Format Specification v0.95", published 4/12/2012
    https://www.microsoft.com/en-us/download/details.aspx?id=29681

Signed-off-by: Jeff Cody <jcody@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
11 years agoblock: vhdx header for the QEMU support of VHDX images
Jeff Cody [Mon, 29 Apr 2013 18:48:17 +0000 (14:48 -0400)]
block: vhdx header for the QEMU support of VHDX images

This is based on Microsoft's VHDX specification:
    "VHDX Format Specification v0.95", published 4/12/2012
    https://www.microsoft.com/en-us/download/details.aspx?id=29681

These structures define the various header, metadata, and other
block structures defined in the VHDX specification.

Signed-off-by: Jeff Cody <jcody@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
11 years agoqemu: add castagnoli crc32c checksum algorithm
Jeff Cody [Mon, 29 Apr 2013 18:48:16 +0000 (14:48 -0400)]
qemu: add castagnoli crc32c checksum algorithm

This adds the Castagnoli CRC32C algorithm, using the 0x11EDC6F41
polynomial.

This is extracted from the linux kernel cryptographic crc32.c module.

The algorithm is based on:

Castagnoli93: Guy Castagnoli and Stefan Braeuer and Martin Herrman
             "Optimization of Cyclic Redundancy-Check Codes with 24
              and 32 Parity Bits", IEEE Transactions on Communication,
              Volume 41, Number 6, June 1993

Signed-off-by: Jeff Cody <jcody@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
11 years agoMerge remote-tracking branch 'afaerber/qom-cpu' into staging
Anthony Liguori [Thu, 2 May 2013 15:57:01 +0000 (10:57 -0500)]
Merge remote-tracking branch 'afaerber/qom-cpu' into staging

# By Igor Mammedov (21) and others
# Via Andreas Färber
* afaerber/qom-cpu: (29 commits)
  Drop redundant resume_all_vcpus() from main()
  cpus: Fix pausing TCG CPUs while in vCPU thread
  target-i386: Replace cpuid_*features fields with a feature word array
  target-i386: Break CPUID feature definition lines
  target-i386/kvm.c: Code formatting changes
  target-i386: Group together level, xlevel, xlevel2 fields
  pc: Implement QEMUMachine::hot_add_cpu hook
  QMP: Add cpu-add command
  Add hot_add_cpu hook to QEMUMachine
  target-i386: Move APIC to ICC bus
  target-i386: Attach ICC bus to CPU on its creation
  target-i386: Introduce ICC bus/device/bridge
  cpu: Move cpu_write_elfXX_note() functions to CPUState
  kvmvapic: Make dependency on sysbus.h explicit
  target-i386: Replace MSI_SPACE_SIZE with APIC_SPACE_SIZE
  target-i386: Do not allow to set apic-id once CPU is realized
  target-i386: Introduce apic-id CPU property
  target-i386: Introduce feat2prop() for CPU properties
  acpi_piix4: Add infrastructure to send CPU hot-plug GPE to guest
  cpu: Add helper cpu_exists(), to check if CPU with specified id exists
  ...

11 years agoMerge remote-tracking branch 'mjt/trivial-patches' into staging
Anthony Liguori [Thu, 2 May 2013 15:56:07 +0000 (10:56 -0500)]
Merge remote-tracking branch 'mjt/trivial-patches' into staging

# By Andreas Färber (1) and others
# Via Michael Tokarev
* mjt/trivial-patches:
  pvscsi: fix compilation on 32 bit hosts
  Trivial grammar and spelling fixes
  configure: Pick up libseccomp include path

11 years agoDrop redundant resume_all_vcpus() from main()
Jan Kiszka [Mon, 20 Aug 2012 18:11:36 +0000 (20:11 +0200)]
Drop redundant resume_all_vcpus() from main()

VCPUs are either resumed directly via vm_start(), after the incoming
migration is done, or when a continue command is issued. We don't need
the explicit resume before entering main_loop().

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Andreas Färber <afaerber@suse.de>
11 years agocpus: Fix pausing TCG CPUs while in vCPU thread
Andreas Färber [Thu, 2 May 2013 09:22:05 +0000 (11:22 +0200)]
cpus: Fix pausing TCG CPUs while in vCPU thread

Due to a preceding while loop, no CPU would've been put into stopped
state. Reinitialize the variable.
This fixes commit d798e97456658ea7605303b7c69b04ec7df95c10 (Allow to use
pause_all_vcpus from VCPU context) for non-KVM case.

While at it, change a 0 to false, amending commit
4fdeee7cd4c8f90ef765537b9346a195d9483ab5 (cpu: Move stop field to
CPUState).

Reviewed-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Andreas Färber <afaerber@suse.de>
11 years agotarget-i386: Replace cpuid_*features fields with a feature word array
Eduardo Habkost [Mon, 22 Apr 2013 19:00:15 +0000 (16:00 -0300)]
target-i386: Replace cpuid_*features fields with a feature word array

This replaces the feature-bit fields on both X86CPU and x86_def_t
structs with an array.

With this, we will be able to simplify code that simply does the same
operation on all feature words (e.g. kvm_check_features_against_host(),
filter_features_for_kvm(), add_flagname_to_bitmaps(), CPU feature-bit
property lookup/registration, and the proposed "feature-words" property)

The following field replacements were made on X86CPU and x86_def_t:

  (cpuid_)features         -> features[FEAT_1_EDX]
  (cpuid_)ext_features     -> features[FEAT_1_ECX]
  (cpuid_)ext2_features    -> features[FEAT_8000_0001_EDX]
  (cpuid_)ext3_features    -> features[FEAT_8000_0001_ECX]
  (cpuid_)ext4_features    -> features[FEAT_C000_0001_EDX]
  (cpuid_)kvm_features     -> features[FEAT_KVM]
  (cpuid_)svm_features     -> features[FEAT_SVM]
  (cpuid_)7_0_ebx_features -> features[FEAT_7_0_EBX]

Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
Reviewed-by: Igor Mammedov <imammedo@redhat.com>
Signed-off-by: Andreas Färber <afaerber@suse.de>
11 years agotarget-i386: Break CPUID feature definition lines
Eduardo Habkost [Mon, 22 Apr 2013 19:00:14 +0000 (16:00 -0300)]
target-i386: Break CPUID feature definition lines

Break lines on kvm_check_features_against_host(), kvm_cpu_fill_host(),
and builtin_x86_defs, so they don't get too long once the *_features
fields are replaced by an array.

Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
Reviewed-by: Igor Mammedov <imammedo@redhat.com>
Signed-off-by: Andreas Färber <afaerber@suse.de>
11 years agotarget-i386/kvm.c: Code formatting changes
Eduardo Habkost [Mon, 22 Apr 2013 19:00:13 +0000 (16:00 -0300)]
target-i386/kvm.c: Code formatting changes

Add appropriate spaces around operators, and break line where it needs
to be broken to allow feature-words array to be introduced without
having too-long lines.

Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
Reviewed-by: Igor Mammedov <imammedo@redhat.com>
Signed-off-by: Andreas Färber <afaerber@suse.de>
11 years agotarget-i386: Group together level, xlevel, xlevel2 fields
Eduardo Habkost [Mon, 22 Apr 2013 19:00:12 +0000 (16:00 -0300)]
target-i386: Group together level, xlevel, xlevel2 fields

Consolidate level, xlevel, xlevel2 fields in x86_def_t and CPUX86State.

Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
Reviewed-by: Igor Mammedov <imammedo@redhat.com>
Signed-off-by: Andreas Färber <afaerber@suse.de>
11 years agopvscsi: fix compilation on 32 bit hosts
Hervé Poussineau [Wed, 1 May 2013 05:41:26 +0000 (07:41 +0200)]
pvscsi: fix compilation on 32 bit hosts

This fixes the following error:
In file included from qemu/include/trace.h:4:0,
                 from trace/generated-events.c:3:
./trace/generated-tracers.h: In function ‘trace_pvscsi_get_sg_list’:
./trace/generated-tracers.h:4271:9: error: format ‘%lu’ expects argument of
type ‘long unsigned int’, but argument 4 has type ‘size_t’ [-Werror=format]

Signed-off-by: Hervé Poussineau <hpoussin@reactos.org>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
11 years agoTrivial grammar and spelling fixes
Stefan Weil [Sun, 28 Apr 2013 09:49:57 +0000 (11:49 +0200)]
Trivial grammar and spelling fixes

similiar -> similar
recieve -> receive
transfered -> transferred
preperation -> preparation

Most changes are in comments, one modifies a parameter name in a function
prototype.

The spelling fixes were made using codespell.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
Acked-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
11 years agoconfigure: Pick up libseccomp include path
Andreas Färber [Sun, 28 Apr 2013 14:27:26 +0000 (16:27 +0200)]
configure: Pick up libseccomp include path

openSUSE 12.3 has seccomp.h in /usr/include/libseccomp-1.0.1,
so add `pkg-config --cflags libseccomp` output to QEMU_CFLAGS.

Cc: qemu-stable@nongnu.org
Signed-off-by: Andreas Färber <afaerber@suse.de>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
11 years agopc: Implement QEMUMachine::hot_add_cpu hook
Igor Mammedov [Tue, 30 Apr 2013 16:00:53 +0000 (18:00 +0200)]
pc: Implement QEMUMachine::hot_add_cpu hook

Signed-off-by: Igor Mammedov <imammedo@redhat.com>
Reviewed-by: Eduardo Habkost <ehabkost@redhat.com>
Signed-off-by: Andreas Färber <afaerber@suse.de>
11 years agoQMP: Add cpu-add command
Igor Mammedov [Tue, 30 Apr 2013 13:41:25 +0000 (15:41 +0200)]
QMP: Add cpu-add command

Adds "cpu-add id=xxx" QMP command.

cpu-add's "id" argument is a CPU number in a range [0..max-cpus)

Example QMP command:
 -> { "execute": "cpu-add", "arguments": { "id": 2 } }
 <- { "return": {} }

Signed-off-by: Igor Mammedov <imammedo@redhat.com>
Acked-by: Luiz Capitulino <lcapitulino@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Eduardo Habkost <ehabkost@redhat.com>
Signed-off-by: Andreas Färber <afaerber@suse.de>
11 years agoAdd hot_add_cpu hook to QEMUMachine
Igor Mammedov [Tue, 30 Apr 2013 13:41:24 +0000 (15:41 +0200)]
Add hot_add_cpu hook to QEMUMachine

Hook should be set by machines that implement CPU hot-add
via cpu-add QMP command.

Signed-off-by: Igor Mammedov <imammedo@redhat.com>
Reviewed-by: Eduardo Habkost <ehabkost@redhat.com>
Signed-off-by: Andreas Färber <afaerber@suse.de>
11 years agotarget-i386: Move APIC to ICC bus
Igor Mammedov [Mon, 29 Apr 2013 17:03:01 +0000 (19:03 +0200)]
target-i386: Move APIC to ICC bus

It allows APIC to be hotplugged.

 * map APIC's mmio at board level if it is present
 * do not register mmio region for each APIC, since
   only one is used/mapped

Signed-off-by: Igor Mammedov <imammedo@redhat.com>
Signed-off-by: Andreas Färber <afaerber@suse.de>
11 years agotarget-i386: Attach ICC bus to CPU on its creation
Igor Mammedov [Mon, 29 Apr 2013 16:54:13 +0000 (18:54 +0200)]
target-i386: Attach ICC bus to CPU on its creation

X86CPU should have parent bus so it could provide bus for child APIC.

Signed-off-by: Igor Mammedov <imammedo@redhat.com>
Signed-off-by: Andreas Färber <afaerber@suse.de>
11 years agotarget-i386: Introduce ICC bus/device/bridge
Igor Mammedov [Mon, 29 Apr 2013 15:02:50 +0000 (17:02 +0200)]
target-i386: Introduce ICC bus/device/bridge

Provides a hotpluggable bus for APIC and CPU.

* icc-bridge will serve as a parent for icc-bus and provide
  mmio mapping services to child icc-devices.
* icc-device will replace SysBusDevice as a parent of APIC
  and IOAPIC devices.

Signed-off-by: Igor Mammedov <imammedo@redhat.com>
Signed-off-by: Andreas Färber <afaerber@suse.de>
11 years agocpu: Move cpu_write_elfXX_note() functions to CPUState
Jens Freimann [Fri, 19 Apr 2013 14:45:06 +0000 (16:45 +0200)]
cpu: Move cpu_write_elfXX_note() functions to CPUState

Convert cpu_write_elfXX_note() functions to CPUClass methods and pass
CPUState as argument. Update target-i386 accordingly.

Signed-off-by: Jens Freimann <jfrei@linux.vnet.ibm.com>
[AF: Retain stubs as CPUClass' default method implementation; style changes]
Signed-off-by: Andreas Färber <afaerber@suse.de>
11 years agokvmvapic: Make dependency on sysbus.h explicit
Igor Mammedov [Thu, 25 Apr 2013 14:05:30 +0000 (16:05 +0200)]
kvmvapic: Make dependency on sysbus.h explicit

Allows kvmvapic to compile if sysbus.h is removed from apic_internal.h,
from which it is indirectly included.
sysbus.h will be removed from apic_internal.h after converting
APICs to ICCDevice.

Signed-off-by: Igor Mammedov <imammedo@redhat.com>
Signed-off-by: Andreas Färber <afaerber@suse.de>
11 years agotarget-i386: Replace MSI_SPACE_SIZE with APIC_SPACE_SIZE
Igor Mammedov [Thu, 25 Apr 2013 14:05:29 +0000 (16:05 +0200)]
target-i386: Replace MSI_SPACE_SIZE with APIC_SPACE_SIZE

Put APIC_SPACE_SIZE in a public header so that it can be
reused elsewhere later.

Signed-off-by: Igor Mammedov <imammedo@redhat.com>
Signed-off-by: Andreas Färber <afaerber@suse.de>
11 years agotarget-i386: Do not allow to set apic-id once CPU is realized
Igor Mammedov [Fri, 26 Apr 2013 17:51:52 +0000 (19:51 +0200)]
target-i386: Do not allow to set apic-id once CPU is realized

Signed-off-by: Igor Mammedov <imammedo@redhat.com>
Reviewed-by: Eduardo Habkost <ehabkost@redhat.com>
Signed-off-by: Andreas Färber <afaerber@suse.de>
11 years agotarget-i386: Introduce apic-id CPU property
Igor Mammedov [Thu, 25 Apr 2013 14:05:26 +0000 (16:05 +0200)]
target-i386: Introduce apic-id CPU property

The property is used from board level to set APIC ID for CPUs it
creates. Do so in a new pc_new_cpu() helper, to be reused for hot-plug.

Signed-off-by: Igor Mammedov <imammedo@redhat.com>
Reviewed-by: Eduardo Habkost <ehabkost@redhat.com>
Signed-off-by: Andreas Färber <afaerber@suse.de>
11 years agotarget-i386: Introduce feat2prop() for CPU properties
Igor Mammedov [Fri, 26 Apr 2013 16:04:32 +0000 (18:04 +0200)]
target-i386: Introduce feat2prop() for CPU properties

This helper replaces '_' with '-' in a uniform way.
As a side effect, even custom mappings must use '-' now.

Signed-off-by: Igor Mammedov <imammedo@redhat.com>
[AF: Split off; operate on NUL-terminated string rather than '=' delimiter]
Signed-off-by: Andreas Färber <afaerber@suse.de>
11 years agoacpi_piix4: Add infrastructure to send CPU hot-plug GPE to guest
Igor Mammedov [Thu, 25 Apr 2013 14:05:25 +0000 (16:05 +0200)]
acpi_piix4: Add infrastructure to send CPU hot-plug GPE to guest

* introduce processor status bitmask visible to guest at 0xaf00 addr,
  where ACPI asl code expects it
* set bit corresponding to APIC ID in processor status bitmask on
  receiving CPU hot-plug notification
* trigger CPU hot-plug SCI, to notify guest about CPU hot-plug event

Signed-off-by: Igor Mammedov <imammedo@redhat.com>
Signed-off-by: Andreas Färber <afaerber@suse.de>
11 years agocpu: Add helper cpu_exists(), to check if CPU with specified id exists
Igor Mammedov [Thu, 25 Apr 2013 14:05:24 +0000 (16:05 +0200)]
cpu: Add helper cpu_exists(), to check if CPU with specified id exists

Signed-off-by: Igor Mammedov <imammedo@redhat.com>
Signed-off-by: Andreas Färber <afaerber@suse.de>
11 years agocpus: Use qemu_for_each_cpu() in TCG thread
Igor Mammedov [Tue, 23 Apr 2013 08:29:42 +0000 (10:29 +0200)]
cpus: Use qemu_for_each_cpu() in TCG thread

Replaces an open-coded loop and hides unused CPUArchState.

Signed-off-by: Igor Mammedov <imammedo@redhat.com>
Signed-off-by: Andreas Färber <afaerber@suse.de>
11 years agocpu: Add qemu_for_each_cpu()
Michael S. Tsirkin [Wed, 24 Apr 2013 20:58:04 +0000 (22:58 +0200)]
cpu: Add qemu_for_each_cpu()

Wrapper to avoid open-coded loops and to make CPUState iteration
independent of CPUArchState.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Igor Mammedov <imammedo@redhat.com>
Signed-off-by: Andreas Färber <afaerber@suse.de>
11 years agocpu: Introduce get_arch_id() method and override it for X86CPU
Igor Mammedov [Tue, 23 Apr 2013 08:29:41 +0000 (10:29 +0200)]
cpu: Introduce get_arch_id() method and override it for X86CPU

get_arch_id() adds possibility for generic code to get a guest-visible
CPU ID without accessing CPUArchState.
If derived classes don't override it, it will return cpu_index.

Override it on target-i386 in X86CPU to return the APIC ID.

Signed-off-by: Igor Mammedov <imammedo@redhat.com>
Reviewed-by: Eduardo Habkost <ehabkost@redhat.com>
Reviewed-by: liguang <lig.fnst@cn.fujitsu.com>
Acked-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Andreas Färber <afaerber@suse.de>
11 years agopc: Update rtc_cmos on CPU hot-plug
Igor Mammedov [Tue, 23 Apr 2013 08:29:40 +0000 (10:29 +0200)]
pc: Update rtc_cmos on CPU hot-plug

It provides updated currently available CPUs count to BIOS on reboot.

Signed-off-by: Igor Mammedov <imammedo@redhat.com>
Signed-off-by: Andreas Färber <afaerber@suse.de>
11 years agocpu: Introduce CPU hot-plug notifier
Igor Mammedov [Tue, 23 Apr 2013 08:29:39 +0000 (10:29 +0200)]
cpu: Introduce CPU hot-plug notifier

Hot-add CPU event will be distributed to acpi_piix4 and rtc_cmos.

Signed-off-by: Igor Mammedov <imammedo@redhat.com>
Signed-off-by: Andreas Färber <afaerber@suse.de>
11 years agocpu: Resume CPU from DeviceClass::realize() if hot-plugged
Igor Mammedov [Tue, 23 Apr 2013 08:29:38 +0000 (10:29 +0200)]
cpu: Resume CPU from DeviceClass::realize() if hot-plugged

Signed-off-by: Igor Mammedov <imammedo@redhat.com>
Signed-off-by: Andreas Färber <afaerber@suse.de>
11 years agocpu: Introduce cpu_resume(), for single CPU
Igor Mammedov [Tue, 23 Apr 2013 08:29:37 +0000 (10:29 +0200)]
cpu: Introduce cpu_resume(), for single CPU

Also add a stub for it, to make possible to use it in qom/cpu.c,
which is shared with user emulators.

Signed-off-by: Igor Mammedov <imammedo@redhat.com>
Signed-off-by: Andreas Färber <afaerber@suse.de>
11 years agocpu: Call cpu_synchronize_post_init() from DeviceClass::realize()
Igor Mammedov [Tue, 23 Apr 2013 08:29:36 +0000 (10:29 +0200)]
cpu: Call cpu_synchronize_post_init() from DeviceClass::realize()

If hotplugged, synchronize CPU state to KVM.

Signed-off-by: Igor Mammedov <imammedo@redhat.com>
Reviewed-by: Eduardo Habkost <ehabkost@redhat.com>
Signed-off-by: Andreas Färber <afaerber@suse.de>
11 years agocpu: Make kvm-stub.o available outside softmmu
Igor Mammedov [Tue, 23 Apr 2013 08:29:35 +0000 (10:29 +0200)]
cpu: Make kvm-stub.o available outside softmmu

It will provide stubs for *-user targets once softmmu-specific calls
are attempted from common CPU code.

Signed-off-by: Igor Mammedov <imammedo@redhat.com>
Reviewed-by: Eduardo Habkost <ehabkost@redhat.com>
Signed-off-by: Andreas Färber <afaerber@suse.de>
11 years agovirtio-net: count VIRTIO_NET_F_MAC when calculating config_len
Jason Wang [Thu, 25 Apr 2013 07:26:54 +0000 (15:26 +0800)]
virtio-net: count VIRTIO_NET_F_MAC when calculating config_len

Commit 14f9b664 (hw/virtio-net.c: set config size using host features) tries to
calculate config size based on the host features. But it forgets the
VIRTIO_NET_F_MAC were always set for qemu later. This will lead a zero config
len for virtio-net device when both VIRTIO_NET_F_STATUS and VIRTIO_NET_F_MQ were
disabled form command line. Then qemu will crash when user tries to read the
config of virtio-net.

Fix this by counting VIRTIO_NET_F_MAC and make sure the config at least contains
the mac address.

Cc: Jesse Larrew <jlarrew@linux.vnet.ibm.com>
Signed-off-by: Jason Wang <jasowang@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Acked-by: Michael S. Tsirkin <mst@redhat.com>
Message-id: 1366874814-2658-1-git-send-email-jasowang@redhat.com
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agosysemu: drop register_devices from header
Michael S. Tsirkin [Tue, 30 Apr 2013 09:41:50 +0000 (12:41 +0300)]
sysemu: drop register_devices from header

No user in sight.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Reviewed-by: Juan Quintela <quintela@redhat.com>
Message-id: 20130430094149.GA29094@redhat.com
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agolibqtest: only call fclose() on open files
Jesse Larrew [Mon, 29 Apr 2013 15:52:52 +0000 (10:52 -0500)]
libqtest: only call fclose() on open files

libqtest.c can segfault when calling fclose() if the pidfile wasn't
opened successfully. This patch fixes the issue.

Signed-off-by: Jesse Larrew <jlarrew@linux.vnet.ibm.com>
Reviewed-by: Anthony Liguori <aliguori@us.ibm.com>
Message-id: 1367250772-17928-1-git-send-email-jlarrew@linux.vnet.ibm.com
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agoWire up disabled wait a panicked event on s390
Christian Borntraeger [Fri, 26 Apr 2013 03:24:47 +0000 (11:24 +0800)]
Wire up disabled wait a panicked event on s390

On s390 the disabled wait state indicates a state of attention.
For example Linux uses that state after a panic. Lets
put the system into panicked state.

An alternative implementation would be to state
disabled-wait <address> instead of pause in the action field.
(e.g. z/OS, z/VM and other classic OSes use the address of the
disabled wait to indicate an error code).

Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
Message-id: 6cf41156322e27e81a727b69f03728dbc225d5bb.1366945969.git.hutao@cn.fujitsu.com
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agopvpanic: create pvpanic by default for machine 1.5
Hu Tao [Fri, 26 Apr 2013 03:24:46 +0000 (11:24 +0800)]
pvpanic: create pvpanic by default for machine 1.5

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Hu Tao <hutao@cn.fujitsu.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Message-id: f840042f0e1205041f8feaf0d39ca639884f3a00.1366945969.git.hutao@cn.fujitsu.com
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agopvpanic: add document of pvpanic
Hu Tao [Fri, 26 Apr 2013 03:24:45 +0000 (11:24 +0800)]
pvpanic: add document of pvpanic

Signed-off-by: Hu Tao <hutao@cn.fujitsu.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Message-id: a5db4ce406647e8f4663b639eae62d880531df8b.1366945969.git.hutao@cn.fujitsu.com
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agopvpanic: pass configurable ioport to seabios
Hu Tao [Fri, 26 Apr 2013 03:24:44 +0000 (11:24 +0800)]
pvpanic: pass configurable ioport to seabios

This lets seabios patch the corresponding SSDT entry.

Also add fw_cfg object to /machine/fw_cfg so we can reference
it elsewhere.

Signed-off-by: Hu Tao <hutao@cn.fujitsu.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Message-id: 60c65d95fe2b23b12bea67099126566010a11a1a.1366945969.git.hutao@cn.fujitsu.com
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agofw_cfg: add required header files
Hu Tao [Fri, 26 Apr 2013 03:24:43 +0000 (11:24 +0800)]
fw_cfg: add required header files

If fw_cfg.h is included alone, gcc gives error messages like these:

  error: unknown type name ‘uint32_t’
  error: unknown type name ‘size_t’
  error: unknown type name ‘hwaddr’
  ...

Signed-off-by: Hu Tao <hutao@cn.fujitsu.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Message-id: d63f8bcdbfbec8135b1b57f9247c513a3e25762c.1366945969.git.hutao@cn.fujitsu.com
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agointroduce a new qom device to deal with panicked event
Hu Tao [Fri, 26 Apr 2013 03:24:42 +0000 (11:24 +0800)]
introduce a new qom device to deal with panicked event

pvpanic device is used to send guest panic event from guest to qemu.

When guest panic happens, pvpanic device driver will write a event
number to IO port 0x505(which is the IO port occupied by pvpanic device,
by default). On receiving the event, pvpanic device will pause guest
cpu(s), and send a qmp event QEVENT_GUEST_PANICKED.

Signed-off-by: Wen Congyang <wency@cn.fujitsu.com>
Signed-off-by: Hu Tao <hutao@cn.fujitsu.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Message-id: b66077a40235b3531632a05a6ff373850afc7d2e.1366945969.git.hutao@cn.fujitsu.com
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agoadd a new qevent: QEVENT_GUEST_PANICKED
Hu Tao [Fri, 26 Apr 2013 03:24:41 +0000 (11:24 +0800)]
add a new qevent: QEVENT_GUEST_PANICKED

This event will be emited when qemu detects guest panic.

Signed-off-by: Wen Congyang <wency@cn.fujitsu.com>
Signed-off-by: Hu Tao <hutao@cn.fujitsu.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Message-id: cf0bc45ecf9ecd3699bc72dc39f8cbab8ed79d8c.1366945969.git.hutao@cn.fujitsu.com
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agoadd a new runstate: RUN_STATE_GUEST_PANICKED
Hu Tao [Fri, 26 Apr 2013 03:24:40 +0000 (11:24 +0800)]
add a new runstate: RUN_STATE_GUEST_PANICKED

The guest will be in this state when it is panicked.

Signed-off-by: Wen Congyang <wency@cn.fujitsu.com>
Signed-off-by: Hu Tao <hutao@cn.fujitsu.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Message-id: 0255f263ffdc2a3716f73e89098b96fd79a235b3.1366945969.git.hutao@cn.fujitsu.com
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agoqdev: Report errors collected during device realization
Jan Kiszka [Mon, 29 Apr 2013 12:35:08 +0000 (14:35 +0200)]
qdev: Report errors collected during device realization

Better than just releasing the error object silently.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Reviewed-by: Andreas Färber <afaerber@suse.de>
Message-id: 517E68FC.6030400@siemens.com
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agorules.mk: Fix build breakage
Dunrong Huang [Mon, 29 Apr 2013 14:52:12 +0000 (22:52 +0800)]
rules.mk: Fix build breakage

The following error occurs when building dtc module:

        CHK version_gen.h
         CC libfdt/fdt.o
cc1: error: dtc: No such file or directory [-Werror]
cc1: all warnings being treated as errors
make[1]: *** [libfdt/fdt.o] Error 1
make: *** [subdir-dtc] Error 2

In rules.mak, "-I$(<D) -I$(@D)" was expanded to "-Idtc -I." when
building submodule dct. Due to the using of "-Wmissing-include-dirs,
a warning would be rarsed. To avoid it, add "-I$(<D) -I$(@D)" to
QEMU_INCLUDES instead of QEMU_CFLAGS so that QEMU_CFLAGS does not
contain the "-Idtc".

Cc: Peter Crosthwaite <peter.crosthwaite@xilinx.com>
Cc: Blue Swirl <blauwirbel@gmail.com>
Cc: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Dunrong Huang <riegamaths@gmail.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Message-id: 1367247132-19622-1-git-send-email-riegamaths@gmail.com
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agoQOM: Fail casts for unknown types
Alexander Graf [Tue, 30 Apr 2013 13:02:16 +0000 (15:02 +0200)]
QOM: Fail casts for unknown types

When we try to cast an object to an unknown type, fail the cast. Today
we would simply run into an assert().

This fixes a bug on qemu-system-s390x for me that gets triggered by the
audio code looking for PCI and ISA buses.

Signed-off-by: Alexander Graf <agraf@suse.de>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Message-id: 1367326936-28539-1-git-send-email-agraf@suse.de
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agopc_piix: remove undesired change in pc_init1
Paolo Bonzini [Tue, 30 Apr 2013 14:00:32 +0000 (16:00 +0200)]
pc_piix: remove undesired change in pc_init1

Introduced when applying commit f81222b (audio: look for the ISA and
PCI buses, 2013-04-18).

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Message-id: 1367330432-14417-1-git-send-email-pbonzini@redhat.com
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agoaudio: enable PCI audio cards for all PCI-enabled targets
Paolo Bonzini [Thu, 18 Apr 2013 16:44:04 +0000 (18:44 +0200)]
audio: enable PCI audio cards for all PCI-enabled targets

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Message-id: 1366303444-24620-9-git-send-email-pbonzini@redhat.com
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agoaudio: look for the ISA and PCI buses
Paolo Bonzini [Thu, 18 Apr 2013 16:44:03 +0000 (18:44 +0200)]
audio: look for the ISA and PCI buses

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Message-id: 1366303444-24620-8-git-send-email-pbonzini@redhat.com
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agoqom: do not return root for empty path
Paolo Bonzini [Thu, 18 Apr 2013 16:44:02 +0000 (18:44 +0200)]
qom: do not return root for empty path

An empty path will return the sole object of that type in the
QOM tree.  This is different from "/", which returns the root.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Message-id: 1366303444-24620-7-git-send-email-pbonzini@redhat.com
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agoaudio: replace audio card configuration with default-configs
Paolo Bonzini [Thu, 18 Apr 2013 16:44:01 +0000 (18:44 +0200)]
audio: replace audio card configuration with default-configs

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Message-id: 1366303444-24620-6-git-send-email-pbonzini@redhat.com
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agoaudio: remove CONFIG_* symbols
Paolo Bonzini [Thu, 18 Apr 2013 16:44:00 +0000 (18:44 +0200)]
audio: remove CONFIG_* symbols

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Message-id: 1366303444-24620-5-git-send-email-pbonzini@redhat.com
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agoaudio: remove HAS_AUDIO
Paolo Bonzini [Thu, 18 Apr 2013 16:43:59 +0000 (18:43 +0200)]
audio: remove HAS_AUDIO

Several targets can have wavcapture/-soundhw support via PCI cards.
HAS_AUDIO is a useless limitation, remove it.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Message-id: 1366303444-24620-4-git-send-email-pbonzini@redhat.com
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agoaudio: remove the need for audio card CONFIG_* symbols
Paolo Bonzini [Thu, 18 Apr 2013 16:43:58 +0000 (18:43 +0200)]
audio: remove the need for audio card CONFIG_* symbols

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Message-id: 1366303444-24620-3-git-send-email-pbonzini@redhat.com
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agoadlib: qdev-ify
Paolo Bonzini [Thu, 18 Apr 2013 16:43:57 +0000 (18:43 +0200)]
adlib: qdev-ify

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Message-id: 1366303444-24620-2-git-send-email-pbonzini@redhat.com
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agodoc: document the Pseudo-encoding of LED state
Lei Li [Thu, 25 Apr 2013 05:29:12 +0000 (13:29 +0800)]
doc: document the Pseudo-encoding of LED state

Signed-off-by: Lei Li <lilei@linux.vnet.ibm.com>
Reviewed-by: Anthony Liguori <aliguori@us.ibm.com>
Message-id: 1366867752-11578-5-git-send-email-lilei@linux.vnet.ibm.com
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agovnc: Adjust lock state sync logic with VNC_FEATURE_LED_STATE
Lei Li [Thu, 25 Apr 2013 05:29:11 +0000 (13:29 +0800)]
vnc: Adjust lock state sync logic with VNC_FEATURE_LED_STATE

Signed-off-by: Lei Li <lilei@linux.vnet.ibm.com>
Reviewed-by: Anthony Liguori <aliguori@us.ibm.com>
Message-id: 1366867752-11578-4-git-send-email-lilei@linux.vnet.ibm.com
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agovnc: Support for LED state extension
Lei Li [Thu, 25 Apr 2013 05:29:10 +0000 (13:29 +0800)]
vnc: Support for LED state extension

Signed-off-by: Lei Li <lilei@linux.vnet.ibm.com>
Reviewed-by: Anthony Liguori <aliguori@us.ibm.com>
Message-id: 1366867752-11578-3-git-send-email-lilei@linux.vnet.ibm.com
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agovnc: Add SCROLL lock key to kbd_leds
Lei Li [Thu, 25 Apr 2013 05:29:09 +0000 (13:29 +0800)]
vnc: Add SCROLL lock key to kbd_leds

Signed-off-by: Lei Li <lilei@linux.vnet.ibm.com>
Reviewed-by: Anthony Liguori <aliguori@us.ibm.com>
Message-id: 1366867752-11578-2-git-send-email-lilei@linux.vnet.ibm.com
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agolibqos: Convert fw_cfg values to host endianness
Andreas Färber [Sun, 28 Apr 2013 16:45:47 +0000 (18:45 +0200)]
libqos: Convert fw_cfg values to host endianness

The fw_cfg ABI is Little Endian, so byte-swap the generically read
byte array to host endianness.

This unbreaks the fw_cfg tests on ppc.

Signed-off-by: Andreas Färber <afaerber@suse.de>
Signed-off-by: Andreas Färber <afaerber@suse.de>
Message-id: 1367167547-19931-1-git-send-email-afaerber@suse.de
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agowdt_ib700: QOM'ify
Andreas Färber [Sat, 27 Apr 2013 20:18:55 +0000 (22:18 +0200)]
wdt_ib700: QOM'ify

Introduce type constant and cast macro to obsolete DO_UPCAST().

Prepares for ISA realizefn.

Signed-off-by: Andreas Färber <afaerber@suse.de>
Signed-off-by: Andreas Färber <afaerber@suse.de>
Message-id: 1367093935-29091-21-git-send-email-afaerber@suse.de
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agovmport: QOM'ify
Andreas Färber [Sat, 27 Apr 2013 20:18:54 +0000 (22:18 +0200)]
vmport: QOM'ify

Introduce type constant and cast macro to obsolete DO_UPCAST().
Prepares for ISA realizefn.

Drop reserved underscore from struct name while at it.

Signed-off-by: Andreas Färber <afaerber@suse.de>
Signed-off-by: Andreas Färber <afaerber@suse.de>
Message-id: 1367093935-29091-20-git-send-email-afaerber@suse.de
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agovmmouse: QOM'ify
Andreas Färber [Sat, 27 Apr 2013 20:18:53 +0000 (22:18 +0200)]
vmmouse: QOM'ify

Introduce type constant and cast macro to obsolete DO_UPCAST() and
container_of(). Prepares for ISA realizefn.

Remove reserved underscore from struct name while at it.

Signed-off-by: Andreas Färber <afaerber@suse.de>
Signed-off-by: Andreas Färber <afaerber@suse.de>
Message-id: 1367093935-29091-19-git-send-email-afaerber@suse.de
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agovga-isa: QOM'ify ISA VGA
Andreas Färber [Sat, 27 Apr 2013 20:18:52 +0000 (22:18 +0200)]
vga-isa: QOM'ify ISA VGA

Introduce type constant and cast macro to obsolete DO_UPCAST() and
container_of(). Prepares for ISA realizefn.

Unify function naming scheme while at it.

Signed-off-by: Andreas Färber <afaerber@suse.de>
Signed-off-by: Andreas Färber <afaerber@suse.de>
Message-id: 1367093935-29091-18-git-send-email-afaerber@suse.de
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agosga: QOM'ify
Andreas Färber [Sat, 27 Apr 2013 20:18:51 +0000 (22:18 +0200)]
sga: QOM'ify

Introduce type constant and cast macro.

Prepares for ISA realizefn.

Signed-off-by: Andreas Färber <afaerber@suse.de>
Signed-off-by: Andreas Färber <afaerber@suse.de>
Message-id: 1367093935-29091-17-git-send-email-afaerber@suse.de
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agoserial: QOM'ify ISA serial
Andreas Färber [Sat, 27 Apr 2013 20:18:50 +0000 (22:18 +0200)]
serial: QOM'ify ISA serial

Introduce type constant and cast macro to obsolete DO_UPCAST().

Prepares for ISA realizefn.

Signed-off-by: Andreas Färber <afaerber@suse.de>
Signed-off-by: Andreas Färber <afaerber@suse.de>
Message-id: 1367093935-29091-16-git-send-email-afaerber@suse.de
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agosb16: QOM'ify
Andreas Färber [Sat, 27 Apr 2013 20:18:49 +0000 (22:18 +0200)]
sb16: QOM'ify

Introduce type constant and cast macro to obsolete DO_UPCAST().

Prepares for ISA realizefn.

Signed-off-by: Andreas Färber <afaerber@suse.de>
Signed-off-by: Andreas Färber <afaerber@suse.de>
Message-id: 1367093935-29091-15-git-send-email-afaerber@suse.de
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agopcspk: QOM'ify
Andreas Färber [Sat, 27 Apr 2013 20:18:48 +0000 (22:18 +0200)]
pcspk: QOM'ify

Introduce type constant and cast macro to obsolete DO_UPCAST().

Prepares for ISA realizefn.

Signed-off-by: Andreas Färber <afaerber@suse.de>
Signed-off-by: Andreas Färber <afaerber@suse.de>
Message-id: 1367093935-29091-14-git-send-email-afaerber@suse.de
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agopckbd: QOM'ify
Andreas Färber [Sat, 27 Apr 2013 20:18:47 +0000 (22:18 +0200)]
pckbd: QOM'ify

Introduce type constant and cast macro to obsolete DO_UPCAST().

Prepares for ISA realizefn.

Signed-off-by: Andreas Färber <afaerber@suse.de>
Signed-off-by: Andreas Färber <afaerber@suse.de>
Message-id: 1367093935-29091-13-git-send-email-afaerber@suse.de
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agopc: QOM'ify port 92
Andreas Färber [Sat, 27 Apr 2013 20:18:46 +0000 (22:18 +0200)]
pc: QOM'ify port 92

Introduce type constant and cast macro to obsolete DO_UPCAST().

Prepares for ISA realizefn.

Signed-off-by: Andreas Färber <afaerber@suse.de>
Signed-off-by: Andreas Färber <afaerber@suse.de>
Message-id: 1367093935-29091-12-git-send-email-afaerber@suse.de
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agoparallel: QOM'ify
Andreas Färber [Sat, 27 Apr 2013 20:18:45 +0000 (22:18 +0200)]
parallel: QOM'ify

Introduce type constant and cast macro to obsolete DO_UPCAST().

Prepares for ISA realizefn.

Signed-off-by: Andreas Färber <afaerber@suse.de>
Signed-off-by: Andreas Färber <afaerber@suse.de>
Message-id: 1367093935-29091-11-git-send-email-afaerber@suse.de
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agone2000-isa: QOM'ify
Andreas Färber [Sat, 27 Apr 2013 20:18:44 +0000 (22:18 +0200)]
ne2000-isa: QOM'ify

Introduce type constant and cast macro to obsolete DO_UPCAST().

Prepares for ISA realizefn.

Signed-off-by: Andreas Färber <afaerber@suse.de>
Signed-off-by: Andreas Färber <afaerber@suse.de>
Message-id: 1367093935-29091-10-git-send-email-afaerber@suse.de
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agomc146818rtc: QOM'ify
Andreas Färber [Sat, 27 Apr 2013 20:18:43 +0000 (22:18 +0200)]
mc146818rtc: QOM'ify

Introduce type constant and cast macro to obsolete DO_UPCAST().

Prepares for ISA realizefn.

Signed-off-by: Andreas Färber <afaerber@suse.de>
Reviewed-by: Igor Mammedov <imammedo@redhat.com>
Signed-off-by: Andreas Färber <afaerber@suse.de>
Message-id: 1367093935-29091-9-git-send-email-afaerber@suse.de
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agom48t59: QOM'ify ISA M48T59 NVRAM
Andreas Färber [Sat, 27 Apr 2013 20:18:42 +0000 (22:18 +0200)]
m48t59: QOM'ify ISA M48T59 NVRAM

Introduce type constant and cast macro to obsolete DO_UPCAST() and
container_of().

Prepares for ISA realizefn.

Signed-off-by: Andreas Färber <afaerber@suse.de>
Signed-off-by: Andreas Färber <afaerber@suse.de>
Message-id: 1367093935-29091-8-git-send-email-afaerber@suse.de
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agoide: QOM'ify ISA IDE
Andreas Färber [Sat, 27 Apr 2013 20:18:41 +0000 (22:18 +0200)]
ide: QOM'ify ISA IDE

Introduce type constant and cast macro to obsolete DO_UPCAST().
Add missing braces.

Prepares for ISA realizefn.

Signed-off-by: Andreas Färber <afaerber@suse.de>
Signed-off-by: Andreas Färber <afaerber@suse.de>
Message-id: 1367093935-29091-7-git-send-email-afaerber@suse.de
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agoi8259: QOM cleanups
Andreas Färber [Sat, 27 Apr 2013 20:18:40 +0000 (22:18 +0200)]
i8259: QOM cleanups

Eliminate DO_UPCAST() for PICCommonState. Prepares for ISA realizefn.

Also give the i8259_common type registration functions unique names
while at it.

Signed-off-by: Andreas Färber <afaerber@suse.de>
Signed-off-by: Andreas Färber <afaerber@suse.de>
Message-id: 1367093935-29091-6-git-send-email-afaerber@suse.de
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agoi82374: QOM'ify
Andreas Färber [Sat, 27 Apr 2013 20:18:39 +0000 (22:18 +0200)]
i82374: QOM'ify

Introduce type constant and cast macro to obsolete DO_UPCAST().

Prepares for ISA realizefn.

Signed-off-by: Andreas Färber <afaerber@suse.de>
Signed-off-by: Andreas Färber <afaerber@suse.de>
Message-id: 1367093935-29091-5-git-send-email-afaerber@suse.de
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agofdc: QOM'ify ISA floppy controller
Andreas Färber [Sat, 27 Apr 2013 20:18:38 +0000 (22:18 +0200)]
fdc: QOM'ify ISA floppy controller

Introduce type constant and cast macro to obsolete DO_UPCAST().
Reuse type constant for PC machine compatibility settings.

Prepares for ISA realizefn.

Signed-off-by: Andreas Färber <afaerber@suse.de>
Signed-off-by: Andreas Färber <afaerber@suse.de>
Message-id: 1367093935-29091-4-git-send-email-afaerber@suse.de
Cc: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agocirrus_vga: QOM'ify ISA Cirrus VGA
Andreas Färber [Sat, 27 Apr 2013 20:18:37 +0000 (22:18 +0200)]
cirrus_vga: QOM'ify ISA Cirrus VGA

Introduce type constant and cast macro to obsolete DO_UPCAST().

Prepares for ISA realizefn.

Signed-off-by: Andreas Färber <afaerber@suse.de>
Signed-off-by: Andreas Färber <afaerber@suse.de>
Message-id: 1367093935-29091-3-git-send-email-afaerber@suse.de
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agoapplesmc: QOM'ify
Andreas Färber [Sat, 27 Apr 2013 20:18:36 +0000 (22:18 +0200)]
applesmc: QOM'ify

Add a typedef for the state struct and rename from Status to State.
Add type constant and cast macro to obsolete DO_UPCAST().

Prepares for ISA realizefn.

Signed-off-by: Andreas Färber <afaerber@suse.de>
Signed-off-by: Andreas Färber <afaerber@suse.de>
Message-id: 1367093935-29091-2-git-send-email-afaerber@suse.de
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agovirtio-net: unbreak the minix guest
Jason Wang [Thu, 25 Apr 2013 07:24:23 +0000 (15:24 +0800)]
virtio-net: unbreak the minix guest

Multiqueue patchset conditionally add control vq only when guest negotiate the
feature. Though the spec is not clear on this but it breaks the minix guest
since it will identify the ctrl vq even if it does not support it. Though this
behavior seems a violation on the spec "If the VIRTIO_NET_F_CTRL_VQ feature bit
is negotiated, identify the control virtqueue.", to keep the backward
compatibility, always add the ctrl vq at end of the queues.

Reported-by: Aurelien Jarno <aurelien@aurel32.net>
Acked-by: Michael S. Tsirkin <mst@redhat.com>
Tested-by: Aurelien Jarno <aurelien@aurel32.net>
Signed-off-by: Jason Wang <jasowang@redhat.com>
Message-id: 1366874663-2566-1-git-send-email-jasowang@redhat.com
Cc: Aurelien Jarno <aurelien@aurel32.net>
Signed-off-by: Jason Wang <jasowang@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agoMerge remote-tracking branch 'bonzini/migration-writev' into staging
Anthony Liguori [Mon, 29 Apr 2013 13:26:47 +0000 (08:26 -0500)]
Merge remote-tracking branch 'bonzini/migration-writev' into staging

# By Paolo Bonzini
# Via Paolo Bonzini
* bonzini/migration-writev:
  win32: add readv/writev emulation
  win32: generate console executable again
  win32: move Makefile dependencies on version-obj-y to rules.mak
  win32: add generic RC rules to rules.mak

Message-id: 1367230284-24612-1-git-send-email-pbonzini@redhat.com
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agoMerge remote-tracking branch 'alon/libcacard_ccid.2' into staging
Anthony Liguori [Mon, 29 Apr 2013 13:26:39 +0000 (08:26 -0500)]
Merge remote-tracking branch 'alon/libcacard_ccid.2' into staging

# By Cole Robinson
# Via Alon Levy
* alon/libcacard_ccid.2:
  ccid: Fix crash when backend isn't specified

Message-id: 20130426234357.GA12457@garlic.tami
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agowin32: add readv/writev emulation
Paolo Bonzini [Sun, 21 Apr 2013 10:01:06 +0000 (12:01 +0200)]
win32: add readv/writev emulation

Commit e9d8fbf (qemu-file: do not use stdio for qemu_fdopen, 2013-03-27)
introduced a usage of writev, which mingw32 does not have.  Even though
qemu_fdopen itself is not used on mingw32, the future-proof solution is
to add an implementation of it.  This is simple and similar to how we
emulate sendmsg/recvmsg in util/iov.c.

Some files include osdep.h without qemu-common.h, so move the definition
of iovec to osdep.h too, and include osdep.h from qemu-common.h
unconditionally (protection against including files when NEED_CPU_H is
defined is not needed since the removal of AREG0).

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
11 years agosparc64: use direct interrupt mapping for PCI devices
Artyom Tarasenko [Sat, 27 Apr 2013 05:55:13 +0000 (07:55 +0200)]
sparc64: use direct interrupt mapping for PCI devices

Every PCI Slot in PBM has 4 directly mapped IRQ lines.
Use the IRQ routing schema 0bssnn (Bus, Slot, interrupt Number)
described in Section 19.3.3 of UltraSPARC™-IIi User's Manual.

Please note that this patch requires the OpenBIOS counterpart patch.

Signed-off-by: Artyom Tarasenko <atar4qemu@gmail.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
11 years agosparc64: fix loosing interrupts
Artyom Tarasenko [Sat, 27 Apr 2013 05:55:12 +0000 (07:55 +0200)]
sparc64: fix loosing interrupts

- clear interrupts only on writing to the interrupt clear registers
- don't overwrite a currently active interrupt request
- use the correct addresses for the interrupt clear registers
  (section 19.3.3.3 of the UltraSPARC™-IIi User’s Manual)

Signed-off-by: Artyom Tarasenko <atar4qemu@gmail.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
11 years agosparc64: allow 64 IRQ lines
Artyom Tarasenko [Sat, 27 Apr 2013 05:55:11 +0000 (07:55 +0200)]
sparc64: allow 64 IRQ lines

According to UltraSPARC™-IIi User’s Manual, PBM has 64 IRQ lines.

Signed-off-by: Artyom Tarasenko <atar4qemu@gmail.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
11 years agotcg-arm: Remove long jump from tcg_out_goto_label
Richard Henderson [Tue, 23 Apr 2013 20:07:40 +0000 (13:07 -0700)]
tcg-arm: Remove long jump from tcg_out_goto_label

Branches within a TB will always be within 16MB.

Signed-off-by: Richard Henderson <rth@twiddle.net>
11 years agotcg-arm: Convert to CONFIG_QEMU_LDST_OPTIMIZATION
Richard Henderson [Wed, 13 Mar 2013 22:24:33 +0000 (15:24 -0700)]
tcg-arm: Convert to CONFIG_QEMU_LDST_OPTIMIZATION

Move the slow path out of line, as the TODO's mention.
This allows the fast path to be unconditional, which can
speed up the fast path as well, depending on the core.

Signed-off-by: Richard Henderson <rth@twiddle.net>
11 years agotcg-arm: Use movi32 + blx for calls on v7
Richard Henderson [Wed, 13 Mar 2013 20:40:43 +0000 (13:40 -0700)]
tcg-arm: Use movi32 + blx for calls on v7

Work better with branch predition when we have movw+movt,
as the size of the code is the same.  Perhaps re-evaluate
when we have a proper constant pool.

Reviewed-by: Aurelien Jarno <aurelien@aurel32.net>
Signed-off-by: Richard Henderson <rth@twiddle.net>