Commit graph

21128 commits

Author SHA1 Message Date
Paolo Bonzini d195325b05 qapi: fix error propagation
Don't overwrite / leak previously set errors.
Make traversal cope with missing mandatory sub-structs.
Don't try to end a container that could not be started.

v1->v2:
- unchanged

v2->v3:
- instead of examining, assert that we never overwrite errors with
  error_set()
- allow visitors to set a NULL struct pointer successfully, so traversal
  of incomplete objects can continue
- check for a NULL "obj" before accessing "(*obj)->has_XXX" (this is not a
  typo, "obj != NULL" implies "*obj != NULL" here)
- fix start_struct / end_struct balance for unions as well

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
2012-07-23 11:55:17 +01:00
Stefan Hajnoczi 837c36e787 MAINTAINERS: Replace net maintainer Mark McLoughlin with Stefan Hajnoczi
The net subsystem has lacked an active maintainer since 2009.  I have
built and tested a net-next tree to get the ball rolling again.

Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
2012-07-23 11:55:17 +01:00
Stefan Weil 43ffe61f9c Fix some more Qemus in documentation and help text
Hopefully they will be eliminated one day.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
2012-07-21 10:54:40 +01:00
Stefan Weil c578861451 qdev: Fix Open Firmware comment
Commit 0d936928ef removed code,
but left the related comment at a location where it no longer
belongs to.

The patch moves the comment to the correct callback and improves the text.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
2012-07-21 10:54:40 +01:00
Peter Maydell ac873f1ed5 cpus.c: Make all_cpu_threads_idle() static
Commit 946fb27c1 moved all the uses of all_cpu_threads_idle()
into cpus.c. This means we can mark the function 'static'
(again), if we shuffle it a bit earlier in the source file.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
2012-07-21 10:54:40 +01:00
Stefan Weil 7c7bb0223e Use macro QEMU_PACKED for new packed structures
Since commit 541dc0d47f,
some new packed structures were added without using QEMU_PACKED.

QEMU_PACKED is needed for compilations with MinGW.
For other platforms nothing changes.

The code was fixed using this command:

    git grep -la '__attribute__ ((packed))'|xargs perl -pi -e 's/__attribute__ \(\(packed\)\)/QEMU_PACKED/'

Signed-off-by: Stefan Weil <sw@weilnetz.de>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
2012-07-21 10:54:40 +01:00
Mao, Junjie 434acb817b Recognize PCID feature
This patch makes Qemu recognize the PCID feature specified from configuration or command line options.

Signed-off-by: Junjie Mao <junjie.mao@intel.com>
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
2012-07-21 10:54:40 +01:00
Alexey Kardashevskiy c4889f5423 powerpc pci: fixed packing of ranges[]
By default mingw-gcc is trying to pack structures the way to
preserve binary compatibility with MS Visual C what leads to
incorrect and unexpected padding in the PCI bus ranges property of
the sPAPR PHB.

The patch replaces __attribute__((packed)) with more strict QEMU_PACKED
which actually is __attribute__((gcc_struct, packed)) on Windows.

Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
Tested-by: Stefan Weil <sw@weilnetz.de>
Reviewed-by: Stefan Weil <sw@weilnetz.de>
Acked-by: Alexander Graf <agraf@suse.de>
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
2012-07-21 10:54:40 +01:00
Mitsyanko Igor ffbbe7d02f exynos4210: add Exynos4210 i2c implementation
Create 9 exynos4210 i2c interfaces.

