summaryrefslogtreecommitdiffstats
path: root/hw
Commit message (Collapse)AuthorAgeFilesLines
* Compile most PPC devices only onceBlue Swirl2010-03-304-14/+0
| | | | | | Make byte swapping unconditional since PPC is big endian. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* Compile prep_pci only onceBlue Swirl2010-03-291-8/+0
| | | | | | Make byte swapping unconditional since PPC is big endian. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* Compile openpic only onceBlue Swirl2010-03-291-24/+10
| | | | | | | Replace TARGET_PAGE_SIZE with 4096. Make byte swapping unconditional since PPC is big endian. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* Compile ide/macio only onceBlue Swirl2010-03-291-10/+4
| | | | | | | Replace TARGET_PAGE_SIZE with 4096. Make byte swapping unconditional since PPC is big endian. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* Compile pflash_cfi01 only onceBlue Swirl2010-03-298-84/+183
| | | | | | Push TARGET_WORDS_BIGENDIAN dependency to board level. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* Compile pflash_cfi02 only onceBlue Swirl2010-03-295-70/+146
| | | | | | Push TARGET_WORDS_BIGENDIAN dependency to board level. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* Compile acpi only onceBlue Swirl2010-03-294-22/+47
| | | | | | | | Use qemu_irqs to trigger CMOS S3 and SMI events. Avoid using kvm.h, which uses CPUState. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* Move KVM and Xen global flags to vl.cBlue Swirl2010-03-291-3/+0
| | | | Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* pflash_cfi02: fix incorrect TARGET_FMT_lx/d useBlue Swirl2010-03-271-15/+15
| | | | | | Also use target_phys_addr_t for addresses. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* error: Trim includes after "Move qemu_error & friends..."Markus Armbruster2010-03-271-0/+1
| | | | | | | Missed in commit 2f792016. Signed-off-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
* balloon: Fix overflow when reporting actual memory sizeAdam Litke2010-03-271-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Beginning with its introduction, the virtio balloon has had an overflow error that causes 'info balloon' to misreport the actual memory size when the balloon itself becomes larger than 4G. Use a cast when converting dev->actual from pages to kB to prevent overflows. Before: (qemu) info balloon balloon: actual=5120 (qemu) balloon 1025 (qemu) info balloon balloon: actual=1025 (qemu) balloon 1024 (qemu) info balloon balloon: actual=5120 After: (qemu) info balloon balloon: actual=5120 (qemu) balloon 1025 (qemu) info balloon balloon: actual=1025 (qemu) balloon 1024 (qemu) info balloon balloon: actual=1024 Signed-off-by: Adam Litke <agl@us.ibm.com> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
* Compile some MIPS devices only onceBlue Swirl2010-03-279-13/+22
| | | | | | Move CPU specific declarations to a separate file. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* Fix buildBlue Swirl2010-03-271-3/+5
| | | | | | | Actually some systems don't define PAGE_SIZE. Fixes build breakage by f7736b91c40a617e93505e32dcbd2cb56aad8a23. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* Compile ide/core only onceBlue Swirl2010-03-271-9/+5
| | | | | | | | | Make win2k install hack unconditional as it is still restricted to x86 only in vl.c. Replace TARGET_PAGE_SIZE and 4096 with PAGE_SIZE. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* Fix recent pxa270 serial breakageLars Munch2010-03-231-1/+1
| | | | | | | | | This fixes a copy/paste bug introduced in commit 2d48377a8531de63ec1d0c4b9b1959dc4b78356c that pushed TARGET_WORDS_BIGENDIAN dependency to board level. Signed-off-by: Lars Munch <lars@segv.dk> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* pci_host: fix breakageAurelien Jarno2010-03-231-5/+5
| | | | | | This has been broken by commit 952760bb7bce7fbfe0afcf04fee268745f297b87 Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
* Fix Sparc64 buildBlue Swirl2010-03-211-1/+1
| | | | | | 952760bb7bce7fbfe0afcf04fee268745f297b87 missed one change. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* Compile pci_host only onceBlue Swirl2010-03-217-46/+67
| | | | | | | | | | | Convert pci_host_conf_register_mmio_noswap(x) to pci_host_conf_register_mmio(x, 0). Convert pci_host_conf_register_mmio(x) to pci_host_conf_register_mmio(x, 1) for big endian hosts, all cases happen to be BE. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* Compile usb-ohci only onceBlue Swirl2010-03-2111-41/+94
| | | | | | Push TARGET_WORDS_BIGENDIAN dependency to board level. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* Compile serial only onceBlue Swirl2010-03-2112-56/+163
| | | | | | Push TARGET_WORDS_BIGENDIAN dependency to board level. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* Compile isa_mmio only onceBlue Swirl2010-03-2112-35/+95
| | | | | | Push TARGET_WORDS_BIGENDIAN dependency to board level. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* Move x86 specific PC declarations to a separate fileBlue Swirl2010-03-216-17/+24
| | | | | | | | | x86 definitions (especially CPUState uses) prevent many files from being compiled within libhw. Move x86 specific declarations (APIC stuff) to a separate file. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* Revert "Convert atexit users to exit_notifier"Anthony Liguori2010-03-214-7/+5
| | | | | | | | | | | | This reverts commit d7234f4d7e373a708e1df9ab565a71b71b189025. Conflicts: hw/xen_machine_pv.c This should have never been committed. Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* Fix a typoBlue Swirl2010-03-211-1/+2
| | | | Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* Fix a typo which broke Xen buildBlue Swirl2010-03-201-1/+1
| | | | Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* Convert atexit users to exit_notifierAnthony Liguori2010-03-194-5/+7
| | | | | | | | All of these users have global state so we really don't see a benefit from exit_notifier. However, using exit_notifier means that there's one less justification for having global state in the first place. Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* Rewrite mouse handlers to use QTAILQ and to have an activation functionAnthony Liguori2010-03-191-4/+11
| | | | | | | | | | | | | | | | | | | | | And convert usb-hid to use it (to avoid regression with bisection) Right now, when we do info mice and we've added a usb tablet, we don't see it until the guest starts using the tablet. We implement this behavior in order to provide a means to delay registration of a mouse handler since we treat the last registered handler as the current handler. This is a usability problem though as we would like to give the user feedback that they've either 1) not added an absolute device 2) there is an absolute device but the guest isn't using it 3) we have an absolute device and it's active. By using QTAILQ and having an explicit activation function that moves the handler to the front of the queue, we can implement the same semantics as before with respect to automatically switching to usb tablet while providing the user with a whole lot more information. Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* Replace assert(0) with abort() or cpu_abort()Blue Swirl2010-03-185-30/+30
| | | | | | | | | 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>
* hw/usb-msd: fix some usb requestsArnaud Patard (Rtp)2010-03-171-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>
* scsi-disk: fix buffer overflowGerd Hoffmann2010-03-171-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>
* read-only: Another minor cleanupNaphtali Sprei2010-03-171-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>
* disentangle tcg and deadline calculationPaolo Bonzini2010-03-171-2/+4
| | | | | | | | | | 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>
* balloon: Do not save VM state wrt asynchronous virtio operationsAdam Litke2010-03-171-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>
* block: add logical_block_size propertyChristoph Hellwig2010-03-173-9/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* Avoid crash on '-usbdevice <device>' without parametersJan Kiszka2010-03-171-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>
* Merge remote branch 'markus/qerror' into stagingAnthony Liguori2010-03-1716-179/+208
|\
| * monitor: convert do_device_add() to QObjectMarkus Armbruster2010-03-162-9/+35
| |
| * monitor: Use argument type 'O' for device_addMarkus Armbruster2010-03-161-2/+1
| | | | | | | | While there, improve the params help text.
| * qemu-option: Move the implied first name into QemuOptsListMarkus Armbruster2010-03-163-3/+3
| | | | | | | | | | | | | | | | | | | | | | 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.
| * error: Convert do_device_add() to QErrorMarkus Armbruster2010-03-161-10/+9
| | | | | | | | Conversion to QObject is still missing.
| * Revert "qdev: Use QError for 'device not found' error"Markus Armbruster2010-03-161-2/+2
| | | | | | | | | | | | | | This reverts commit 3ced9f7a36189aed94d8bf86f3f5087a53012455. The next commit will convert all of qdev_device_add() to QError, and it'll be clearer with this partial conversion reverted.
| * qdev: Convert qbus_find() to QErrorMarkus Armbruster2010-03-161-11/+14
| |
| * qdev: Relax parsing of bus optionMarkus Armbruster2010-03-161-9/+17
| | | | | | | | | | Treat multiple successive slashes as a one slash. Ignore trailing slashes. This is how POSIX pathnames work.
| * qdev: convert setting device properties to QErrorMarkus Armbruster2010-03-162-10/+7
| |
| * qdev: Hide "ptr" properties from usersMarkus Armbruster2010-03-162-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.
| * qdev: Hide "no_user" devices from usersMarkus Armbruster2010-03-161-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.
| * qdev: Factor qdev_create_from_info() out of qdev_create()Markus Armbruster2010-03-161-15/+22
| | | | | | | | | | To make it obvious that -device and device_add can't die in hw_error().
| * qdev: Fix -device and device_add to handle unsuitable bus gracefullyMarkus Armbruster2010-03-161-0/+5
| | | | | | | | "device_add isa-serial,bus=pci.0" kills QEMU. Not good.
| * error: Rename qemu_error_new() to qerror_report()Markus Armbruster2010-03-161-1/+1
| |
| * error: Replace qemu_error() by error_report()Markus Armbruster2010-03-1613-50/+50
| | | | | | | | | | | | | | | | | | | | | | | | | | 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.
OpenPOWER on IntegriCloud