aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2010-03-16qdev: Convert qbus_find() to QErrorMarkus Armbruster1-11/+14
2010-03-16error: New QERR_DEVICE_NO_BUSMarkus Armbruster2-0/+7
2010-03-16error: New QERR_DEVICE_MULTIPLE_BUSSESMarkus Armbruster2-0/+7
2010-03-16error: New QERR_BUS_NOT_FOUNDMarkus Armbruster2-0/+7
2010-03-16qdev: Relax parsing of bus optionMarkus Armbruster1-9/+17
Treat multiple successive slashes as a one slash. Ignore trailing slashes. This is how POSIX pathnames work.
2010-03-16qdev: convert setting device properties to QErrorMarkus Armbruster2-10/+7
2010-03-16error: New QERR_PROPERTY_VALUE_NOT_FOUNDMarkus Armbruster2-0/+7
2010-03-16error: New QERR_PROPERTY_VALUE_IN_USEMarkus Armbruster2-0/+7
2010-03-16error: New QERR_PROPERTY_VALUE_BADMarkus Armbruster2-0/+7
2010-03-16error: New QERR_PROPERTY_NOT_FOUNDMarkus Armbruster2-0/+7
2010-03-16error: Polish human-readable error descriptionsMarkus Armbruster2-21/+21
Also put error definitions in alphabetical order
2010-03-16error: Let converted handlers print in human monitorMarkus Armbruster2-44/+38
While fully converted handlers are not supposed to print anything when running in a QMP monitor, they are free to print in a human monitor. For instance, device_add (not yet converted) prints help, and will continue to do so after conversion. Moreover, utility functions converted to QError should remain usable from unconverted handlers. Two problems: * handler_audit() complains when a converted handler prints. Limit that to QMP monitors. * With QMP, handlers need to pass the error object by way of monitor_set_error(). However, we do that both for QMP and for the human monitor. The human monitor prints the error object after the handler returns. If the handler prints anything else, that output "overtakes" the error message. Limit use of monitor_set_error() to QMP monitors. Update handler_audit() accordingly.
2010-03-16monitor: New monitor_cur_is_qmp()Markus Armbruster2-0/+8
2010-03-16qdev: Hide "ptr" properties from usersMarkus Armbruster2-13/+23
Users can't set them, so qdev_device_help() shouldn't list them. Fix that. Also make qdev_prop_parse() hide them instead of printing a meaningless "has no parser" error message. Their value means nothing to users, so qdev_print_props() shouldn't print it. Fix by removing their print method. Their only use is dirty hacks. Document that.
2010-03-16qdev: Hide "no_user" devices from usersMarkus Armbruster1-6/+4
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, it rejected them with a "can't be added via command line" message, which wasn't quite right for monitor command device_add.
2010-03-16qdev: Factor qdev_create_from_info() out of qdev_create()Markus Armbruster1-15/+22
To make it obvious that -device and device_add can't die in hw_error().
2010-03-16qdev: Fix -device and device_add to handle unsuitable bus gracefullyMarkus Armbruster1-0/+5
"device_add isa-serial,bus=pci.0" kills QEMU. Not good.
2010-03-16error: Track locations on command lineMarkus Armbruster3-5/+27
New LOC_CMDLINE. Use it for tracking option with argument in lookup_opt(). We now report errors like this qemu: -device smbus-eeprom: Did not find I2C bus for smbus-eeprom
2010-03-16QemuOpts: Fix qemu_config_parse() to catch file read errorsMarkus Armbruster1-0/+4
2010-03-16error: Track locations in configuration filesMarkus Armbruster5-18/+49
New LOC_FILE. Use it for tracking file name and line number in qemu_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: -device: no driver specified become almost nice now: qemu:foo.conf:44: -device: no driver specified (A later commit will get rid of the bogus -device:)
2010-03-16error: Include the program name in error messages to stderrMarkus Armbruster3-1/+22
2010-03-16error: Infrastructure to track locations for error reportingMarkus Armbruster6-3/+138
New struct Location holds a location. So far, the only location is LOC_NONE, so this doesn't do anything useful yet. Passing the current location all over the place would be too cumbersome. Hide it away in static cur_loc instead, and provide accessors. Print it in error_report(). Store it in QError, and print it in qerror_print(). Store it in QemuOpt, for use by qemu_opts_foreach(). This makes error_report() do the right thing when it runs within qemu_opts_foreach(). We may still have to store it in other data structures holding user input for better error messages. Left for another day.
2010-03-16error: Rename qemu_error_new() to qerror_report()Markus Armbruster4-49/+49
2010-03-16error: Replace qemu_error() by error_report()Markus Armbruster29-119/+127
error_report() terminates the message with a newline. Strip it it from its arguments. This fixes a few error messages lacking a newline: net_handle_fd_param()'s "No file descriptor named %s found", and tap_open()'s "vnet_hdr=1 requested, but no kernel support for IFF_VNET_HDR available" (all three versions). There's one place that passes arguments without newlines intentionally: load_vmstate(). Fix it up.
2010-03-16error: Don't abuse qemu_error() for non-error in scsi_hot_add()Markus Armbruster1-4/+6
Commit 30d335d6 converted an informational message from monitor_printf() to qemu_error(), probably because the latter doesn't need a mon argument. A later commit will make qemu_error() print additional stuff that is only appropriate for proper errors, and then this will break. Clean it up.
2010-03-16error: Don't abuse qemu_error() for non-error in qbus_find()Markus Armbruster1-20/+17
qbus_find() adds an informational line to error messages, and prints both lines with one qemu_error(). Use error_printf() for the informational line instead. While there, simplify: instead of printing buffers filled by qbus_list_bus() and qbus_list_dev() in one go, make them print it.
2010-03-16error: Don't abuse qemu_error() for non-error in qdev_device_help()Markus Armbruster1-21/+10
qdev_device_help() prints device information with qemu_error(). A later commit will make qemu_error() print additional stuff that is only appropriate for proper errors, and then this will break. Use error_printf() instead. While there, simplify: instead of printing a buffer filled by qdev_print_devinfo() in one go, make qdev_print_devinfo() print it.
2010-03-16error: New error_printf() and error_vprintf()Markus Armbruster2-7/+56
2010-03-16error: Move qemu_error & friends into their own headerMarkus Armbruster16-15/+26
2010-03-16error: Simplify error sink setupMarkus Armbruster4-77/+9
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 to stderr. Simply route errors to the current monitor or else to stderr, and remove qemu_error_sink along with the functions to control it. Actually, the old code switches the sink slightly later, in handle_user_command() and handle_qmp_command(), than it gets switched now, implicitly, by setting the current monitor in monitor_read() and monitor_control_read(). Likewise, it switches back slightly earlier (same places). Doesn't make a difference, because there are no calls of qemu_error() in between.
2010-03-16error: Move qemu_error() & friends from monitor.c to own fileMarkus Armbruster3-89/+93
They're about reporting errors, not about the monitor.
2010-03-16monitor: Factor monitor_set_error() out of qemu_error_internal()Markus Armbruster2-8/+16
This separates the monitor part from the QError part.
2010-03-16block: Simplify usb_msd_initfn() test for "can read bdrv key"Markus Armbruster1-1/+1
The old test assumes that "hotplugged" implies "we have a current monitor for reading the key". This is in fact true, but it's not obviously true. Aside: if it were false, we could pass a null pointer to monitor_read_bdrv_key_start(), which would then crash. The previous commit permits us to check for "we have a current monitor" directly, so do that.
2010-03-16monitor: Separate "default monitor" and "current monitor" cleanlyMarkus Armbruster5-9/+10
Commits 376253ec..731b0364 introduced global variable cur_mon, which points to the "default monitor" (if any), except during execution of monitor_read() or monitor_control_read() it points to the monitor from which we're reading instead (the "current monitor"). Monitor command handlers run within monitor_read() or monitor_control_read(). Default monitor and current monitor are really separate things, and squashing them together is confusing and error-prone. For instance, usb_host_scan() can run both in "info usbhost" and periodically via usb_host_auto_check(). It prints to cur_mon, which is what we want in the former case: the monitor executing "info usbhost". But since that's the default monitor in the latter case, it periodically spams the default monitor there. A few places use cur_mon to log stuff to the default monitor. If we ever log something while cur_mon points to current monitor instead of default monitor, the log temporarily "jumps" to another monitor. Whether that can or cannot happen isn't always obvious. Maybe logging to the default monitor (which may not even exist) is a bad idea, and we should log to stderr or a logfile instead. But that's outside the scope of this commit. Change cur_mon to point to the current monitor. Create new default_mon to point to the default monitor. Update users of cur_mon accordingly. This fixes the periodical spamming of the default monitor by usb_host_scan(). It also stops "log jumping", should that problem exist.
2010-03-16tools: Remove unused cur_mon from qemu-tool.cMarkus Armbruster1-2/+0
2010-03-16pc: Factor common code out of pc_boot_set() and cmos_init()Markus Armbruster1-20/+8
Code duplicated in commit 0ecdffbb. The two versions are similar, but not identical: * cmos_init() reports errors to stderr, pc_boot_set() via qemu_error(). The latter is fine for both, so pick that for the common code. * cmos_init() obeys fd_bootchk, pc_boot_set() ignores it. Make it a parameter of the common code.
2010-03-16pc: Fix error reporting for -boot onceMarkus Armbruster1-4/+3
Commit 0ecdffbb created pc_boot_set() for use from monitor command "boot_set", via qemu_boot_set(). pc_boot_set() reports errors to cur_mon, which works fine for monitor code. Commit e0f084bf reused the function int reset handler restore_boot_devices(). Use of cur_mon is problematic in that context. For instance, the "Too many boot devices for PC" error for "-boot order=abcdefgh,once=c" goes to the monitor instead of stderr. The monitor may not even exist. Fix by switching to qemu_error().
2010-03-16savevm: Fix -loadvm to report errors to stderr, not the monitorMarkus Armbruster4-16/+14
A monitor may not even exist. Change load_vmstate() to use qemu_error() instead of monitor_printf(). Parameter mon is now unused, remove it.
2010-03-16usb: Remove disabled monitor_printf() in usb_read_file()Markus Armbruster1-8/+0
The monitor_printf() reports failure. Printing is wrong, because the caller tries various arguments, and expects the function to fail for some or all. Disabled since commit 26a9e82a. Remove it.
2010-03-16load_elf: replace the address addend by a translation functionAurelien Jarno24-101/+159
A few machines need to translate the ELF header addresses into physical addresses. Currently the only possibility is to add a value to the addresses. This patch replaces the addend argument by and a translation function and an opaque passed to the function. A NULL function does not translate the address. The patch also convert all machines that have an addend, simplify the PowerPC kernel loading and fix the MIPS kernel loading using this new feature. Other machines may benefit from this feature. Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2010-03-15pcnet: make subsystem vendor id match hardwareMichael S. Tsirkin1-0/+3
Real pcnet device (AT2450) apparently has subsystem device 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 to associate. qemu sets pci subsystem id to qumranet/qemu since d350d97d196a632b6c7493acf07a061017fc6f7d, debian does not yet have this patch. https://bugzilla.redhat.com/show_bug.cgi?id=521247 Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Cc: Gerd Hoffmann <kraxel@redhat.com> Cc: Anthony Liguori <aliguori@us.ibm.com>
2010-03-15eepro100: address pci todo's, use pci_set_xxMichael S. Tsirkin1-62/+32
eepro100 uses macros which rely on a specific local variable name (pci_conf) which is scary. Some of the uses are wrong or unnecessary, remove them. The rest are small in number, open-code them using pci_set_xx functions. Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2010-03-14qemu-img rebase: Document -f optionKevin Wolf1-2/+2
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>
2010-03-14mips: add header to mips_int.c and mips_timer.cAurelien Jarno2-0/+44
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2010-03-14tcg: declare internal helpers as const and pureAurelien Jarno1-4/+9
TCG internal helpers only access to the values passed in arguments, and do not modify the CPU internal state. Thus they can be declared as const and pure. Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2010-03-14Fix corner case in chardev udp: parameterJan Kiszka1-1/+1
The missing '@' broke 'udp::<port>@:<port>' parsing. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2010-03-14Don't set default monitor when there is a mux'ed oneJan Kiszka1-0/+9
This fixes eg. "-nographic -serial mon:stdio [-serial ...]". Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2010-03-14tcg/arm: use helpers for divu/remuAurelien Jarno2-95/+0
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2010-03-14tcg: add div/rem 32-bit helpersAurelien Jarno7-2/+89
Some targets like ARM would benefit to use 32-bit helpers for div/rem/divu/remu. Create a #define for div2 so that targets can select between div, div2 and helper implementation. Use the helper version if none of the #define are present. Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2010-03-14Fix pagetable codePaul Brook1-6/+6
The multi-level pagetable code fails to iterate ove all entries because of the L2_BITS v.s. L2_SIZE thinko. Signed-off-by: Paul Brook <paul@codesourcery.com>