Signed-off-by: Igor Mitsyanko <i.mitsyanko@samsung.com>
Reviewed-by: Andreas Färber <afaerber@suse.de>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2012-07-20 14:30:09 +01:00
Oleg Ogurtsov 4688870d87 hw/exynos4210_rtc.c: remove unnecessary code
Signed-off-by: Oleg Ogurtsov <o.ogurtsov@samsung.com>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2012-07-20 14:18:24 +01:00
Oleg Ogurtsov 64de1ecfe7 hw/exynos4210_rtc.c: Fix calculating for value of year
Signed-off-by: Oleg Ogurtsov <o.ogurtsov@samsung.com>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2012-07-20 14:16:14 +01:00
Peter Maydell 25d7169982 hw/vexpress.c: Allow >4GB of RAM for Cortex-A15 daughterboard
Now that we have LPAE support and can handle passing 64 bit
RAM sizes to Linux via the device tree, we can lift the
restriction in the Versatile Express A15 daughterboard model
on not having more than 2GB of RAM. Allow up to 30GB, which
is the maximum that can fit in the address map before running
into the (unmodelled) aliases of the first 2GB.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2012-07-20 13:34:50 +01:00
Peter Maydell 9bfa659e6b hw/arm_boot.c: Support DTBs which use 64 bit addresses
Support the case where the device tree blob specifies that
#address-cells and #size-cells are greater than 1. (This
is needed for device trees which can handle 64 bit physical
addresses and thus total RAM sizes over 4GB.)

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Peter A. G. Crosthwaite <peter.crosthwaite@petalogix.com>
2012-07-20 13:34:50 +01:00
Peter Maydell f0aa713f65 device_tree: Add support for reading device tree properties
Add support for reading device tree properties (both generic
and single-cell ones) to QEMU's convenience wrapper layer.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Peter A. G. Crosthwaite <peter.crosthwaite@petalogix.com>
2012-07-20 13:34:50 +01:00
Peter Maydell 3871481c0a hw/arm_boot.c: Check for RAM sizes exceeding ATAGS capacity
The legacy ATAGS format for passing information to the kernel only
allows RAM sizes which fit in 32 bits; enforce this restriction
rather than silently doing something weird.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Peter A. G. Crosthwaite <peter.crosthwaite@petalogix.com>
2012-07-20 13:34:50 +01:00
Peter Maydell 0b94438480 hw/arm_boot.c: Consistently use ram_size from arm_boot_info struct
Clean up the mix of getting the RAM size from the global ram_size
and from the ram_size field in the arm_boot_info structure, so
that we always use the structure field.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Peter A. G. Crosthwaite <peter.crosthwaite@petalogix.com>
2012-07-20 13:34:50 +01:00
Peter Maydell de841dea59 hw/arm_boot.c: Make ram_size a uint64_t
Make the RAM size in arm_boot_info a uint64_t so it can express
the larger RAM sizes that may be seen in LPAE systems.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Peter A. G. Crosthwaite <peter.crosthwaite@petalogix.com>
2012-07-20 13:34:49 +01:00
Peter Maydell 0d4abda8f7 hw/pl011.c: Avoid crash on read when no chr backend present
Add a missing guard that meant we would segfault if the guest read
UARTDR on a PL011 serial device which had no chr backend connected.
(This didn't happen for Linux guests because Linux reads the flags
register and doesn't try to read the UART if it's empty.)

Reported-by: Christian Müller <christian.mueller@heig-vd.ch>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2012-07-20 13:34:49 +01:00
Juan Quintela 6d2fe810ed ram: save_live_setup() we don't need to synchronize the dirty bitmap.
1st: we were synchonizing the dirty bitmap before calling
      memory_global_dirty_log_start().

2nd: We are marking all pages as dirty anywhere, no reason to go
     through all the bitmap to "mark" dirty same pages twice.

So, call removed.

Signed-off-by: Juan Quintela <quintela@redhat.com>
2012-07-20 08:19:27 +02:00
Juan Quintela 00d94f3f76 ram: iterate phase
We only need to synchronize the bitmap when the number of dirty pages is low.
Not every time that we call the function.

Signed-off-by: Juan Quintela <quintela@redhat.com>
2012-07-20 08:19:27 +02:00
Juan Quintela b81e712d25 ram: save_live_complete() only do one loop
We were doing the same loop that stage2, and a new one for stage3.  We
only need the one for stage3.

Signed-off-by: Juan Quintela <quintela@redhat.com>
2012-07-20 08:19:27 +02:00
Juan Quintela 5910d1e6cb ram: save_live_setup() don't need to sent pages
We should send pages on interate phase, not in setup one.  This was a
"bug".  Just removing the loop does what we want.  Tested that it
works with current ram_load().

