summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2010-03-19bt: remove bt_host_read_poll()Juan Quintela1-8/+1
It allways returned true, that is the equivalent of not having the callback. Signed-off-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-03-19rename IOCanRWHandler to IOCanReadHandlerJuan Quintela5-10/+9
It was always only used for reads Signed-off-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-03-19remove useless castJuan Quintela2-4/+2
values are already pointers, no need to cast them to void * Signed-off-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-03-19Convert io handlers to QLISTJuan Quintela1-21/+14
Signed-off-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-03-19CODING_STYLE: Reserve qemu_ prefix for library wrappersAvi Kivity1-0/+3
Signed-off-by: Avi Kivity <avi@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-03-18Fix OpenBSD linker warningBlue Swirl1-1/+2
qemu-option.o(.text+0x20f8): In function `qemu_opts_from_qdict_1': /src/qemu/qemu-option.c:813: warning: strcpy() is almost always misused, please use strlcpy() Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-03-18Replace assert(0) with abort() or cpu_abort()Blue Swirl13-56/+56
When building with -DNDEBUG, assert(0) will not stop execution so it must not be used for abnormal termination. Use cpu_abort() when in CPU context, abort() otherwise. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-03-18Fix manpage errorsBlue Swirl2-7/+7
Split long unbreakable lines to smaller sections. Spotted by Debian Lintian tool: http://lintian.debian.org/full/pkg-qemu-devel@lists.alioth.debian.org.html#qemu Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-03-17hw/usb-msd: fix some usb requestsArnaud Patard (Rtp)1-3/+5
The usb-msd device emulation needs some small tweaks in the requests emulations. For instance, the reset/maxlun requests are class/interface specific so requests for them with the type class and recipient interface bits sets have to be handled. Signed-off-by: Arnaud Patard <arnaud.patard@rtp-net.org> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-03-17scsi-disk: fix buffer overflowGerd Hoffmann1-1/+3
In case s->version is shorter than 4 bytes we overflow the memcpy src buffer. Fix it by clearing the target buffer, then copy only the amount of bytes we actually have. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-03-17vnc: add no-lock-key-sync optionGerd Hoffmann2-4/+13
Add an option to disable the heuristics which try to keep capslock and numlock state for guest and host in sync. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-03-17migration: unix migration should obey autostart are the other onesJuan Quintela1-0/+2
This was the only incoming migration without autostart check Signed-off-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-03-17migration: Clear fd also in error casesJuan Quintela4-10/+8
Not clearing the fd and closing the file makes qemu spin using 100%CPU after incoming migration error. See for instance bug: https://bugzilla.redhat.com/show_bug.cgi?id=518032 Signed-off-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-03-17read-only: Another minor cleanupNaphtali Sprei1-2/+1
Don't rely on CDROM hint for read_only attribute Signed-off-by: Naphtali Sprei <nsprei@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-03-17read-only: minor cleanupNaphtali Sprei1-0/+1
Really use read-only flags for opening the file when asked for read-only Signed-off-by: Naphtali Sprei <nsprei@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-03-17split out qemu-timer.cPaolo Bonzini7-1167/+1237
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-03-17disentangle tcg and deadline calculationPaolo Bonzini3-11/+20
Just tell main_loop_wait whether to be blocking or nonblocking, so that there is no need to call qemu_cpus_have_work from the timer subsystem. Instead, tcg_cpu_exec can say "we want the main loop not to block because we have stuff to do". Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-03-17place together more #ifdef CONFIG_IOTHREAD blocksPaolo Bonzini1-41/+37
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-03-17move vmstate registration of vmstate_timers earlierPaolo Bonzini1-31/+31
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-03-17new function qemu_icount_deltaPaolo Bonzini1-11/+18
Tweaking the rounding in qemu_next_deadline ensures that there's no change whatsoever. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-03-17add qemu_alarm_pendingPaolo Bonzini1-3/+8
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-03-17add qemu_icount_roundPaolo Bonzini1-6/+7
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-03-17centralize handling of -icountPaolo Bonzini1-14/+19
A simple patch to place together all handling of -icount. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-03-17introduce and use qemu_clock_enablePaolo Bonzini1-2/+14
By adding the possibility to turn on/off a clock, yet another incestuous relationship between timers and CPUs can be disentangled. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-03-17change qemu_run_timers interfacePaolo Bonzini1-10/+8
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-03-17extract timer handling out of main_loop_waitPaolo Bonzini1-22/+25
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-03-17remove qemu_rearm_alarm_timer from main loopPaolo Bonzini1-1/+7
Make the timer subsystem register its own callback instead. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-03-17tweak qemu_notify_eventPaolo Bonzini1-7/+3
Instead of testing specially next_cpu in host_alarm_handler, just do that in qemu_notify_event. The idea is, if we are not running (or not yet running) target CPU code, prepare things so that the execution loop is exited asap; just make that clear. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-03-17do not use qemu_event_increment outside qemu_notify_eventPaolo Bonzini1-1/+2
qemu_notify_event in the non-iothread case is only stopping the current CPU. However, if the CPU is idle and the main loop is in the select call then a call to qemu_event_increment is needed too (as done in host_alarm_handler). Since in general one doesn't know whether the CPU is executing or not, it is a safe bet to always do qemu_event_increment. Another way to see it: after this patch qemu_event_increment is the "common part" of qemu_notify_event for both the CONFIG_IOTHREAD and !CONFIG_IOTHREAD cases, which makes sense. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-03-17more alarm timer cleanupPaolo Bonzini1-11/+18
The timer_alarm_pending variable is related to the alarm timer but not placed in the struct. Also, in qemu_mod_timer the wrong flag was being tested: the timer is rearmed in the alarm timer "bottom half", so the right flag to test there is the "pending" flag. Finally, I hoisted the NULL checks from alarm_has_dynticks to host_alarm_handler. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-03-17only one flag is needed for alarm_timerPaolo Bonzini1-16/+15
The ALARM_FLAG_DYNTICKS can be testing simply by checking if there is a rearm function. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-03-17fix error in win32_rearm_timerPaolo Bonzini1-1/+1
The TIME_ONESHOT and TIME_PERIODIC flags are mutually exclusive. The code after the patch matches the flags used in win32_start_timer. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-03-17avoid dubiously clever code in win32_start_timerPaolo Bonzini1-4/+2
The code is initializing an unsigned int to UINT_MAX using "-1", so that the following always-true comparison seems to be always-false at a first look. Since alarm timer initializations are never nested, it is simpler to unconditionally store the result of timeGetDevCaps into data->period. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-03-17balloon: Do not save VM state wrt asynchronous virtio operationsAdam Litke1-9/+0
When working with the VM state (for loadvm/savevm and migration), it is not valid to load and store pointers since the validity of those pointers cannot be assured in the new qemu address space. Therefore, virtio_balloon_save() and virtio_balloon_load() must not handle the stats-related fields in struct VirtIOBalloon. If a memory stats request is in-flight at the time of a migration or savevm, the request will not complete and should be resubmitted once migration or loadvm completes. Note that this extremely small race window can only be triggered using QMP so it is not possible to hang the user monitor. Signed-off-by: Adam Litke <agl@us.ibm.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-03-17block: add logical_block_size propertyChristoph Hellwig4-9/+29
Add a logical block size attribute as various guest side tools only increase the filesystem sector size based on it, not the advisory physical block size. For scsi we already have support for a different logical block size in place for CDROMs that we can built upon. Only my recent block device characteristics VPD page needs some fixups. Note that we leave the logial block size for CDROMs hardcoded as the 2k value is expected for it in general. For virtio-blk we already have a feature flag claiming to support a variable logical block size that was added for the s390 kuli hypervisor. Interestingly it does not actually change the units in which the protocol works, which is still fixed at 512 bytes, but only communicates a different minimum I/O granularity. So all we need to do in virtio is to add a trap for unaligned I/O and round down the device size to the next multiple of the logical block size. IDE does not support any other logical block size than 512 bytes. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-03-17Avoid crash on '-usbdevice <device>' without parametersJan Kiszka1-1/+3
Many usbdevice_init implementors assume params is non-NULL. Signed-off-by: Jan Kiszka <jan.kiszka@web.de> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-03-17Fix SIGFPE for vnc display of width/height = 1Chris Webb1-2/+4
During boot, the screen gets resized to height 1 and a mouse click at this point will cause a division by zero when calculating the absolute pointer position from the pixel (x, y). Return a click in the middle of the screen instead in this case. Signed-off-by: Chris Webb <chris@arachsys.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-03-17usb-linux: remove unreachable default in switch statementPaul Bolle1-3/+0
Signed-off-by: Paul Bolle <pebolle@tiscali.nl> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-03-17sdl: improve error message on fatal errorBjørn Mork1-1/+2
The SDL_SetVideoMode() error condition is easily triggered by a user by simply configure a guest with a host unsupported display resolution and attempting to enable fullscreen. Since the error is fatal, adding a bit of debugging help can't harm. Sample output with this change: (qemu) Could not open SDL display (1280x1024x32): No video mode large enough for 1280x1024 The width x height might seem redundant as SDL also provides it in SDL_GetError(), but I believe there are situations where it is useful. I.e. if there is some other SDL error. Anyway, redundant information in fatal error messages has never harmed a single gerbil. Signed-off-by: Bjørn Mork <bjorn@mork.no> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-03-17Wrong error message in block_passwd commandShahar Havivi2-3/+11
Signed-off-by: Shahar Havivi <shaharh@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-03-17QError: New QERR_DEVICE_NOT_ENCRYPTEDShahar Havivi2-0/+7
Signed-off-by: Shahar Havivi <shaharh@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-03-17Merge remote branch 'markus/qerror' into stagingAnthony Liguori45-533/+1007
2010-03-17Merge remote branch 'mst/pci' into stagingAnthony Liguori2-62/+35
2010-03-17Large page TLB flushPaul Brook14-80/+136
QEMU uses a fixed page size for the CPU TLB. If the guest uses large pages then we effectively split these into multiple smaller pages, and populate the corresponding TLB entries on demand. When the guest invalidates the TLB by virtual address we must invalidate all entries covered by the large page. However the address used to invalidate the entry may not be present in the QEMU TLB, so we do not know which regions to clear. Implementing a full vaiable size TLB is hard and slow, so just keep a simple address/mask pair to record which addresses may have been mapped by large pages. If the guest invalidates this region then flush the whole TLB. Signed-off-by: Paul Brook <paul@codesourcery.com>
2010-03-16monitor: convert do_device_add() to QObjectMarkus Armbruster3-10/+37
2010-03-16monitor: Use argument type 'O' for device_addMarkus Armbruster2-4/+3
While there, improve the params help text.
2010-03-16monitor: New argument type 'O'Markus Armbruster1-4/+50
In the human monitor, it declares a single optional argument to be parsed according to the QemuOptsList given by its name. In QMP, it declares an optional argument for each member of the QemuOptsList. Restriction: only lists with empty desc are supported for now. Good enough for the job at hand. We'll lift the restriction when we need that.
2010-03-16qemu-option: Rename find_list() to qemu_find_opts() & external linkageMarkus Armbruster2-4/+5
Next commit wants to use it.
2010-03-16qemu-option: Move the implied first name into QemuOptsListMarkus Armbruster8-13/+24
We sometimes permit omitting the first option name, for example -device foo is short for -device driver=foo. The name to use ("driver" in the example) is passed as argument to qemu_opts_parse(). For each QemuOptsList, we use at most one such name. Move the name into QemuOptsList, and pass whether to permit the abbreviation. This ensures continued consistency, and simplifies the commit after next in this series.
2010-03-16qemu-option: Functions to convert to/from QDictMarkus Armbruster2-0/+82
The functions are somewhat restricted. Good enough for the job at hand. We'll extend them when we need more.