aboutsummaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)AuthorFilesLines
2010-02-03QDict: New qdict_get_double()Markus Armbruster3-1/+26
Helper function just like qdict_get_int(), just for QFloat/double. Signed-off-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-02-03monitor: Document argument type 'M'Markus Armbruster1-0/+2
Was forgotten in commit b6e098d7. Signed-off-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-02-03seabios: use correct submodule hashAnthony Liguori1-0/+0
Commit 392ecf543dd2b219828374850d833296a55567ea introduced an accidental change to the roms/seabios submodule. This commit partially reverts that commit to ensure the seabios module points to the right commit. Reported-by: Marcelo Tosatti <mtosatti@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-01-31bsd/darwin-user: mmap_frag() users only check for -1 errorBlue Swirl2-2/+2
See also ee636500d6eab44b83f09cb730b67226b70423b1. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-01-31cris: Prettify register dumps.Edgar E. Iglesias1-2/+2
Use friendly names for registers in the dumps. Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
2010-01-31sparc32 don't mark page dirty when failingArtyom Tarasenko1-5/+6
if the access check fails, the page can not be modified and shouldn't be marked dirty. The patch fixes the "hsfs_putpage: dirty HSFS page" error in Solaris guests. Signed-off-by: Artyom Tarasenko <atar4qemu@gmail.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-01-30sparc64: implement basic IOMMU/interrupt handlingBlue Swirl1-22/+142
Also add reset control. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-01-29Sparc64: byte swap IO port accessBlue Swirl1-4/+4
This requires an updated OpenBIOS image. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-01-29virtio-blk: Fix error cases which ignored rerror/werrorKevin Wolf1-2/+2
If an I/O request fails right away instead of getting an error only in the callback, we still need to consider rerror/werror. Signed-off-by: Kevin Wolf <kwolf@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-01-29virtio-blk: Fix restart after read errorKevin Wolf1-2/+9
Current code assumes that only write requests are ever going to be restarted. This is wrong since rerror=stop exists. Instead of directly starting writes, use the same request processing as used for new requests. Signed-off-by: Kevin Wolf <kwolf@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-01-29virtio_blk: Factor virtio_blk_handle_request outKevin Wolf1-32/+46
We need a function that handles a single request. Create one by splitting out code from virtio_blk_handle_output. Signed-off-by: Kevin Wolf <kwolf@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-01-29cirrus: Properly re-register cirrus_linear_io_addr on vram unmapJan Kiszka1-2/+4
This fixes CONFIG_FB_CIRRUS for Linux guests and probably much more: When switching away from linearly mapped vram, we also have to restore the I/O handlers for the LFB. This regression was once introduced by commit 2bec46dc97. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-01-29virtio-serial-bus: Fix bus initialisation and allow for bus identificationAmit Shah1-2/+1
This commit enables one to use multiple virtio-serial devices and to assign ports to arbitrary devices like this: -device virtio-serial,id=foo -device virtio-serial,id=bar \ -device virtserialport,bus=foo.0,name=foo \ -device virtserialport,bus=bar.0,name=bar Signed-off-by: Amit Shah <amit.shah@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-01-28softmmu: Dont clobber retaddr in slow_ldx().Edgar E. Iglesias1-1/+0
When splitting up unaligned IO accesses, ld calls slow_ld which was clobbering retaddr. AFAIK the problem only shows up when running emulations with -icount that may abort TB execution on IO accesses. Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
2010-01-28Solaris: test for presence of commands with has()Loïc Minier1-5/+7
Signed-off-by: Loïc Minier <lool@dooz.org> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-01-28Add and use has() and path_of() funcsLoïc Minier1-9/+43
Add has() and path_of() funcs and use them across configure; has() will test whether a command or builtin is available; path_of() will search the PATH for executables and return the full pathname if found. Signed-off-by: Loïc Minier <lool@dooz.org Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-01-28Check for sdl-config before calling itLoïc Minier1-1/+6
Check whether sdl-config is available before calling it, otherwise ./configure triggers a warning: ./configure: 957: sdl-config: not found If neither the .pc file not sdl-config are present, disable SDL support. Signed-off-by: Loïc Minier <lool@dooz.org> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-01-28Monitor: Fix command execution regressionLuiz Capitulino1-1/+5
Function is_async_return() added by commit 940cc30d0d4 assumes that 'data', which is returned by handlers, is always a QDict. This is not true, as QLists can also be returned, in this case we'll get a segfault. Fix that by checking if 'data' is a QDict. Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-01-27sparc64: reimplement tick timers v4Igor V. Kovalenko3-46/+202
sparc64 timer has tick counter which can be set and read, and tick compare value used as deadline to fire timer interrupt. The timer is not used as periodic timer, instead deadline is set each time new timer interrupt is needed. v3 -> v4: - coding style v2 -> v3: - added missing timer debug output macro - CPUTimer struct and typedef moved to cpu.h - change CPU_SAVE_VERSION to 6, older save formats not supported v1 -> v2: - new conversion helpers cpu_to_timer_ticks and timer_to_cpu_ticks - save offset from clock source to implement cpu_tick_set_count - renamed struct sun4u_timer to CPUTimer - load and save cpu timers v0 -> v1: - coding style Signed-off-by: Igor V. Kovalenko <igor.v.kovalenko@gmail.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-01-27sparc64: correct write extra bits to cwpIgor V. Kovalenko1-1/+1
- correctly fit to cwp if provided window number is out of range Signed-off-by: Igor V. Kovalenko <igor.v.kovalenko@gmail.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-01-27Fix BSD buildBlue Swirl1-0/+3
<sys/wait.h> must be included in order to use WIF* macros. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-01-27Fix regression in option parsingAnthony Liguori1-0/+1
Commit ec229bbe7 broke invocation without a specific -hda. IOW, qemu foo.img. The lack of an optind update caused an infinite loop. Reported-by: Amit Shah <amit.shah@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-01-27pflash: Buffer block writesEdgar E. Iglesias1-3/+9
Buffer block writes to avoid flushing every word access onto backing storage device. This significantly speeds up flash emulation for flashes connected through an 8 or 16-bit bus combined with backing storage (-pflash). Signed-off-by: Edgar E. Iglesias <edgar.iglesias@petalogix.com>
2010-01-26virtio: Add memory statistics reporting to the balloon driverAdam Litke6-52/+219
When using ballooning to manage overcommitted memory on a host, a system for guests to communicate their memory usage to the host can provide information that will minimize the impact of ballooning on the guests. The current method employs a daemon running in each guest that communicates memory statistics to a host daemon at a specified time interval. The host daemon aggregates this information and inflates and/or deflates balloons according to the level of host memory pressure. This approach is effective but overly complex since a daemon must be installed inside each guest and coordinated to communicate with the host. A simpler approach is to collect memory statistics in the virtio balloon driver and communicate them directly to the hypervisor. Signed-off-by: Adam Litke <agl@us.ibm.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-01-26New API for asynchronous monitor commandsAdam Litke2-4/+111
Qemu has a number of commands that can operate asynchronously (savevm, migrate, etc) and it will be getting more. For these commands, the user monitor needs to be suspended, but QMP monitors could continue to to accept other commands. This patch introduces a new command API that isolates the details of handling different monitor types from the actual command execution. A monitor command can use this API by implementing the mhandler.cmd_async handler (or info_async if appropriate). This function is responsible for submitting the command and does not return any data although it may raise errors. When the command completes, the QMPCompletion callback should be invoked with its opaque data and the command result. The process for submitting and completing an asynchronous command is different for QMP and user monitors. A user monitor must be suspended at submit time and resumed at completion time. The user_print() function must be passed to the QMPCompletion callback so the result can be displayed properly. QMP monitors are simpler. No submit time setup is required. When the command completes, monitor_protocol_emitter() writes the result in JSON format. This API can also be used to implement synchronous commands. In this case, the cmd_async handler should immediately call the QMPCompletion callback. It is my hope that this new interface will work for all commands, leading to a drastically simplified monitor.c once all commands are ported. Signed-off-by: Adam Litke <agl@us.ibm.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-01-26block: avoid creating too large iovecs in multiwrite_mergeChristoph Hellwig2-0/+8
If we go over the maximum number of iovecs support by syscall we get back EINVAL from the kernel which translate to I/O errors for the guest. Add a MAX_IOV defintion for platforms that don't have it. For now we use the same 1024 define that's used on Linux and various other platforms, but until the windows block backend implements some kind of vectored I/O it doesn't matter. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-01-26vnc_refresh: calling vnc_update_client might free vsStefano Stabellini1-2/+4
Hi all, this patch fixes another bug in vnc_refresh: calling vnc_update_client might cause vs to be free()ed, in this case we cannot access vs->next right after to examine the next item on the list. Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-01-26block/raw-posix: Abort on pread beyond end of non-growable fileKevin Wolf1-1/+5
This shouldn't happen under any normal circumstances. However, it looks like it's possible to achieve this with corrupted images. Without this patch raw_pread is hanging in an endless loop in such cases. The patch is not affecting growable files, for which such reads happen in normal use cases. raw_pread_aligned already handles these cases and won't return zero in the first place. Signed-off-by: Kevin Wolf <kwolf@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-01-26win32: pair qemu_memalign() with qemu_vfree()Herve Poussineau5-5/+5
Win32 suffers from a very big memory leak when dealing with SCSI devices. Each read/write request allocates memory with qemu_memalign (ie VirtualAlloc) but frees it with qemu_free (ie free). Pair all qemu_memalign() calls with qemu_vfree() to prevent such leaks. Signed-off-by: Herve Poussineau <hpoussin@reactos.org> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-01-26win32/sdl: Fix toggle full screenHerve Poussineau1-0/+1
Toggle full screen on Win32/SDL 1.2.13 was broken by commit c18a2c360e3100bbd71162cf922dcd8c429a8b71. Re-add the call to do_sdl_resize() which was removed in this revision Signed-off-by: Herve Poussineau <hpoussin@reactos.org> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-01-26Tell users about out-of-memory errorsStefan Weil1-1/+9
Aborting without an error message when memory is short is not helpful, so print the reason for the abort. Try qemu -m 1000000 or qemu -m 2000 (win32) to force an out-of-memory error. v2: * Fix error message for win32. * Fix error message for posix_memalign. Thanks to malc for the hints. Signed-off-by: Stefan Weil <weil@mail.berlios.de> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-01-26PCI: fix bridge configurationBlue Swirl4-0/+4
PCI bridges' qdev info structures must indicate bridge header type, otherwise critical bridge registers (esp. PCI_PRIMARY_BUS, PCI_SECONDARY_BUS, PCI_SUBORDINATE_BUS) will not be writable. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-01-26fix savevm command without id or tagMarcelo Tosatti1-1/+1
savevm without id or tag segfaults in: (gdb) bt #0 0x00007f600a83bf8a in __strcmp_sse42 () from /lib64/libc.so.6 #1 0x00000000004745b6 in bdrv_snapshot_find (bs=<value optimized out>, sn_info=0x7fff996be280, name=0x0) at savevm.c:1631 #2 0x0000000000475c80 in del_existing_snapshots (name=<value optimized out>, mon=<value optimized out>) at savevm.c:1654 #3 do_savevm (name=<value optimized out>, mon=<value optimized out>) Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-01-26qcow2: rename two QCowAIOCB membersChristoph Hellwig1-29/+30
The n member is not very descriptive and very hard to grep, rename it to cur_nr_sectors to better indicate what it is used for. Also rename nb_sectors to remaining_sectors as that is what it is used for. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-01-26block: kill BDRV_O_CREATChristoph Hellwig5-28/+7
The BDRV_O_CREAT option is unused inside qemu and partially duplicates the bdrv_create method. Remove it, and the -C option to qemu-io which isn't used in qemu-iotests anyway. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-01-26block: clean up bdrv_open2 structure a bitChristoph Hellwig1-12/+19
Check the whitelist as early as possible instead of continuing the setup, and move all the error handling code to the end of the function. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-01-26virtio-console: Automatically use virtio-serial-bus for the older ↵Amit Shah2-2/+13
-virtioconsole invocation These hunks got dropped off mysteriously during the rebasing of my virtio-serial series. Thanks go to Markus for noticing it. Without these fixes, -virtioconsole doesn't actually have any effect. Signed-off-by: Amit Shah <amit.shah@redhat.com> Reported-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-01-26virtio-console: Rename virtio-serial.c back to virtio-console.cAmit Shah2-1/+1
This file was renamed to ease the reviews of the recent changes that went in. Now that the changes are done, rename the file back to its original name. Signed-off-by: Amit Shah <amit.shah@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-01-26Fix generation of config-host.hJuan Quintela1-12/+5
This patch improves Anthony patch a6a853c86275efd89996ce59612a000c5873db5d Once there, it improves handling of object files for qemu tools cc: Andreas Färber <andreas.faerber@web.de> Signed-off-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-01-26ide save/restore current transfer fieldsMarcelo Tosatti1-2/+6
If migration takes place between write of the bmdma address register and write of the command register (to initiate DMA), the destination will not properly start the DMA op, hanging the guest: ata1.00: exception Emask 0x0 SAct 0x0 SErr 0x0 action 0x6 frozen ata1.00: cmd c8/00:16:41:00:00/00:00:00:00:00/e0 tag 0 dma 11264 in res 40/00:00:00:00:00/00:00:00:00:00/00 Emask 0x4 (timeout) ata1.00: status: { DRDY } Fix by sending current transfer information in the migration data. We need to update ide version to 4 for this to work. As we don't have subsectios, we need to chain the update increase until vmstate_ide_pci (quintela) Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com> Signed-off-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-01-26PCI: do_pci_info(): PCI bridge devices supportLuiz Capitulino1-3/+20
This commit completes the do_pci_info() conversion to QObject by adding support to PCI bridge devices. This is done by recursively adding devices in the "pci_bridge" key. IMPORTANT: This code is being added separately because I could NOT test it properly. According to Michael Tsirkin, it depends on ultrasparc and it would take time to do the proper setup. Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-01-26PCI: Convert pci_info() to QObjectLuiz Capitulino3-76/+301
The returned QObject is a QList of all buses. Each bus is represented by a QDict, which has a key with a QList of all PCI devices attached to it. Each device is represented by a QDict. As has happended to other complex conversions, it's hard to split this commit as part of it are new functions which are called by each other. IMPORTANT: support for printing PCI bridge attached devices is NOT part of this commit, it's going to be added by the next commit, as it's untested. Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-01-26QDict: Introduce qdict_get_qdict()Luiz Capitulino2-0/+14
A helper to retrieve a QDict from a QDict. Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-01-26QList: Introduce QLIST_FOREACH_ENTRY()Luiz Capitulino1-0/+10
Iterate over QList entries, it's needed to call qlist_entry_obj() to retrieve the stored QObject. I'm not sure if it's ok to have this, because it's not as easy as qlist_iter() and the QListEntry data type is now exposed to the users, which means we have one more struct to be maintained when we have libqmp. Adding anyway, as it's more compact and people are asking for it. Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-01-26Read-only device changed to opens it's file for read-only.Naphtali Sprei2-8/+4
Signed-off-by: Naphtali Sprei <nsprei@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-01-26Ask for read-write permissions when opening filesNaphtali Sprei3-4/+4
Found some places that seems needs this explicitly, now that read-write is not the default. Signed-off-by: Naphtali Sprei <nsprei@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-01-26No need anymoe for bdrv_set_read_onlyNaphtali Sprei2-8/+0
Signed-off-by: Naphtali Sprei <nsprei@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-01-26Documentation: Add missing texi description for command line optionsStefan Weil1-0/+35
Some more command line options had entries for command line help, but documentation for texi and derived formats (man, html, info) was missing. For conditional options, the texi documentation was added unconditionally. This seems reasonable because typically man pages are shared, and html users expect to see one documentation (not several nearly identical documents for the different systems). Signed-off-by: Stefan Weil <weil@mail.berlios.de> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-01-26Documentation: Improve command line help for -device optionStefan Weil1-4/+13
* Fix column for help text. * Give some more help, especially for the new '?' parameters. Signed-off-by: Stefan Weil <weil@mail.berlios.de> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-01-26qdev: Add help for property valueStefan Weil1-2/+7
When called with property value "?", a help text will be printed (instead of an error message). This is useful for command lines like qemu -device e1000,mac=? and is already standard for other command line options. A better help text could be provided by extending the Property structure with a desc field. Signed-off-by: Stefan Weil <weil@mail.berlios.de> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>