Signed-off-by: Juan Quintela <quintela@redhat.com>
2012-07-20 08:19:27 +02:00
Juan Quintela 16310a3cca savevm: split save_live into stage2 and stage3
We split it into 2 functions, foo_live_iterate, and foo_live_complete.
At this point, we only remove the bits that are for the other stage,
functionally this is equivalent to previous code.

Signed-off-by: Juan Quintela <quintela@redhat.com>
2012-07-20 08:19:27 +02:00
Juan Quintela d1315aac6e savevm: split save_live_setup from save_live_state
This patch splits stage 1 to its own function for both save_live
users, ram and block.  It is just a copy of the function, removing the
parts of the other stages.  Optimizations would came later.

Signed-off-by: Juan Quintela <quintela@redhat.com>
2012-07-20 08:19:27 +02:00
Juan Quintela 6bd6878133 savevm: introduce is_active method
Enable the creation of a method to tell migration if that section is
active and should be migrate.  We use it for blk-migration, that is
normally not active.  We don't create the method for RAM, as setups
without RAM are very strange O:-)

Signed-off-by: Juan Quintela <quintela@redhat.com>
2012-07-20 08:19:27 +02:00
Juan Quintela 9b5bfab05f savevm: Refactor cancel operation in its own operation
Intead of abusing stage with value -1.

Signed-off-by: Juan Quintela <quintela@redhat.com>
2012-07-20 08:19:27 +02:00
Juan Quintela 226aa6a9b1 savevm: remove SaveLiveStateHandler
It was used only once, just unfold.

Signed-off-by: Juan Quintela <quintela@redhat.com>
2012-07-20 08:19:27 +02:00
Juan Quintela 8625368515 savevm: remove SaveSetParamsHandler
It was used only once, just unfold.

Signed-off-by: Juan Quintela <quintela@redhat.com>
2012-07-20 08:19:27 +02:00
Juan Quintela 7908c78d3e savevm: Live migration handlers register the struct directly
Notice that the live migration users never unregister, so no problem
about freeing the ops structure.

Signed-off-by: Juan Quintela <quintela@redhat.com>
2012-07-20 08:19:27 +02:00
Juan Quintela 22ea40f4ff savevm: Use a struct to pass all handlers
This would make easier to add more operations in the next patches.

Signed-off-by: Juan Quintela <quintela@redhat.com>
2012-07-20 08:19:27 +02:00
Anthony Liguori 61dc008f35 Revert "audio: Make PC speaker audio card available by default"
This reverts commit 504972922d which broke the
build for ARM.

I don't think this change is necessary.  If I'm wrong, please recommit this
changeset with an appropriate fix for ARM.

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2012-07-19 18:25:52 -05:00
Jan Kiszka 504972922d audio: Make PC speaker audio card available by default
[ The following text is in the "ISO-8859-1" character set. ]
    [ Your display is set for the "KOI8-R" character set.  ]
    [ Some special characters may be displayed incorrectly. ]

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: malc <av1474@comtv.ru>
2012-07-19 20:07:53 +04:00
Alexey Kardashevskiy 932d4a42af msi/msix: added API to set MSI message address and data
Added (msi|msix)_set_message() function for whoever might
want to use them.

Currently msi_notify()/msix_notify() write to these vectors to
signal the guest about an interrupt so the correct values have to
written there by the guest or QEMU.

For example, POWER guest never initializes MSI/MSIX vectors, instead
it uses RTAS hypercalls. So in order to support MSIX for virtio-pci on
POWER we have to initialize MSI/MSIX message from QEMU.

Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2012-07-19 17:56:42 +03:00
Jan Kiszka 0ae1625177 pci: Add INTx routing notifier
This per-device notifier shall be triggered by any interrupt router
along the path of a device's legacy interrupt signal on routing changes.
For simplicity reasons and as this is a slow path anyway, no further
details on the routing changes are provided. Instead, the callback is
expected to use pci_device_route_intx_to_irq to check the effect of the
change.

