summaryrefslogtreecommitdiff
path: root/hw
AgeCommit message (Collapse)AuthorFilesLines
2012-10-08qxl: set default revision to 4Gerd Hoffmann2-5/+8
Set qxl pci revision to 4 (for pc-1.3+) so guests know spice-server 0.12 features are available. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2012-10-08spice: raise requirement to 0.12Gerd Hoffmann1-30/+0
With the next qemu version (1.3) we are going to bump the qxl device revision to 4. The new features available require a recent spice-server version, so raise up the bar. Otherwise we would end up with different qxl revisions depending on the spice-server version installed, which would be a major PITA when it comes to compat properties. Clear out a big bunch of #ifdefs which are not needed any more. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2012-10-08hw/qxl: qxl_dirty_surfaces: use uintptr_tAlon Levy1-2/+2
As suggested by Paolo Bonzini, to avoid possible integer overflow issues. Signed-off-by: Alon Levy <alevy@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2012-10-08hw/qxl: fix condition for exiting guest_bugAlon Levy1-1/+1
Reported and suggested by Paolo Bonzini, thanks. Signed-off-by: Alon Levy <alevy@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2012-10-08hw/qxl: exit on failure to register qxl interfaceAlon Levy1-1/+5
This prevents a segfault later on when the device reset handler tries to access a NULL ssd.worker since interface_attach_worker has not been called. Signed-off-by: Alon Levy <alevy@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2012-10-08qxl: fix range check for rev3 io commands.Gerd Hoffmann1-1/+1
Enables QXL_IO_FLUSH_SURFACES_ASYNC and QXL_IO_FLUSH_RELEASE which are part of the qxl rev3 feature set. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2012-10-08qxl/update_area_io: cleanup invalid parameters handlingMichael Tokarev1-10/+3
This cleans up two additions of almost the same code in commits 511b13e2c9 and ccc2960d654. While at it, make error paths consistent (always use 'break' instead of 'return'). Signed-off-by: Michael Tokarev <mjt@tls.msk.ru> Cc: Dunrong Huang <riegamaths@gmail.com> Cc: Alon Levy <alevy@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2012-10-08qxl: always update displaysurface on resizeGerd Hoffmann1-4/+0
Don't try to be clever and skip displaysurface reinitialization in case the size hasn't changed. Other parameters might have changed nevertheless, for example depth or stride, resulting in rendering being broken then. Trigger: boot linux guest with vesafb, start X11, make sure both vesafb and X11 use the display same resolution. Then watch X11 screen being upside down. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2012-10-06Merge branch 'trivial-patches' of git://github.com/stefanha/qemuAurelien Jarno30-66/+36
* 'trivial-patches' of git://github.com/stefanha/qemu: versatilepb: Use symbolic indices for ARM PIC qdev: kill bogus comment qemu-barrier: Fix compiler version check for future gcc versions hw: Add missing 'static' attribute for QEMUMachine cleanup useless return sentence qemu-sockets: Fix compiler warning (regression for MinGW) vnc: Fix spelling (hellmen -> hellman) in comment slirp: Fix spelling in comment (enought -> enough, insure -> ensure) tcg/arm: Use tcg_out_mov_reg rather than inline equivalent code cpu: Add missing 'static' attribute to qemu_global_mutex configure: Support empty target list (--target-list=) hw: Fix return value check for bdrv_read, bdrv_write
2012-10-06Merge branch 'ppc-for-upstream' of git://repo.or.cz/qemu/agrafAurelien Jarno12-283/+351
* 'ppc-for-upstream' of git://repo.or.cz/qemu/agraf: (35 commits) PPC: KVM: Fix BAT put PPC: e500: Only expose even TLB sizes in initial TLB ppc/pseries: Reset VPA registration on CPU reset pseries: Don't test for MSR_PR for hypercalls under KVM PPC: e500: calculate initrd_base like dt_base PPC: e500: increase DTC_LOAD_PAD device tree: simplify dumpdtb code fdt: move dumpdtb interpretation code to device_tree.c target-ppc: Remove unused power_mode field from cpu state pseries: Set hash table size based on RAM size pseries: Remove unnecessary locking from PAPR hash table hcalls ppc405_uc: Fix buffer overflow target-ppc: KVM: Fix some kernel version edge cases for kvmppc_reset_htab() pseries: Fix semantics of RTAS int-on, int-off and set-xive functions pseries: Rework implementation of TCE bypass pseries: Remove never used flags field from spapr vio devices pseries: Remove XICS irq type enum type pseries: Remove C bitfields from xics code pseries: Small cleanup to H_CEDE implementation pseries: Fix XICS reset ...
2012-10-06vga: cleanup after isa_vga_init() and pci_vga_init() conversionAurelien Jarno6-53/+0
Now that all machines call isa_vga_init() or pci_vga_init(), some unused code can be removed. Cc: Anthony Liguori <aliguori@us.ibm.com> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2012-10-06mips/r4k: use the new is_vga_init() functionAurelien Jarno1-1/+1
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2012-10-06pc: use the new pci_vga_init() and isa_vga_init() functionsAurelien Jarno1-29/+6
The CONFIG_SPICE is now tested in vl.c and thus not needed anymore. Cc: Anthony Liguori <aliguori@us.ibm.com> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2012-10-06sun/sun4u: use the new pci_vga_init() functionAurelien Jarno1-2/+1
As a bonus it allows new vga card types (including none). Acked-by: Blue Swirl <blauwirbel@gmail.com> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2012-10-06ppc/pSeries: use the new pci_vga_init() functionAurelien Jarno1-5/+2
Keep the case to prevent some vga card to be selected. Cc: Alexander Graf <agraf@suse.de> Cc: David Gibson <david@gibson.dropbear.id.au> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2012-10-06ppc/prep: use the new pci_vga_init() functionAurelien Jarno1-2/+1
As a bonus it allows new vga card types (including none). Acked-by: Andreas Färber <andreas.faerber@web.de> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2012-10-06ppc/oldworld: use the new pci_vga_init() functionAurelien Jarno1-2/+1
As a bonus it allows new vga card types (including none). Cc: Alexander Graf <agraf@suse.de> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2012-10-06ppc/newworld: use the new pci_vga_init() functionAurelien Jarno1-2/+1
As a bonus it allows new vga card types (including none). Cc: Alexander Graf <agraf@suse.de> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2012-10-06alpha: use the new pci_vga_init() functionAurelien Jarno3-27/+1
This remove the fallback to std-vga in case, as availability of the requested vga device is now tested in vl.c, and returns an error message to the user. Acked-by: Richard Henderson <rth@twiddle.net> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2012-10-06mips/malta: use the new pci_vga_init() functionAurelien Jarno1-9/+1
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2012-10-06isa: add a isa_vga_init() functionAurelien Jarno2-0/+22
This function create a ISA VGA device according to the value of vga_interface_type. It returns a ISADevice (and not a DeviceState). Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2012-10-06pci: add a pci_vga_init() functionAurelien Jarno2-0/+21
This function create a PCI VGA device according to the value of vga_interface_type. It returns a PCIDevice (and not a DeviceState). Cc: Anthony Liguori <aliguori@us.ibm.com> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2012-10-06vl.c: convert *vga_enabled functions to QOMAurelien Jarno2-6/+0
And get rid of qdev_exists(). Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2012-10-06vga: rename isa_vga_init() to isa_std_vga_init()Aurelien Jarno3-3/+3
This better explains what is this function about. Adjust all callers. Cc: Anthony Liguori <aliguori@us.ibm.com> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2012-10-06vga: rename pci_vga_init() into pci_std_vga_init()Aurelien Jarno10-12/+12
This better explains what is this function about. Adjust all callers. Cc: Alexander Graf <agraf@suse.de> Cc: Andreas Färber <andreas.faerber@web.de> Cc: David Gibson <david@gibson.dropbear.id.au> Cc: Anthony Liguori <aliguori@us.ibm.com> Acked-by: Richard Henderson <rth@twiddle.net> Acked-by: Blue Swirl <blauwirbel@gmail.com> Acked-by: Andreas Färber <andreas.faerber@web.de> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2012-10-05Remove libhwStefan Weil4-137/+137
The entries for libhw* are no longer needed in .gitignore. There is also no longer a difference between common-obj-y and hw-obj-y, so one of those two macros is sufficient. Signed-off-by: Stefan Weil <sw@weilnetz.de> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2012-10-05versatilepb: Use symbolic indices for ARM PICStefan Weil1-1/+2
It is more readable, and all other code does it like that, too. Signed-off-by: Stefan Weil <sw@weilnetz.de> Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Stefan Hajnoczi <stefanha@gmail.com>
2012-10-05qdev: kill bogus commentEduardo Habkost1-1/+0
When the DeviceInfo code was removed, the comment describing qdev_subclass_init() was left in the code by mistake. Remove it. Cc: qemu-trivial@nongnu.org Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@gmail.com>
2012-10-05hw: Add missing 'static' attribute for QEMUMachineStefan Weil2-2/+2
It was missing for leon3 and mips_fulong2e. Signed-off-by: Stefan Weil <sw@weilnetz.de> Reviewed-by: Andreas Färber <afaerber@suse.de> Signed-off-by: Stefan Hajnoczi <stefanha@gmail.com>
2012-10-05cleanup useless return sentenceAmos Kong23-42/+0
This patch cleans up return sentences in the end of void functions. Reported-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Amos Kong <akong@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@gmail.com>
2012-10-05rtc: implement century bytePaolo Bonzini1-9/+18
Implement the century byte in the RTC emulation, and test that it works. This leads to some annoying compatibility code because we need to treat a value of 2000 for the base_year property as "use the century byte properly" (which would be a value of 0). The century byte will now be always-zero, rather than always-20, for the MIPS Magnum machine whose base_year is 1980. Commit 42fc73a (Support epoch of 1980 in RTC emulation for MIPS Magnum, 2009-01-24) correctly said: With an epoch of 1980 and a year of 2009, one could argue that [the century byte] should hold either 0, 1, 19 or 20. NT 3.50 on MIPS does not read the century byte. so I picked the simplest and most sensible implementation which is to return 0 for 1980-2079, 1 for 2080-2179 and so on. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2012-10-05rtc: map CMOS index 0x37 to 0x32 on read and writesPaolo Bonzini2-6/+13
QEMU's attempt to implement the century byte cover two possible places for the byte. A common one on modern chipsets is 0x32, but QEMU also stores the value in 0x37 (apparently for IBM PS/2 compatibility---it's only been 25 years). To simplify the implementation of the century byte, store it only at 0x32 but remap transparently 0x37 to 0x32 when reading and writing from CMOS. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2012-10-05hw/r2d: add comment: this strncpy use is okJim Meyering1-0/+2
Signed-off-by: Jim Meyering <meyering@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2012-10-05acpi: remove strzcpy (strncpy-identical) function; just use strncpyJim Meyering1-16/+8
Adjust all uses s/strzcpy/strncpy/ and mark these uses of strncpy as "ok". Signed-off-by: Jim Meyering <meyering@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2012-10-05vscsi: avoid unwarranted strncpyJim Meyering1-1/+1
Don't use strncpy when the source string is known to fit in the destination buffer. Use equivalent memcpy. We could even use strcpy, here, but some static analyzers warn about that, so don't add new uses. Acked-by: David Gibson <david@gibson.dropbear.id.au> Signed-off-by: Jim Meyering <meyering@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2012-10-05virtio-9p: avoid unwarranted uses of strncpyJim Meyering3-4/+8
In all of these cases, the uses of strncpy were unnecessary, since at each point of use we know that the NUL-terminated source bytes fit in the destination buffer. Use memcpy in place of strncpy. Acked-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com> Signed-off-by: Jim Meyering <meyering@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2012-10-05bt: replace fragile snprintf use and unwarranted strncpyJim Meyering1-5/+2
In bt_hci_name_req a failed snprintf could return len larger than sizeof(params.name), which means the following memset call would have a "length" value of (size_t)-1, -2, etc... Sounds scary. But currently, one can deduce that there is no problem: strlen(slave->lmp_name) is guaranteed to be smaller than CHANGE_LOCAL_NAME_CP_SIZE, which is the same as sizeof(params.name), so this cannot happen. Regardless, there is no justification for using snprintf+memset. Use pstrcpy instead. Also, in bt_hci_event_complete_read_local_name, use pstrcpy in place of unwarranted strncpy. Signed-off-by: Jim Meyering <meyering@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2012-10-05lm32: avoid buffer overrunJim Meyering1-1/+1
Actually do what the comment says, using pstrcpy NUL-terminate: strncpy does not always do that. Signed-off-by: Jim Meyering <meyering@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2012-10-05hw/9pfs: avoid buffer overrunJim Meyering1-2/+2
v9fs_add_dir_node and qemu_v9fs_synth_add_file used strncpy to form node->name, which requires NUL-termination, but strncpy does not ensure NUL-termination. Use pstrcpy, which does. Acked-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com> Signed-off-by: Jim Meyering <meyering@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2012-10-05scsi, pci, qdev, isa-bus, sysbus: don't let *_get_fw_dev_path return NULLJim Meyering6-11/+7
Use g_strdup rather than strdup, because the sole caller (qdev_get_fw_dev_path_helper) assumes it gets non-NULL, and dereferences it. Besides, in that caller, the allocated buffer is already freed with g_free, so it's better to allocate with a matching g_strdup. In one case, (scsi-bus.c) it was trivial, so I replaced an snprintf+ g_strdup combination with an equivalent g_strdup_printf use. Signed-off-by: Jim Meyering <meyering@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2012-10-05hw: Fix return value check for bdrv_read, bdrv_writeStefan Weil3-20/+32
Those functions return -errno in case of an error. The old code would typically only detect EPERM (1) errors. Signed-off-by: Stefan Weil <sw@weilnetz.de> Signed-off-by: Stefan Hajnoczi <stefanha@gmail.com>
2012-10-04Merge remote-tracking branch 'sstabellini/xen-2012-10-03' into stagingAnthony Liguori4-17/+38
* sstabellini/xen-2012-10-03: xen: Set the vram dirty when an error occur. exec, memory: Call to xen_modified_memory. exec: Introduce helper to set dirty flags. xen: Introduce xen_modified_memory. QMP, Introduce xen-set-global-dirty-log command. qemu/xen: Add 64 bits big bar support on qemu xen: Fix, no unplug of pt device by platform device.
2012-10-04Merge remote-tracking branch 'kwolf/for-anthony' into stagingAnthony Liguori6-55/+27
* kwolf/for-anthony: (30 commits) qemu-iotests: add tests for streaming error handling qemu-iotests: map underscore to dash in QMP argument names blkdebug: process all set_state rules in the old state stream: add on-error argument block: introduce block job error iostatus: reorganize io error code iostatus: change is_read to a bool iostatus: move BlockdevOnError declaration to QAPI iostatus: rename BlockErrorAction, BlockQMPEventAction qemu-iotests: add test for pausing a streaming operation qmp: add block-job-pause and block-job-resume block: add support for job pause/resume qmp: add 'busy' member to BlockJobInfo block: add block_job_query block: move job APIs to separate files block: fix documentation of block_job_cancel_sync qerror/block: introduce QERR_BLOCK_JOB_NOT_ACTIVE qemu-iotests: add initial tests for live block commit QAPI: add command for live block commit, 'block-commit' block: helper function, to find the base image of a chain ...
2012-10-04Merge remote-tracking branch 'qmp/queue/qmp' into stagingAnthony Liguori1-9/+3
* qmp/queue/qmp: block: live snapshot documentation tweaks input: index_from_key(): drop unused code qmp: qmp_send_key(): accept key codes in hex input: qmp_send_key(): simplify hmp: dump-guest-memory: hardcode protocol argument to "file:" qmp: dump-guest-memory: don't spin if non-blocking fd would block qmp: dump-guest-memory: improve schema doc (again) qapi: convert add_client monitor: add Error * argument to monitor_get_fd pci-assign: use monitor_handle_fd_param qapi: add "unix" to the set of reserved words qapi: do not protect enum values from namespace pollution Add qemu-ga-client script Support settimeout in QEMUMonitorProtocol Make negotiation optional in QEMUMonitorProtocol
2012-10-04Merge remote-tracking branch 'mst/tags/for_anthony' into stagingAnthony Liguori4-20/+32
* mst/tags/for_anthony: virtio-serial-bus: let chardev know the exact number of bytes requested virtio: Introduce virtqueue_get_avail_bytes() virtio: use unsigned int for counting bytes in vq iov: add const annotation virtio-net: fix used len for tx virtio: don't mark unaccessed memory as dirty
2012-10-04Merge remote-tracking branch 'kraxel/usb.66' into stagingAnthony Liguori3-106/+137
* kraxel/usb.66: usb: Fix usb_packet_map() in the presence of IOMMUs usb-redir: Adjust pkg-config check for usbredirparser .pc file rename (v2) ehci: Fix interrupt packet MULT handling xhci: create a memory region for each port xhci: route string & usb hub support xhci: tweak limits compat: turn off msi/msix on xhci for old machine types add pc-1.3 machine type Conflicts: hw/pc_piix.c Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2012-10-04Make target_phys_addr_t 64 bits unconditionallyAvi Kivity3-13/+3
The hassle and compile time overhead of maintaining both 32-bit and 64-bit capable source isn't worth the tiny performance advantage which is seen on a minority of configurations. Switch to compiling libhw only once, with target_phys_addr_t unconditionally typedefed to uint64_t. Signed-off-by: Avi Kivity <avi@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2012-10-05PPC: e500: Only expose even TLB sizes in initial TLBAlexander Graf1-0/+4
When booting our e500 machine, we automatically generate a big TLB entry in TLB1 that covers all of the code we need to run in there until the guest can handle its TLB on its own. However, e500v2 can only handle MAS1.0 sizes. However, we keep our TLB information in MAS2.0 layout, which means we have twice as many TLB sizes to choose from. That also means we can run into a situation where we try to add a TLB size that could not fit into the MAS1.0 size bits. Fix it by making sure we always have the lower bit set to 0. That way we are always guaranteed to have MAS1.0 compatible TLB size information. Signed-off-by: Alexander Graf <agraf@suse.de>
2012-10-05pseries: Don't test for MSR_PR for hypercalls under KVMDavid Gibson2-6/+6
PAPR hypercalls should only be invoked from the guest kernel, not guest user programs, that is, with MSR[PR]=0. Currently we check this in spapr_hypercall, returning H_PRIVILEGE if MSR[PR]=1. However, under KVM the state of MSR[PR] is already checked by the host kernel before passing the hypercall to qemu, making this check redundant. Worse, however, we don't generally synchronize KVM and qemu state on the hypercall path, meaning that qemu could incorrectly reject a hypercall because it has a stale MSR value. This patch fixes the problem by moving the privilege test exclusively to the TCG hypercall path. Signed-off-by: David Gibson <david@gibson.dropbear.id.au> CC: qemu-stable@nongnu.org Signed-off-by: Alexander Graf <agraf@suse.de>
2012-10-05PPC: e500: calculate initrd_base like dt_baseScott Wood1-1/+2
While investigating dtb pad issues, I noticed that initrd_base wasn't taking loadaddr into account the way dt_base was. This seems wrong. Signed-off-by: Scott Wood <scottwood@freescale.com> Signed-off-by: Alexander Graf <agraf@suse.de>