summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2013-01-17aio: Fix return value of aio_poll()Kevin Wolf4-8/+8
aio_poll() must return true if any work is still pending, even if it didn't make progress, so that bdrv_drain_all() doesn't stop waiting too early. The possibility of stopping early occasionally lead to a failed assertion in bdrv_drain_all(), when some in-flight request was missed and the function didn't really drain all requests. In order to make that change, the return value as specified in the function comment must change for blocking = false; fortunately, the return value of blocking = false callers is only used in test cases, so this change shouldn't cause any trouble. Cc: qemu-stable@nongnu.org Signed-off-by: Kevin Wolf <kwolf@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2013-01-17ide: Remove wrong assertionKevin Wolf1-1/+0
The Bus Master IDE Active bit (BM_STATUS_DMAING) is not only set when the request is still in flight, but also when it has completed and the size of the physical memory regions in the PRDT was larger than the transfer size. Signed-off-by: Kevin Wolf <kwolf@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2013-01-17block: fix null-pointer bug on error case in block commitJeff Cody1-4/+3
This is a bug that was caught by a coverity run by Markus. In the error case when we errored out to exit_restore_open early in the function, 'overlay_bs' was still NULL at that point, although it is used to look up flags and perform a bdrv_reopen(). Move the overlay_bs lookup to where it is needed, and check for NULL before restoring the flags. Also get rid of the unneeded parameter initialization. Reported-By: Markus Armbruster <armbru@redhat.com> Signed-off-by: Jeff Cody <jcody@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2013-01-16Merge remote-tracking branch 'kraxel/chardev.1' into stagingAnthony Liguori9-112/+600
# By Gerd Hoffmann # Via Gerd Hoffmann * kraxel/chardev.1: chardev: add pty chardev support to chardev-add (qmp) chardev: add socket chardev support to chardev-add (qmp) chardev: add parallel chardev support to chardev-add (qmp) chardev: add serial chardev support to chardev-add (qmp) chardev: add file chardev support to chardev-add (qmp) chardev: add hmp hotplug commands chardev: add qmp hotplug commands, with null chardev support chardev: reduce chardev ifdef mess a bit chardev: fix QemuOpts lifecycle chardev: add error reporting for qemu_chr_new_from_opts
2013-01-16build: fix Win32 clean buildPaolo Bonzini1-0/+1
The version.o file did not appear explicitly as a dependency, and this caused clean builds to fail. Force its build by making the Makefile depend on version.o. (We cannot add it to libqemuutil.a, because it doesn't export any symbol and thus would not be pulled by the linker). Cc: Blue Swirl <blauwirbel@gmail.com> Cc: Stefan Weil <sw@weilnetz.de> Tested-by: Stefan Weil <sw@weilnetz.de> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2013-01-16tmp105: Add temperature QOM propertyAndreas Färber2-20/+29
This obsoletes tmp105_set() and allows for better error handling. Signed-off-by: Andreas Färber <andreas.faerber@web.de> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2013-01-16tmp105: QOM'ifyAndreas Färber2-24/+39
Introduce TYPE_ constant and cast macro. Move the state struct to the new header to allow for future embedding. Signed-off-by: Andreas Färber <andreas.faerber@web.de> Reviewed-by: Anthony Liguori <aliguori@us.ibm.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2013-01-16tests: Add tmp105 qtest test caseAndreas Färber2-0/+79
Exercise all four commands of the TMP105, testing for an issue in the I2C TX path. The test case uses the N800's OMAP I2C and is the first for ARM. Signed-off-by: Andreas Färber <andreas.faerber@web.de> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2013-01-16tmp105: Fix I2C protocol bugAndreas Färber1-3/+6
An early length postincrement in the TMP105's I2C TX path led to transfers of more than one byte to place the second byte in the third byte's place within the buffer and the third byte to get discarded. Fix this by explictly incrementing the length after the checks but before the callback is called, which again checks the length. Adjust the Coding Style while at it. Signed-off-by: Alex Horn <alex.horn@cs.ox.ac.uk> Signed-off-by: Andreas Färber <andreas.faerber@web.de> Reviewed-by: Anthony Liguori <aliguori@us.ibm.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2013-01-16tmp105: Split out I2C message constants from headerAndreas Färber2-33/+51
Allows value sharing with qtest. Signed-off-by: Andreas Färber <andreas.faerber@web.de> Reviewed-by: Anthony Liguori <aliguori@us.ibm.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2013-01-16libqtest: Prepare I2C libqosAndreas Färber4-0/+219
This adds a simple I2C API and a driver implementation for omap_i2c. Signed-off-by: Andreas Färber <andreas.faerber@web.de> Reviewed-by: Anthony Liguori <aliguori@us.ibm.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2013-01-16audio: Replace non-portable asprintf in debug code by g_strdup_printfStefan Weil1-2/+3
sw->name already uses the correct g_free to free the allocated memory. Signed-off-by: Stefan Weil <sw@weilnetz.de> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2013-01-16usb-storage: Drop useless null test in usb_msd_handle_data()Markus Armbruster1-1/+1
scsi_req_new() never returns null, and scsi_req_enqueue() dereferences the pointer, so checking for null is useless. Spotted by Coverity. Signed-off-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2013-01-16ui: Drop useless null tests in parse_keyboard_layout()Markus Armbruster1-7/+9
Spotted by Coverity. Signed-off-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2013-01-16pseries: Replace non-portable asprintf by g_strdup_printfStefan Weil2-28/+8
g_strdup_printf already handles OOM errors, so some error handling in QEMU code can be removed. Signed-off-by: Stefan Weil <sw@weilnetz.de> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2013-01-16Add new DEFAULT_MACHINE_OPTIONS to q35 and ppc405Knut Omang2-0/+2
Without this default q35/ppc405 based machines would no longer boot after commit e4ada29e909787f629626660b1561f6a680187d3 Signed-off-by: Knut Omang <knut.omang@oracle.com> Reviewed-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2013-01-16chardev: add pty chardev support to chardev-add (qmp)Gerd Hoffmann3-1/+20
The ptsname is returned directly, so there is no need to use query-chardev to figure the pty device path. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2013-01-16chardev: add socket chardev support to chardev-add (qmp)Gerd Hoffmann2-56/+138
qemu_chr_open_socket is split into two functions. All initialization after creating the socket file handler is split away into the new qemu_chr_open_socket_fd function. chr->filename doesn't get filled from QemuOpts any more. Qemu gathers the information using getsockname and getnameinfo instead. This way it will also work correctly for file handles passed via file descriptor passing. Finally qmp_chardev_open_socket() is the actual qmp hotplug implementation which basically just calls socket_listen or socket_connect and the new qemu_chr_open_socket_fd function. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2013-01-16chardev: add parallel chardev support to chardev-add (qmp)Gerd Hoffmann3-18/+34
Also alias the old parport name to parallel for -chardev. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2013-01-16chardev: add serial chardev support to chardev-add (qmp)Gerd Hoffmann3-13/+75
Similar to file, except that no separate in/out files are supported because it's pointless for direct device access. Also the special tty ioctl hooks (pass through linespeed settings etc) are activated on Unix. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2013-01-16chardev: add file chardev support to chardev-add (qmp)Gerd Hoffmann3-2/+83
Add support for file chardevs. Output file is mandatory, input file is optional. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2013-01-16chardev: add hmp hotplug commandsGerd Hoffmann3-0/+57
Add chardev-add and chardev-remove commands to the human monitor. chardev-add accepts the same syntax as -chardev, chardev-remove expects a chardev id. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2013-01-16chardev: add qmp hotplug commands, with null chardev supportGerd Hoffmann3-0/+152
Add chardev-add and chardev-remove qmp commands. Hotplugging a null chardev is supported for now, more will be added later. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2013-01-16chardev: reduce chardev ifdef mess a bitGerd Hoffmann1-11/+11
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2013-01-16chardev: fix QemuOpts lifecycleGerd Hoffmann2-6/+15
qemu_chr_new_from_opts handles QemuOpts release now, so callers don't have to worry. It will either be saved in CharDriverState, then released in qemu_chr_delete, or in the error case released instantly. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2013-01-16chardev: add error reporting for qemu_chr_new_from_optsGerd Hoffmann3-13/+23
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2013-01-15qdev: Prepare "realized" propertyAndreas Färber2-24/+122
Introduce the QOM realizefn suggested by Anthony. Detailed documentation is supplied in the qdev header. For now this implements a default DeviceClass::realize callback that just wraps DeviceClass::init, which it deprecates. Once all devices have been converted to DeviceClass::realize, DeviceClass::init is to be removed. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Andreas Färber <afaerber@suse.de> Cc: Anthony Liguori <anthony@codemonkey.ws> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2013-01-15qdev: Fold state enum into bool realizedAndreas Färber5-29/+31
Whether the device was initialized or not is QOM-level information and currently unused. Drop it from device. This leaves the boolean state of whether or not DeviceClass::init was called or not, a.k.a. "realized". Suggested-by: Anthony Liguori <aliguori@us.ibm.com> Signed-off-by: Andreas Färber <afaerber@suse.de> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2013-01-15pseries: set no default boot orderAvik Sil1-2/+4
This patch removes the default boot order for pseries machine. This allows the machine to handle a NULL boot order in case no -boot option is provided. Thus it helps SLOF firmware to verify if boot order is specified in command line or not. If no boot order is provided SLOF tries to boot from the device set in the nvram. Reviewed-by: Anthony Liguori <aliguori@us.ibm.com> Acked-by: Alexander Graf <agraf@suse.de> Signed-off-by: Avik Sil <aviksil@linux.vnet.ibm.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2013-01-15Make default boot order machine specificAvik Sil57-8/+110
This patch makes default boot order machine specific instead of set globally. The default boot order can be set per machine in QEMUMachine boot_order. This also allows a machine to receive a NULL boot order when -boot isn't used and take an appropriate action accordingly. This helps machine boots from the devices as set in guest's non-volatile memory location in case no boot order is provided by the user. Reviewed-by: Anthony Liguori <aliguori@us.ibm.com> Signed-off-by: Avik Sil <aviksil@linux.vnet.ibm.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2013-01-15acl: Free memory allocated with g_malloc() with g_free()Markus Armbruster1-2/+2
Signed-off-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2013-01-15acl: Fix acl_remove not to mess up the ACLMarkus Armbruster1-0/+3
It leaks memory and fails to adjust qemu_acl member nentries. Future acl_add become confused: can misreport the position, and can silently fail to add. Cc: qemu-stable@nongnu.org Signed-off-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2013-01-15sdl: Fix heap smash in sdl_zoom_rgb{16,32} for int > 32 bitsMarkus Armbruster2-15/+10
Careless use of malloc(): allocate Uint32[N], assign to int *, use int[N]. Fix by converting to g_new(). Functions can't fail anymore, so make them return void. Caller ignored the value anyway. Signed-off-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2013-01-15kvm: add stub for kvm_irqchip_update_msi_routeMichael S. Tsirkin1-0/+5
ppc64 build needs this stub to build with virtio enabled. Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Tested-by: Andreas Färber <afaerber@suse.de> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2013-01-15Merge remote-tracking branch 'afaerber/memory-ioport' into stagingAnthony Liguori3-73/+62
* afaerber/memory-ioport: acpi_piix4: Do not use old_portio-style callbacks xen_platform: Do not use old_portio-style callbacks hw/dma.c: Fix conversion of ioport_register* to MemoryRegion Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2013-01-15Merge remote-tracking branch 'stefanha/trivial-patches' into stagingAnthony Liguori4-3/+7
* stefanha/trivial-patches: configure: try pkg-config for curses qom: Make object_resolve_path_component() path argument const Add libcacard/trace/generated-tracers.c to .gitignore Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2013-01-15Merge remote-tracking branch 'stefanha/block' into stagingAnthony Liguori11-118/+227
* stefanha/block: block: Fix how mirror_run() frees its buffer win32-aio: Fix how win32_aio_process_completion() frees buffer scsi-disk: qemu_vfree(NULL) is fine, simplify w32: Make qemu_vfree() accept NULL like the POSIX implementation sheepdog: clean up sd_aio_setup() sheepdog: multiplex the rw FD to flush cache block: clear dirty bitmap when discarding ide: issue discard asynchronously but serialize the pieces ide: fix TRIM with empty range entry block: make discard asynchronous raw: support discard on block devices raw-posix: remember whether discard failed raw-posix: support discard on more filesystems block: fix initialization in bdrv_io_limits_enable() qcow2: Fix segfault on zero-length write Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2013-01-15Merge remote-tracking branch 'afaerber/qom-cpu' into stagingAnthony Liguori49-277/+483
* afaerber/qom-cpu: target-i386: Use switch in check_hw_breakpoints() target-i386: Avoid goto in hw_breakpoint_insert() target-i386: Introduce hw_{local,global}_breakpoint_enabled() target-i386: Define DR7 bit field constants target-i386: Move kvm_check_features_against_host() check to realize time target-i386: cpu_x86_register() consolidate freeing resources target-i386: Move setting defaults out of cpu_x86_parse_featurestr() target-i386: check/enforce: Check all feature words target-i386/cpu.c: Add feature name array for ext4_features target-i386: kvm_check_features_against_host(): Use feature_word_info target-i386/cpu: Introduce FeatureWord typedefs target-i386: Disable kvm_mmu by default kvm: Add fake KVM constants to avoid #ifdefs on KVM-specific code exec: Return CPUState from qemu_get_cpu() xen: Simplify halting of first CPU kvm: Pass CPUState to kvm_init_vcpu() cpu: Move cpu_index field to CPUState cpu: Move numa_node field to CPUState target-mips: Clean up mips_cpu_map_tc() documentation cpu: Move nr_{cores,threads} fields to CPUState Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2013-01-15Merge remote-tracking branch 'afaerber-or/prep-up' into stagingAnthony Liguori2-25/+41
* afaerber-or/prep-up: pc87312: Avoid define conflict on mingw32 pc87312: Replace register_ioport_*() with MemoryRegion Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2013-01-15Merge remote-tracking branch 'mdroth/qga-pull-1-14-2013-2' into stagingAnthony Liguori1-2/+2
* mdroth/qga-pull-1-14-2013-2: qga: add missing commas in json docs Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2013-01-15Merge remote-tracking branch 'mdroth/qga-pull-1-14-2013' into stagingAnthony Liguori2-8/+29
* mdroth/qga-pull-1-14-2013: qemu-ga: Handle errors uniformely in ga_channel_open() qemu-ga: Plug fd leak on ga_channel_open() error paths qemu-ga: Plug fd leak on ga_channel_listen_accept() error path qemu-ga: Plug file descriptor leak on ga_open_pidfile() error path qemu-ga: Drop pointless lseek() from ga_open_pidfile() qemu-ga: Document intentional fall through in channel_event_cb() qemu-ga: add ga_open_logfile() qemu-ga: ga_open_pidfile(): use qemu_open() Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2013-01-15Merge remote-tracking branch 'sstabellini/xen-2013-01-14' into stagingAnthony Liguori1-24/+184
* sstabellini/xen-2013-01-14: xen_disk: implement BLKIF_OP_FLUSH_DISKCACHE, remove BLKIF_OP_WRITE_BARRIER xen_disk: add persistent grant support to xen_disk backend xen_disk: fix memory leak Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2013-01-15acpi_piix4: Do not use old_portio-style callbacksHervé Poussineau1-51/+41
Signed-off-by: Hervé Poussineau <hpoussin@reactos.org> [AF: Used HWADDR_PRIx for hwaddr PIIX4_DPRINTF()] Signed-off-by: Andreas Färber <afaerber@suse.de>
2013-01-15xen_platform: Do not use old_portio-style callbacksHervé Poussineau1-11/+10
Signed-off-by: Hervé Poussineau <hpoussin@reactos.org> Signed-off-by: Andreas Färber <afaerber@suse.de>
2013-01-15hw/dma.c: Fix conversion of ioport_register* to MemoryRegionJulien Grall1-11/+11
The commit 582299336879504353e60c7937fbc70fea93f3da introduced a 1-shift for some offset in DMA emulation. Before the previous commit, which converted ioport_register_* to MemoryRegion, the DMA controller registered 8 ioports with the following formula: base + ((8 + i) << d->shift) where 0 <= i < 8 When an IO occured within a Memory Region, DMA callback receives an offset relative to the start address. Here the start address is: base + (8 << d->shift). The offset should be: (i << d->shift). After the shift is reverted, the offsets are 0..7 not 1..8. Fixes LP#1089996. Reported-by: Andreas Gustafsson <gson@gson.org> Signed-off-by: Julien Grall <julien.grall@citrix.com> Tested-by: Stefan Hajnoczi <stefanha@redhat.com> Signed-off-by: Andreas Färber <afaerber@suse.de>
2013-01-15configure: try pkg-config for cursesVadim Evard1-1/+4
Static linkikng against ncurses may require explicit -ltinfo. In case -lcurses and -lncurses both didn't work give pkg-config a chance. Fixes #1094786 for me. Signed-off-by: Vadim Evard <v.e.evard@gmail.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2013-01-15block: Fix how mirror_run() frees its bufferMarkus Armbruster1-1/+1
It allocates with qemu_blockalign(), therefore it must free with qemu_vfree(), not g_free(). Signed-off-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2013-01-15win32-aio: Fix how win32_aio_process_completion() frees bufferMarkus Armbruster1-1/+1
win32_aio_submit() allocates it with qemu_blockalign(), therefore it must be freed with qemu_vfree(), not g_free(). Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Kevin Wolf <kwolf@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2013-01-15scsi-disk: qemu_vfree(NULL) is fine, simplifyMarkus Armbruster1-3/+1
Signed-off-by: Markus Armbruster <armbru@redhat.com> Acked-by: Paolo Bonzini <pbonzini@redhat.com> Reviewed-by: Kevin Wolf <kwolf@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2013-01-15w32: Make qemu_vfree() accept NULL like the POSIX implementationMarkus Armbruster1-1/+3
On POSIX, qemu_vfree() accepts NULL, because it's merely wrapper around free(). As far as I can tell, the Windows implementation doesn't. Breeds bugs that bite only under Windows. Make the Windows implementation behave like the POSIX implementation. Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Kevin Wolf <kwolf@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>