Will be used by KVM PCI device assignment and VFIO.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2012-07-19 17:15:42 +03:00
Michael S. Tsirkin 3afa9bb488 pci: Add pci_device_route_intx_to_irq
Device assigned on KVM needs to know the mode
(enabled/inverted/disabled) and the IRQ number that a given device
triggers in the attached interrupt controller.

Add a PCI IRQ path discovery function that walks from a given device to
the host bridge, and gets this information.  For
this purpose, a host bridge callback function is introduced:
route_intx_to_irq. It is so far only implemented by the PIIX3, other
host bridges can be added later on as required.

Will be used for KVM PCI device assignment and VFIO.

Based on patch by Jan Kiszka, with minor tweaks.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2012-07-19 17:11:47 +03:00
Harsh Prateek Bora 90a147a275 Update simpletrace.py for new log format
Support new tracelog format for multiple arguments and strings.

Signed-off-by: Harsh Prateek Bora <harsh@linux.vnet.ibm.com>
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
2012-07-19 11:34:33 +01:00
Harsh Prateek Bora 62bab73213 Simpletrace v2: Support multiple arguments, strings.
Existing simpletrace backend allows to trace at max 6 args and does not
support strings. This newer tracelog format gets rid of fixed size records
and therefore allows to trace variable number of args including strings.

Sample trace with strings:
v9fs_version 0.000 tag=0xffff id=0x64 msize=0x2000 version=9P2000.L
v9fs_version_return 6.705 tag=0xffff id=0x64 msize=0x2000 version=9P2000.L

Signed-off-by: Harsh Prateek Bora <harsh@linux.vnet.ibm.com>
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
2012-07-19 11:34:33 +01:00
Harsh Prateek Bora 88affa1c77 monitor: remove unused do_info_trace
Going forward with simpletrace v2 variable size trace records, we cannot
have a generic function to print trace event info and therefore this
interface becomes invalid.

As per Stefan Hajnoczi:

"This command is only available from the human monitor.  It's not very
useful because it historically hasn't been able to pretty-print events
or show them in the right order (we use a ringbuffer but it prints
them out from index 0).

Therefore, I don't think we're under any obligation to keep this
command around.  No one has complained about it's limitations - I
think this is a sign that no one has used it.  I'd be okay with a
patch that removes it."

Ref: http://lists.gnu.org/archive/html/qemu-devel/2012-01/msg01268.html

Signed-off-by: Harsh Prateek Bora <harsh@linux.vnet.ibm.com>
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
2012-07-19 11:34:32 +01:00
Alexey Kardashevskiy 794b1f962e trace: added ability to comment out events in the list
It is convenient for debug to be able to switch on/off some events easily.
The only possibility now is to remove event name from the file completely
and type it again when we want it back.

The patch adds '#' symbol handling as a comment specifier.

Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
2012-07-19 11:30:37 +01:00
Anthony Liguori dfe1ce5d80 Merge remote-tracking branch 'kwolf/for-anthony' into staging
* kwolf/for-anthony: (41 commits)
  fdc-test: Clean up a bit
  fdc-test: introduce test_relative_seek
  fdc: fix relative seek
  qemu-iotests: Valgrind support
  coroutine-ucontext: Help valgrind understand coroutines
  qemu-io: Fix memory leaks
  hw/block-common: Factor out fall back to legacy -drive cyls=...
  blockdev: Don't limit DriveInfo serial to 20 characters
  hw/block-common: Factor out fall back to legacy -drive serial=...
  hw/block-common: Move BlockConf & friends from block.h
  Relax IDE CHS limits from 16383,16,63 to 65535,16,255
  blockdev: Drop redundant CHS validation for if=ide
  hd-geometry: Compute BIOS CHS translation in one place
  qtest: Test we don't put hard disk info into CMOS for a CD-ROM
  ide pc: Put hard disk info into CMOS only for hard disks
  block: Geometry and translation hints are now useless, purge them
  qtest: Cover qdev property for BIOS CHS translation
  ide: qdev property for BIOS CHS translation
  qdev: New property type chs-translation
  qdev: Collect private helpers in one place
  ...
