place together more #ifdef CONFIG_IOTHREAD blocks
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
disentangle tcg and deadline calculation
Just tell main_loop_wait whether to be blocking or nonblocking, so thatthere 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...
only one flag is needed for alarm_timer
The ALARM_FLAG_DYNTICKS can be testing simply by checking if there isa rearm function.
more alarm timer cleanup
The timer_alarm_pending variable is related to the alarm timer but notplaced in the struct. Also, in qemu_mod_timer the wrong flag was beingtested: the timer is rearmed in the alarm timer "bottom half", so theright flag to test there is the "pending" flag....
do not use qemu_event_increment outside qemu_notify_event
qemu_notify_event in the non-iothread case is only stopping the currentCPU. However, if the CPU is idle and the main loop is in the selectcall then a call to qemu_event_increment is needed too (as done in...
tweak qemu_notify_event
Instead of testing specially next_cpu in host_alarm_handler, just dothat in qemu_notify_event. The idea is, if we are not running (ornot yet running) target CPU code, prepare things so that the executionloop is exited asap; just make that clear....
remove qemu_rearm_alarm_timer from main loop
Make the timer subsystem register its own callback instead.
extract timer handling out of main_loop_wait
change qemu_run_timers interface
introduce and use qemu_clock_enable
By adding the possibility to turn on/off a clock, yet anotherincestuous relationship between timers and CPUs can be disentangled.
centralize handling of -icount
A simple patch to place together all handling of -icount.
add qemu_icount_round
add qemu_alarm_pending
new function qemu_icount_delta
Tweaking the rounding in qemu_next_deadline ensures that there'sno change whatsoever.
move vmstate registration of vmstate_timers earlier
avoid dubiously clever code in win32_start_timer
The code is initializing an unsigned int to UINT_MAX using "-1", so thatthe following always-true comparison seems to be always-false at afirst look. Since alarm timer initializations are never nested, it is...
fix error in win32_rearm_timer
The TIME_ONESHOT and TIME_PERIODIC flags are mutually exclusive.The code after the patch matches the flags used in win32_start_timer.
balloon: Do not save VM state wrt asynchronous virtio operations
When working with the VM state (for loadvm/savevm and migration), it is notvalid to load and store pointers since the validity of those pointers cannot beassured in the new qemu address space. Therefore, virtio_balloon_save() and...
block: add logical_block_size property
Add a logical block size attribute as various guest side tools onlyincrease the filesystem sector size based on it, not the advisoryphysical block size.
For scsi we already have support for a different logical block size...
Avoid crash on '-usbdevice <device>' without parameters
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>
Fix SIGFPE for vnc display of width/height = 1
During boot, the screen gets resized to height 1 and a mouse click at thispoint will cause a division by zero when calculating the absolute pointerposition from the pixel (x, y). Return a click in the middle of the screen...
usb-linux: remove unreachable default in switch statement
Signed-off-by: Paul Bolle <pebolle@tiscali.nl>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Wrong error message in block_passwd command
Signed-off-by: Shahar Havivi <shaharh@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
sdl: improve error message on fatal error
The SDL_SetVideoMode() error condition is easily triggered by a user bysimply configure a guest with a host unsupported display resolutionand attempting to enable fullscreen. Since the error is fatal, addinga bit of debugging help can't harm....
QError: New QERR_DEVICE_NOT_ENCRYPTED
Merge remote branch 'markus/qerror' into staging
Merge remote branch 'mst/pci' into staging
Large page TLB flush
QEMU uses a fixed page size for the CPU TLB. If the guest uses largepages then we effectively split these into multiple smaller pages, andpopulate the corresponding TLB entries on demand.
When the guest invalidates the TLB by virtual address we must invalidate...
qemu-option: Rename find_list() to qemu_find_opts() & external linkage
Next commit wants to use it.
monitor: New argument type 'O'
In the human monitor, it declares a single optional argument to beparsed according to the QemuOptsList given by its name.
In QMP, it declares an optional argument for each member of theQemuOptsList.
Restriction: only lists with empty desc are supported for now. Good...
monitor: Use argument type 'O' for device_add
While there, improve the params help text.
monitor: convert do_device_add() to QObject
qdev: Relax parsing of bus option
Treat multiple successive slashes as a one slash. Ignore trailingslashes. This is how POSIX pathnames work.
error: New QERR_BUS_NOT_FOUND
error: New QERR_DEVICE_MULTIPLE_BUSSES
error: New QERR_DEVICE_NO_BUS
qdev: Convert qbus_find() to QError
error: New error_printf_unless_qmp()
error: New QERR_BAD_BUS_FOR_DEVICE
error: New QERR_BUS_NO_HOTPLUG
error: New QERR_DEVICE_INIT_FAILED
error: New QERR_NO_BUS_FOR_DEVICE
Revert "qdev: Use QError for 'device not found' error"
This reverts commit 3ced9f7a36189aed94d8bf86f3f5087a53012455.
The next commit will convert all of qdev_device_add() to QError, andit'll be clearer with this partial conversion reverted.
error: Convert do_device_add() to QError
Conversion to QObject is still missing.
qemu-option: Functions to convert to/from QDict
The functions are somewhat restricted. Good enough for the job athand. We'll extend them when we need more.
qemu-option: Move the implied first name into QemuOptsList
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()....
error: New QERR_PROPERTY_VALUE_IN_USE
error: New QERR_PROPERTY_VALUE_NOT_FOUND
qdev: convert setting device properties to QError
qdev: Hide "ptr" properties from users
Users can't set them, so qdev_device_help() shouldn't list them. Fixthat. Also make qdev_prop_parse() hide them instead of printing ameaningless "has no parser" error message.
Their value means nothing to users, so qdev_print_props() shouldn't...
monitor: New monitor_cur_is_qmp()
error: Let converted handlers print in human monitor
While fully converted handlers are not supposed to print anything whenrunning in a QMP monitor, they are free to print in a human monitor.For instance, device_add (not yet converted) prints help, and will...
error: Polish human-readable error descriptions
Also put error definitions in alphabetical order
error: New QERR_PROPERTY_NOT_FOUND
error: New QERR_PROPERTY_VALUE_BAD
error: Replace qemu_error() by error_report()
error_report() terminates the message with a newline. Strip it itfrom its arguments.
This fixes a few error messages lacking a newline:net_handle_fd_param()'s "No file descriptor named %s found", andtap_open()'s "vnet_hdr=1 requested, but no kernel support for...
error: Rename qemu_error_new() to qerror_report()
error: Infrastructure to track locations for error reporting
New struct Location holds a location. So far, the only location isLOC_NONE, so this doesn't do anything useful yet.
Passing the current location all over the place would be toocumbersome. Hide it away in static cur_loc instead, and provide...
error: Include the program name in error messages to stderr
error: Track locations in configuration files
New LOC_FILE. Use it for tracking file name and line number inqemu_config_parse(). We now report errors like
qemu:foo.conf:42: Did not find I2C bus for smbus-eeprom
In particular, gems like this message:...
QemuOpts: Fix qemu_config_parse() to catch file read errors
error: Track locations on command line
New LOC_CMDLINE. Use it for tracking option with argument inlookup_opt(). We now report errors like this
qemu: -device smbus-eeprom: Did not find I2C bus for smbus-eeprom
qdev: Fix -device and device_add to handle unsuitable bus gracefully
"device_add isa-serial,bus=pci.0" kills QEMU. Not good.
qdev: Factor qdev_create_from_info() out of qdev_create()
To make it obvious that -device and device_add can't die inhw_error().
qdev: Hide "no_user" devices from users
Users can't create them, so qdev_device_help() shouldn't list them.Fix that.
Also make qdev_device_add() pretend they don't exist. Before, itrejected them with a "can't be added via command line" message, which...
error: Don't abuse qemu_error() for non-error in scsi_hot_add()
Commit 30d335d6 converted an informational message frommonitor_printf() to qemu_error(), probably because the latter doesn'tneed a mon argument. A later commit will make qemu_error() print...
savevm: Fix -loadvm to report errors to stderr, not the monitor
A monitor may not even exist.
Change load_vmstate() to use qemu_error() instead of monitor_printf().Parameter mon is now unused, remove it.
pc: Fix error reporting for -boot once
Commit 0ecdffbb created pc_boot_set() for use from monitor command"boot_set", via qemu_boot_set(). pc_boot_set() reports errors tocur_mon, which works fine for monitor code.
Commit e0f084bf reused the function int reset handler...
pc: Factor common code out of pc_boot_set() and cmos_init()
Code duplicated in commit 0ecdffbb. The two versions are similar, butnot identical:
tools: Remove unused cur_mon from qemu-tool.c
monitor: Separate "default monitor" and "current monitor" cleanly
Commits 376253ec..731b0364 introduced global variable cur_mon, whichpoints to the "default monitor" (if any), except during execution ofmonitor_read() or monitor_control_read() it points to the monitor from...
block: Simplify usb_msd_initfn() test for "can read bdrv key"
The old test assumes that "hotplugged" implies "we have a currentmonitor for reading the key". This is in fact true, but it's notobviously true.
Aside: if it were false, we could pass a null pointer to...
monitor: Factor monitor_set_error() out of qemu_error_internal()
This separates the monitor part from the QError part.
error: Move qemu_error() & friends from monitor.c to own file
They're about reporting errors, not about the monitor.
error: Simplify error sink setup
qemu_error_sink can either point to a monitor or a file. In practice,it always points to the current monitor if we have one, else tostderr. Simply route errors to the current monitor or else to stderr,and remove qemu_error_sink along with the functions to control it....
error: Move qemu_error & friends into their own header
error: New error_printf() and error_vprintf()
error: Don't abuse qemu_error() for non-error in qdev_device_help()
qdev_device_help() prints device information with qemu_error(). Alater commit will make qemu_error() print additional stuff that isonly appropriate for proper errors, and then this will break. Use...
error: Don't abuse qemu_error() for non-error in qbus_find()
qbus_find() adds an informational line to error messages, and printsboth lines with one qemu_error(). Use error_printf() for theinformational line instead.
While there, simplify: instead of printing buffers filled by...
usb: Remove disabled monitor_printf() in usb_read_file()
The monitor_printf() reports failure. Printing is wrong, because thecaller tries various arguments, and expects the function to fail forsome or all.
Disabled since commit 26a9e82a. Remove it.
load_elf: replace the address addend by a translation function
A few machines need to translate the ELF header addresses into physicaladdresses. Currently the only possibility is to add a value to theaddresses.
This patch replaces the addend argument by and a translation function...
pcnet: make subsystem vendor id match hardware
Real pcnet device (AT2450) apparently has subsystemdevice and vendor id set to 0, this is out of spec(which requires that vendor id is obtained from PCI SIG)but windows xp driver seems to need this in order...
eepro100: address pci todo's, use pci_set_xx
eepro100 uses macros which rely on a specificlocal variable name (pci_conf) which is scary.Some of the uses are wrong or unnecessary,remove them. The rest are small in number, open-codethem using pci_set_xx functions....
qemu-img rebase: Document -f option
The option was implemented in e53dbee0, but I forgot documenting it.
Signed-off-by: Kevin Wolf <kwolf@redhat.com>Reviewed-by: Christoph Hellwig <hch@lst.de>Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
mips: add header to mips_int.c and mips_timer.c
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
tcg: declare internal helpers as const and pure
TCG internal helpers only access to the values passed in arguments, anddo not modify the CPU internal state. Thus they can be declared asconst and pure.
Fix corner case in chardev udp: parameter
The missing '' broke 'udp::<port>:<port>' parsing.
' broke 'udp::<port>
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
Don't set default monitor when there is a mux'ed one
This fixes eg. "-nographic -serial mon:stdio [-serial ...]".
tcg/arm: use helpers for divu/remu
tcg: add div/rem 32-bit helpers
Some targets like ARM would benefit to use 32-bit helpers fordiv/rem/divu/remu.
Create a #define for div2 so that targets can select betweendiv, div2 and helper implementation. Use the helper version if noneof the #define are present....
Fix pagetable code
The multi-level pagetable code fails to iterate ove all entries becauseof the L2_BITS v.s. L2_SIZE thinko.
Signed-off-by: Paul Brook <paul@codesourcery.com>
spelling typo (compatibilty) in hw/fw_cfg.c
here's a trivial patch to fix the spelling of "compatibility":
Signed-off-by: Vagrant Cascadian <vagrant@freegeek.org>Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
x86/cpuid: add missing CPUID feature flag names
Some CPUID feature flags had no string value, so they could not beswitched on or off from the command line.Add names for the missing ones mentioned in the current public CPUIDspecification from both Intel and AMD. Those only mentioned in the...
x86/cpuid: add "host" to the list of supported CPU models
Signed-off-by: Andre Przywara <andre.przywara@amd.com>Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
x86/cpuid: remove unnecessary kvm_trim function
Correct me if I am wrong, but kvm_trim looks like a really bloatedimplementation of a bitwise AND. So remove this function and replaceit with the real stuff(TM).
Signed-off-by: Andre Przywara <andre.przywara@amd.com>...
x86/cpuid: add TCG feature bit trimming
In KVM we trim the user provided CPUID bits to match the host CPU'sone. Introduce a similar feature to QEMU/TCG. Create a mask of TCG'scapabilities and apply it to the user bits.This allows to let the CPU models reflect their native archetypes....
x86/cpuid: Always expose 32 and 64-bit CPUs
Since 64-bit capability is just another CPUID bit we now properlymask, there is no reason anymore to hide the 64-bit capable CPUmodels from a 32-bit only QEMU. All 64-bit CPUs can be usedperfectly in 32-bit legacy mode anyway, so these models also make...
x86/cpuid: fix CPUID levels
Bump up the xlevel number for qemu32 to allow parsing of the processorname string for this model.Similiarly the 486 processor should have at least the feature bitleaf enabled.
x86/cpuid: Enable all features of real CPU
Enable all features of real CPU, unsupported features will betrimmed depending on TCG or KVM capabilities.
Move the list of unsupported TCG features near the TCG capabilitiesmasks.
x86/cpuid: fix indentation