2012-07-18 14:44:50 -05:00
Anthony Liguori 09f06a6c60 Merge remote-tracking branch 'qemu-kvm/uq/master' into staging
* qemu-kvm/uq/master:
  virtio: move common irqfd handling out of virtio-pci
  virtio: move common ioeventfd handling out of virtio-pci
  event_notifier: add event_notifier_set_handler
  memory: pass EventNotifier, not eventfd
  ivshmem: wrap ivshmem_del_eventfd loops with transaction
  ivshmem: use EventNotifier and memory API
  event_notifier: add event_notifier_init_fd
  event_notifier: remove event_notifier_test
  event_notifier: add event_notifier_set
  apic: Defer interrupt updates to VCPU thread
  apic: Reevaluate pending interrupts on LVT_LINT0 changes
  apic: Resolve potential endless loop around apic_update_irq
  kvm: expose tsc deadline timer feature to guest
  kvm_pv_eoi: add flag support
  kvm: Don't abort on kvm_irqchip_add_msi_route()
2012-07-18 14:44:43 -05:00
Anthony Liguori 513e6bde4f Merge remote-tracking branch 'qmp/queue/qmp' into staging
* qmp/queue/qmp:
  qapi: Convert getfd and closefd
  qapi: input_type_enum(): fix error message
  qmp: dump-guest-memory: improve schema doc
2012-07-18 14:44:37 -05:00
Anthony Liguori 052bb77a47 Merge remote-tracking branch 'kraxel/bios.2' into staging
* kraxel/bios.2:
  Add vgabios build rules to roms/Makefile
2012-07-18 14:44:32 -05:00
Anthony Liguori 83199ca43c Merge remote-tracking branch 'kraxel/usb.57' into staging
* kraxel/usb.57:
  ehci: improve expire time calculation
  ehci: implement Interrupt Threshold Control support
  ehci: raise irq in the frame timer
  uhci: initialize expire_time when loading v1 vmstate
  usb: add usb attached scsi emulation
  scsi: add free_request callback
2012-07-18 14:44:27 -05:00
Anthony Liguori cb5fc67db9 build: fix build breakage due to bad merge
34bb443ee7 broke the build but in a subtle way.
The patch on the ML was actually based on the 1.1.1 stable branch
(accidentally).  When I merged it from the ML, the fuzzing got resolved in a
such a way that the newly introduced Makefile dependency on GENERATED_HEADERS
got lost (that was not in 1.1.1).

The dist bits also got duplicated (but this is just cosmetic).

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2012-07-17 18:58:20 -05:00
Anthony Liguori 34bb443ee7 build: add make dist target (v2)
Let's stop screwing up releases by having a script do the work that Anthony's
fat fingers can't seem to get right.

Cc: Michael Roth <mdroth@linux.vnet.ibm.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Tested-by: Michael Roth <mdroth@linux.vnet.ibm.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2012-07-17 15:43:16 -05:00
Michal Novotny 86ee5bc304 qemu-options.hx: Fix set_password and expire_password description
The description for set_password and expire_password commands is
incomplete. This patch fixes the man page that is being generated
to match the real behaviour of these functions.

Signed-off-by: Michal Novotny <minovotn@redhat.com>
Signed-off-by: Michal Novotny <minovotn@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2012-07-17 15:40:15 -05:00
Michal Novotny 66c19bf120 qemu-options.hx: Improve -nodefaults description
This patch improves the description of -nodefaults QEMU command line
option by adding more information what is being disabled using this
command.

Signed-off-by: Michal Novotny <minovotn@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2012-07-17 15:40:15 -05:00
Michal Novotny ed24cfac07 qemu-options.hx: Improve -{read|write}config options description
This is the patch to improve description for -{read|write}config
functions.

Signed-off-by: Michal Novotny <minovotn@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2012-07-17 15:40:15 -05:00
Christian Borntraeger 3b25597bcf constify value pointer for qdev_prop_set_string
qdev_prop_set_string uses object_property_set_str, which takes
a const char * for the value. Lets propagate the constness
into qdev_prop_set_string.

Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2012-07-17 15:40:14 -05:00