summaryrefslogtreecommitdiff
path: root/hw
AgeCommit message (Collapse)AuthorFilesLines
2016-01-18Merge remote-tracking branch 'remotes/afaerber/tags/qom-devices-for-peter' ↵Peter Maydell2-5/+6
into staging QOM infrastructure fixes and device conversions * Dynamic class properties * Property iterator cleanup * Device hot-unplug ID race fix # gpg: Signature made Mon 18 Jan 2016 17:27:01 GMT using RSA key ID 3E7E013F # gpg: Good signature from "Andreas Färber <afaerber@suse.de>" # gpg: aka "Andreas Färber <afaerber@suse.com>" * remotes/afaerber/tags/qom-devices-for-peter: MAINTAINERS: Fix sPAPR entry heading qdev: Free QemuOpts when the QOM path goes away qom: Change object property iterator API contract qom: Allow properties to be registered against classes Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2016-01-18qdev: Free QemuOpts when the QOM path goes awayPaolo Bonzini1-1/+3
Otherwise there is a race where the DEVICE_DELETED event has been sent but attempts to reuse the ID will fail. Note that similar races exist for other QemuOpts, which this patch does not attempt to fix. For example, if the device is a block device, then unplugging it also deletes its backend. However, this backend's get deleted in drive_info_del(), which is only called when properties are destroyed. Just like device_finalize(), drive_info_del() is called some time after DEVICE_DELETED is sent. A separate patch series has been sent to plug this other bug. Character devices also have yet to be fixed. Reported-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Reviewed-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Andreas Färber <afaerber@suse.de>
2016-01-18qom: Change object property iterator API contractDaniel P. Berrange1-4/+3
Currently the ObjectProperty iterator API works as follows: ObjectPropertyIterator *iter; iter = object_property_iter_init(obj); while ((prop = object_property_iter_next(iter))) { ... } object_property_iter_free(iter); This has the benefit that the ObjectPropertyIterator struct can be opaque, but has the downside that callers need to explicitly call a free function. It is also not in keeping with iterator style used elsewhere in QEMU/GLib2. This patch changes the API to use stack allocation instead: ObjectPropertyIterator iter; object_property_iter_init(&iter, obj); while ((prop = object_property_iter_next(&iter))) { ... } Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Daniel P. Berrange <berrange@redhat.com> Reviewed-by: Markus Armbruster <armbru@redhat.com> [AF: Fused ObjectPropertyIterator struct with typedef] Signed-off-by: Andreas Färber <afaerber@suse.de>
2016-01-18hw/arm: Clean up includesPeter Maydell42-1/+42
Clean up includes so that osdep.h is included first and headers which it implies are not included manually. This commit was created with scripts/clean-includes. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Message-id: 1449505425-32022-4-git-send-email-peter.maydell@linaro.org
2016-01-18Merge remote-tracking branch 'remotes/mcayland/tags/qemu-sparc-signed' into ↵Peter Maydell1-24/+0
staging qemu-sparc update # gpg: Signature made Sat 16 Jan 2016 12:32:06 GMT using RSA key ID AE0F321F # gpg: Good signature from "Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>" * remotes/mcayland/tags/qemu-sparc-signed: target-sparc: Migrate CWP and PIL for SPARC64 target-sparc: Use VMState arrays for SPARC64 TLB/MMU state target-sparc: Convert to VMStateDescription target-sparc: Don't flush TLB in cpu_load function target-sparc: Split cpu_put_psr into side-effect and no-side-effect parts vmstate: define vmstate_info_uinttl vmstate: Introduce VMSTATE_VARRAY_MULTPLY vmstate: introduce CPU_DoubleU arrays Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2016-01-16target-sparc: Convert to VMStateDescriptionJuan Quintela1-24/+0
Convert the SPARC CPU from cpu_load/save functions to VMStateDescription. We preserve migration compatibility with the previous version (required for SPARC32 but not necessarily for SPARC64). Signed-off-by: Juan Quintela <quintela@redhat.com> [PMM: * Rebase and update to apply to master * VMSTATE_STRUCT_POINTER now takes type, not pointer-to-type * QEMUTimer* are migrated via VMSTATE_TIMER_PTR * Put CPUTimer vmstate struct inside TARGET_SPARC64 ifdef * Convert handling of PSR to use a vmstate_psr, like Alpha and ARM ] Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
2016-01-15SCSI device: fix to incomplete QOMifyCao jin3-9/+9
Signed-off-by: Cao jin <caoj.fnst@cn.fujitsu.com> Acked-by: Michael S. Tsirkin <mst@redhat.com> Message-Id: <1452073066-28319-1-git-send-email-caoj.fnst@cn.fujitsu.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2016-01-15qemu-char: delete send_all/recv_all helper methodsDaniel P. Berrange1-2/+27
The qemu-char.c contains two helper methods send_all and recv_all. These are in fact declared in sockets.h so ought to have been in util/qemu-sockets.c. For added fun the impl of recv_all is completely missing on Win32. Fortunately there is only a single caller of these methods, the TPM passthrough code, which is only ever compiled on Linux. With only a single caller these helpers are not compelling enough to keep so inline them in the TPM code, avoiding the need to fix the missing recv_all on Win32. Signed-off-by: Daniel P. Berrange <berrange@redhat.com> Message-Id: <1450879144-17111-1-git-send-email-berrange@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2016-01-15scsi: initialise info object with appropriate sizeP J P1-1/+1
While processing controller 'CTRL_GET_INFO' command, the routine 'megasas_ctrl_get_info' overflows the '&info' object size. Use its appropriate size to null initialise it. Reported-by: Qinghao Tang <luodalongde@gmail.com> Signed-off-by: Prasad J Pandit <pjp@fedoraproject.org> Message-Id: <alpine.LFD.2.20.1512211501420.22471@wniryva> Cc: qemu-stable@nongnu.org Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: P J P <ppandit@redhat.com>
2016-01-15i386: avoid null pointer dereferenceP J P1-5/+10
Hello, A null pointer dereference issue was reported by Mr Ling Liu, CC'd here. It occurs while doing I/O port write operations via hmp interface. In that, 'current_cpu' remains null as it is not called from cpu_exec loop, which results in the said issue. Below is a proposed (tested)patch to fix this issue; Does it look okay? === From ae88a4947fab9a148cd794f8ad2d812e7f5a1d0f Mon Sep 17 00:00:00 2001 From: Prasad J Pandit <pjp@fedoraproject.org> Date: Fri, 18 Dec 2015 11:16:07 +0530 Subject: [PATCH] i386: avoid null pointer dereference When I/O port write operation is called from hmp interface, 'current_cpu' remains null, as it is not called from cpu_exec() loop. This leads to a null pointer dereference in vapic_write routine. Add check to avoid it. Reported-by: Ling Liu <liuling-it@360.cn> Signed-off-by: Prasad J Pandit <pjp@fedoraproject.org> Message-Id: <alpine.LFD.2.20.1512181129320.9805@wniryva> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: P J P <ppandit@redhat.com>
2016-01-15scsi: revert change to scsi_req_cancel_async and add assertionsPaolo Bonzini1-0/+11
Fam Zheng noticed that the change in commit 36896bf ("scsi: always call notifier on async cancellation", 2015-12-16) could cause a leak of the request; scsi_req_cancel_async now calls scsi_req_ref multiple times for multiple cancellations, but there is only one call to scsi_req_cancel_complete. So revert the patch and instead assert that the problematic case (a call to scsi_req_cancel_async after the aiocb has been completed) cannot happen. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2016-01-15ARM: virt: Don't generate RTC ACPI device when using UEFIShannon Zhao1-19/+5
When booting the VM with UEFI, UEFI takes ownership of the RTC hardware. While UEFI can use libfdt to disable the RTC device node in the DTB that it passes to the OS, it cannot modify AML. Therefore, we won't generate the RTC ACPI device at all when using UEFI. Signed-off-by: Shannon Zhao <shannon.zhao@linaro.org> Acked-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Andrew Jones <drjones@redhat.com> Message-id: 1452867091-4023-1-git-send-email-shannon.zhao@linaro.org Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2016-01-15xlnx-zynqmp: Add support for high DDR memory regionsAlistair Francis2-19/+58
The Xilinx ZynqMP SoC and EP108 board supports three memory regions: - A 2GB region starting at 0 - A 32GB region starting at 32GB - A 256GB region starting at 768GB This patch adds support for the first two memory regions, which is automatically created based on the size specified by the QEMU memory command line argument. On hardware the physical memory region is one continuous region, it is then mapped into the three different regions by the DDRC. As we don't model the DDRC this is done at startup by QEMU. The board creates the memory region and then passes that memory region to the SoC. The SoC then maps the memory regions. Signed-off-by: Alistair Francis <alistair.francis@xilinx.com> Reviewed-by: Peter Crosthwaite <crosthwaite.peter@gmail.com> Message-id: a1e47db941d65733724a300fcd98b74fbeeaaf22.1452637205.git.alistair.francis@xilinx.com Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2016-01-14Merge remote-tracking branch 'remotes/armbru/tags/pull-error-2016-01-13' ↵Peter Maydell64-359/+269
into staging Error reporting patches for 2016-01-13 # gpg: Signature made Wed 13 Jan 2016 14:21:48 GMT using RSA key ID EB918653 # gpg: Good signature from "Markus Armbruster <armbru@redhat.com>" # gpg: aka "Markus Armbruster <armbru@pond.sub.org>" * remotes/armbru/tags/pull-error-2016-01-13: (41 commits) checkpatch: Detect newlines in error_report and other error functions error: Consistently name Error * objects err, and not errp s390/sclp: Simplify control flow in sclp_realize() hw/s390x: Rename local variables Error *l_err to just err error: Clean up errors with embedded newlines (again) vhdx: Fix "log that needs to be replayed" error message pci-assign: Clean up "Failed to assign" error messages vmdk: Clean up "Invalid extent lines" error message vmdk: Clean up control flow in vmdk_parse_extents() a bit error: Strip trailing '\n' from error string arguments (again) qemu-io qemu-nbd: Use error_report() etc. instead of fprintf() migration: Use error_reportf_err() instead of monitor_printf() spapr: Use error_reportf_err() error: Use error_prepend() where it makes obvious sense error: Use error_reportf_err() where it makes obvious sense error: Don't decorate original error message when adding to it error: New error_prepend(), error_reportf_err() test-throttle: Simplify qemu_init_main_loop() error handling qemu-nbd: Clean up "Failed to load snapshot" error message block: Clean up "Could not create temporary overlay" error message ... Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2016-01-14Merge remote-tracking branch 'remotes/cohuck/tags/s390x-20160113' into stagingPeter Maydell9-1126/+45
This first round of s390x patches includes: - new compat machine - remove the old s390-virtio machine - fixes and some cleanup # gpg: Signature made Wed 13 Jan 2016 14:55:55 GMT using RSA key ID C6F02FAF # gpg: Good signature from "Cornelia Huck <huckc@linux.vnet.ibm.com>" # gpg: aka "Cornelia Huck <cornelia.huck@de.ibm.com>" * remotes/cohuck/tags/s390x-20160113: s390x/pci: return real state during listing PCI virtio-ccw: fix sanity check for vector s390: Introduce CCW_COMPAT_2_5 s390x/virtio: use qemu_check_nic_model() s390x/pci: code cleanup s390x/pci: reject some operations to disabled PCI function s390x: remove s390-virtio devices s390x: remove s390-virtio machine s390x: add 2.6 compat machine Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2016-01-13error: Consistently name Error * objects err, and not errpMarkus Armbruster1-5/+5
Signed-off-by: Markus Armbruster <armbru@redhat.com> Message-Id: <1450452927-8346-25-git-send-email-armbru@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com>
2016-01-13s390/sclp: Simplify control flow in sclp_realize()Markus Armbruster1-6/+3
Suggested-by: David Hildenbrand <dahi@linux.vnet.ibm.com> Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: David Hildenbrand <dahi@linux.vnet.ibm.com> Acked-by: Cornelia Huck <cornelia.huck@de.ibm.com> Reviewed-by: Eric Blake <eblake@redhat.com> Message-Id: <1450452927-8346-24-git-send-email-armbru@redhat.com>
2016-01-13hw/s390x: Rename local variables Error *l_err to just errMarkus Armbruster2-13/+13
Let's follow established naming practice here as well. Cc: David Hildenbrand <dahi@linux.vnet.ibm.com> Signed-off-by: Markus Armbruster <armbru@pond.sub.org> Acked-by: Cornelia Huck <cornelia.huck@de.ibm.com> Reviewed-by: David Hildenbrand <dahi@linux.vnet.ibm.com> Reviewed-by: Eric Blake <eblake@redhat.com> Message-Id: <1450452927-8346-23-git-send-email-armbru@redhat.com>
2016-01-13error: Clean up errors with embedded newlines (again)Markus Armbruster1-2/+2
The arguments of error_report() should yield a short error string without newlines. A few places try to print additional help after the error message by embedding newlines in the error string. That's nice, but let's do it the right way. Commit 474c213 cleaned up some, but they keep coming back. Offenders tracked down with the Coccinelle semantic patch from commit 312fd5f. Cc: Laszlo Ersek <lersek@redhat.com> Cc: Pavel Fedin <p.fedin@samsung.com> Signed-off-by: Markus Armbruster <armbru@pond.sub.org> Reviewed-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Markus Armbruster <armbru@redhat.com>
2016-01-13pci-assign: Clean up "Failed to assign" error messagesMarkus Armbruster1-8/+8
The arguments of error_setg() & friends should yield a short error string without newlines. Two places try to append additional help to the error message by embedding newlines in the error string. That's nice, but let's do it the right way, with error_append_hint(). Cc: Laszlo Ersek <lersek@redhat.com> Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Message-Id: <1450452927-8346-20-git-send-email-armbru@redhat.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com>
2016-01-13error: Strip trailing '\n' from error string arguments (again)Markus Armbruster6-16/+17
Commit 6daf194d, be62a2eb and 312fd5f got rid of a bunch, but they keep coming back. Tracked down with the Coccinelle semantic patch from commit 312fd5f. Cc: Fam Zheng <famz@redhat.com> Cc: Peter Crosthwaite <crosthwaitepeter@gmail.com> Cc: Bharata B Rao <bharata@linux.vnet.ibm.com> Cc: Dominik Dingel <dingel@linux.vnet.ibm.com> Cc: David Hildenbrand <dahi@linux.vnet.ibm.com> Cc: Jason J. Herne <jjherne@linux.vnet.ibm.com> Cc: Stefan Berger <stefanb@linux.vnet.ibm.com> Cc: Dr. David Alan Gilbert <dgilbert@redhat.com> Cc: Changchun Ouyang <changchun.ouyang@intel.com> Cc: zhanghailiang <zhang.zhanghailiang@huawei.com> Cc: Pavel Fedin <p.fedin@samsung.com> Signed-off-by: Markus Armbruster <armbru@pond.sub.org> Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com> Acked-by: Cornelia Huck <cornelia.huck@de.ibm.com> Acked-by: Bharata B Rao <bharata@linux.vnet.ibm.com> Acked-by: Fam Zheng <famz@redhat.com> Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Message-Id: <1450452927-8346-17-git-send-email-armbru@redhat.com>
2016-01-13spapr: Use error_reportf_err()Markus Armbruster1-3/+4
Not caught by Coccinelle, because we report the error only conditionally here. Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Message-Id: <1450452927-8346-14-git-send-email-armbru@redhat.com>
2016-01-13error: Use error_prepend() where it makes obvious senseMarkus Armbruster3-13/+7
Done with this Coccinelle semantic patch @@ expression FMT, E1, E2; expression list ARGS; @@ - error_setg(E1, FMT, ARGS, error_get_pretty(E2)); + error_propagate(E1, E2);/*###*/ + error_prepend(E1, FMT/*@@@*/, ARGS); followed by manual cleanup, first because I can't figure out how to make Coccinelle transform strings, and second to get rid of now superfluous error_propagate(). We now use or propagate the original error whole instead of just its message obtained with error_get_pretty(). This avoids suppressing its hint (see commit 50b7b00), but I can't see how the errors touched in this commit could come with hints. It also improves the message printed with &error_abort when we screw up (see commit 1e9b65b). Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com>
2016-01-13error: Use error_reportf_err() where it makes obvious senseMarkus Armbruster7-22/+15
Done with this Coccinelle semantic patch @@ expression FMT, E, S; expression list ARGS; @@ - error_report(FMT, ARGS, error_get_pretty(E)); + error_reportf_err(E, FMT/*@@@*/, ARGS); ( - error_free(E); | exit(S); | abort(); ) followed by a replace of '%s"/*@@@*/' by '"' and some line rewrapping, because I can't figure out how to make Coccinelle transform strings. We now use the error whole instead of just its message obtained with error_get_pretty(). This avoids suppressing its hint (see commit 50b7b00), but I can't see how the errors touched in this commit could come with hints. Signed-off-by: Markus Armbruster <armbru@redhat.com> Message-Id: <1450452927-8346-12-git-send-email-armbru@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com>
2016-01-13error: Don't decorate original error message when adding to itMarkus Armbruster1-1/+1
Prepend the additional information, colon, space to the original message without enclosing it in parenthesis or quotes, like we do elsewhere. Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Message-Id: <1450452927-8346-11-git-send-email-armbru@redhat.com>
2016-01-13error: Use error_report_err() instead of monitor_printf()Markus Armbruster1-2/+1
Both error_report_err() and monitor_printf() print to the same destination when monitor_printf() is used correctly, i.e. within an HMP monitor. Elsewhere, monitor_printf() does nothing, while error_report_err() reports to stderr. Most changed functions are HMP command handlers. These should only run within an HMP monitor. The one exception is bdrv_password_cb(), which should also only run within an HMP monitor. Four command handlers prefix the error message with the command name: balloon, migrate_set_capability, migrate_set_parameter, migrate. Pointless, drop. Unlike monitor_printf(), error_report_err() uses the error whole instead of just its message obtained with error_get_pretty(). This avoids suppressing its hint (see commit 50b7b00). Example: (qemu) device_add ivshmem,id=666 Parameter 'id' expects an identifier Identifiers consist of letters, digits, '-', '.', '_', starting with a letter. Try "help device_add" for more information The "Identifiers consist of..." line is new with this patch. Coccinelle semantic patch: @@ expression M, E; @@ - monitor_printf(M, "%s\n", error_get_pretty(E)); - error_free(E); + error_report_err(E); @r1@ expression M, E; format F; position p; @@ - monitor_printf(M, "...%@F@\n", error_get_pretty(E));@p - error_free(E); + error_report_err(E); @script:python@ p << r1.p; @@ print "%s:%s:%s: prefix dropped" % (p[0].file, p[0].line, p[0].column) Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Message-Id: <1450452927-8346-4-git-send-email-armbru@redhat.com>
2016-01-13error: Use error_report_err() where appropriate (again)Markus Armbruster5-8/+6
Same Coccinelle semantic patch as in commit 565f65d. We now use the original error whole instead of just its message obtained with error_get_pretty(). This avoids suppressing its hint (see commit 50b7b00), but I don't think the errors touched in this commit can come with hints. Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Message-Id: <1450452927-8346-3-git-send-email-armbru@redhat.com>
2016-01-13isa: Clean up inappropriate hw_error()Markus Armbruster1-11/+0
isa_bus_irqs(), isa_create() and isa_try_create() call hw_error() when passed a null bus. Use of hw_error() has always been questionable, because these are used only during machine initialization, and printing CPU registers isn't useful there. Since the previous commit, passing a null bus is a programming error. Drop the hw_error() and simply let it crash. Cc: Richard Henderson <rth@twiddle.net> Cc: "Michael S. Tsirkin" <mst@redhat.com> Cc: "Hervé Poussineau" <hpoussin@reactos.org> Cc: Aurelien Jarno <aurelien@aurel32.net> Cc: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk> Signed-off-by: Markus Armbruster <armbru@pond.sub.org> Reviewed-by: Hervé Poussineau <hpoussin@reactos.org> Message-Id: <1450354795-31608-12-git-send-email-armbru@redhat.com> Reviewed-by: Richard Henderson <rth@twiddle.net>
2016-01-13isa: Clean up error handling around isa_bus_new()Markus Armbruster11-15/+33
We can have at most one ISA bus. If you try to create another one, isa_bus_new() complains to stderr and returns null. isa_bus_new() is called in two contexts, machine's init() and device's realize() methods. Since complaining to stderr is not proper in the latter context, convert isa_bus_new() to Error. Machine's init(): * mips_jazz_init(), called from the init() methods of machines "magnum" and "pica" * mips_r4k_init(), the init() method of machine "mips" * pc_init1() called from the init() methods of non-q35 PC machines * typhoon_init(), called from clipper_init(), the init() method of machine "clipper" These callers always create the first ISA bus, hence isa_bus_new() can't fail. Simply pass &error_abort. Device's realize(): * i82378_realize(), of PCI device "i82378" * ich9_lpc_realize(), of PCI device "ICH9-LPC" * pci_ebus_realize(), of PCI device "ebus" * piix3_realize(), of PCI device "pci-piix3", abstract parent of "PIIX3" and "PIIX3-xen" * piix4_realize(), of PCI device "PIIX4" * vt82c686b_realize(), of PCI device "VT82C686B" Propagate the error. Note that these devices are typically created only by machine init() methods with qdev_init_nofail() or similar. If we screwed up and created an ISA bus before that call, we now give up right away. Before, we'd hobble on, and typically die in isa_bus_irqs(). Similar if someone finds a way to hot-plug one of these critters. Cc: Richard Henderson <rth@twiddle.net> Cc: "Michael S. Tsirkin" <mst@redhat.com> Cc: "Hervé Poussineau" <hpoussin@reactos.org> Cc: Aurelien Jarno <aurelien@aurel32.net> Cc: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk> Signed-off-by: Markus Armbruster <armbru@pond.sub.org> Reviewed-by: Marcel Apfelbaum <marcel@redhat.com> Reviewed-by: Hervé Poussineau <hpoussin@reactos.org> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Message-Id: <1450370121-5768-11-git-send-email-armbru@redhat.com>
2016-01-13isa: Trivially convert remaining PCI-ISA bridges to realize()Markus Armbruster2-7/+4
These are "ICH9-LPC" and "ebus". Cc: "Michael S. Tsirkin" <mst@redhat.com> Cc: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk> Signed-off-by: Markus Armbruster <armbru@pond.sub.org> Reviewed-by: Marcel Apfelbaum <marcel@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Message-Id: <1450370121-5768-10-git-send-email-armbru@redhat.com>
2016-01-13sysbus: Don't use hw_error() in machine_init_done_notifiersMarkus Armbruster1-13/+12
platform_bus_map_irq() and platform_bus_map_mmio() use hw_error() to fail. They run in machine_init_done_notifiers, via platform_bus_init_notify() and link_sysbus_device(). Printing CPU registers is not helpful there. Replace hw_error() by error_report(); exit(1). If these are programming errors, it should be replaced by an assertion instead. While there, observe that both functions always return 0, and link_sysbus_device() ignores the return value. Change them to void. Cc: Alexander Graf <agraf@suse.de> Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Thomas Huth <thuth@redhat.com> Message-Id: <1450370121-5768-9-git-send-email-armbru@redhat.com>
2016-01-13hw/arm/virt: Fix property "gic-version" error handlingMarkus Armbruster1-3/+2
virt_set_gic_version() calls exit(1) when passed an invalid property value. Property setters are not supposed to do that. Screwed up in commit b92ad39. Harmless, because the property belongs to a machine. Set an error object instead. Cc: Peter Maydell <peter.maydell@linaro.org> Cc: qemu-arm@nongnu.org Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
2016-01-13raven: Mark use of hw_error() in realize() FIXMEMarkus Armbruster1-2/+4
Device realize() methods aren't supposed to call hw_error(), they should set an error and fail cleanly. Blindly doing that would be easy enough, but then realize() would fail without undoing its side effects. Just mark it FIXME for now. Cc: "Andreas Färber" <andreas.faerber@web.de> Cc: qemu-ppc@nongnu.org Signed-off-by: Markus Armbruster <armbru@pond.sub.org> Reviewed-by: Thomas Huth <thuth@redhat.com> Message-Id: <1450370121-5768-6-git-send-email-armbru@redhat.com>
2016-01-13etraxfs_eth: Don't use hw_error() in init() methodMarkus Armbruster1-1/+3
Device init() methods aren't supposed to call hw_error(), they should report the error and fail cleanly. Do that. Cc: "Edgar E. Iglesias" <edgar.iglesias@gmail.com> Signed-off-by: Markus Armbruster <armbru@pond.sub.org> Reviewed-by: Edgar E. Iglesias <edgar.iglesias@xilinx.com> Message-Id: <1450370121-5768-5-git-send-email-armbru@redhat.com>
2016-01-13arm_mptimer: Don't use hw_error() in realize() methodMarkus Armbruster1-2/+3
Device realize() methods aren't supposed to call hw_error(), they should set an error and fail cleanly. Do that. Cc: Peter Maydell <peter.maydell@linaro.org> Cc: qemu-arm@nongnu.org Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Message-Id: <1450370121-5768-4-git-send-email-armbru@redhat.com>
2016-01-13omap: Don't use hw_error() in device init() methodsMarkus Armbruster3-13/+34
Device init() methods aren't supposed to call hw_error(), they should report the error and fail cleanly. Do that. The errors are all device misconfiguration. All callers use qdev_init_nofail(), so this patch merely converts hw_error() crashes into &error_abort crashes. Improvement, because now it crashes closer to where the misconfiguration bug would be, and a few more bad examples of hw_error() use are gone. Cc: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Markus Armbruster <armbru@pond.sub.org> Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Message-Id: <1450370121-5768-3-git-send-email-armbru@redhat.com>
2016-01-13hw: Don't use hw_error() for machine initialization errorsMarkus Armbruster8-30/+48
Printing CPU registers is not helpful during machine initialization. Moreover, these are straightforward configuration or "can get resources" errors, so dumping core isn't appropriate either. Replace hw_error() by error_report(); exit(1). Matches how we report these errors in other machine initializations. Cc: Richard Henderson <rth@twiddle.net> Cc: qemu-arm@nongnu.org Cc: qemu-ppc@nongnu.org Cc: Guan Xuetao <gxt@mprc.pku.edu.cn> Signed-off-by: Markus Armbruster <armbru@pond.sub.org> Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Reviewed-by: Thomas Huth <thuth@redhat.com> Message-Id: <1450370121-5768-2-git-send-email-armbru@redhat.com> Reviewed-by: Richard Henderson <rth@twiddle.net>
2016-01-13hw: Inline the qdev_prop_set_drive_nofail() wrapperMarkus Armbruster7-20/+21
Signed-off-by: Markus Armbruster <armbru@redhat.com> Message-Id: <1449764955-10741-3-git-send-email-armbru@redhat.com> Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
2016-01-13Use error_fatal to simplify obvious fatal errorsMarkus Armbruster11-150/+30
Done with this Coccinelle semantic patch: @@ type T; identifier FUN, RET; expression list ARGS; expression ERR, EC; @@ ( - T RET = FUN(ARGS, &ERR); + T RET = FUN(ARGS, &error_fatal); | - RET = FUN(ARGS, &ERR); + RET = FUN(ARGS, &error_fatal); | - FUN(ARGS, &ERR); + FUN(ARGS, &error_fatal); ) - if (ERR != NULL) { - error_report_err(ERR); - exit(EC); - } This is actually a more elegant version of my initial semantic patch by courtesy of Eduardo. It leaves dead Error * variables behind, cleaned up manually. Cc: qemu-arm@nongnu.org Cc: "Michael S. Tsirkin" <mst@redhat.com> Cc: Eduardo Habkost <ehabkost@redhat.com> Cc: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Eduardo Habkost <ehabkost@redhat.com>
2016-01-13s390x/pci: return real state during listing PCIYi Min Zhao1-1/+2
At present, list_pci() shows all PCI devices as being in configured state. As devices can be deconfigured by the guest, we need to show the real configuration status instead. Signed-off-by: Yi Min Zhao <zyimin@linux.vnet.ibm.com> Reviewed-by: Cornelia Huck <cornelia.huck@de.ibm.com> Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
2016-01-13virtio-ccw: fix sanity check for vectorHalil Pasic1-1/+2
The commit 8dfbaa6ac ("virtio-ccw: introduce ccw specific queue limit") did not touch the sanity check for the vector argument of the method virtio_ccw_notify, despite intended as seen from https://lists.nongnu.org/archive/html/qemu-devel/2015-04/msg02705.html To be able to scale number of virtqueues using the constant this sanity check needs to be altered. Fixes: 8dfbaa6ac ("virtio-ccw: introduce ccw specific queue limit") Reviewed-by: Cornelia Huck <cornelia.huck@de.ibm.com> Signed-off-by: Halil Pasic <pasic@linux.vnet.ibm.com> Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
2016-01-13s390: Introduce CCW_COMPAT_2_5Shmulik Ladkani1-0/+9
In 240240d5 'pc: Add pc-*-2.6 machine classes' HW_COMPAT_2_5 and PC_COMPAT_2_5 were introduced. Accordingly, introduce CCW_COMPAT_2_5 that uses HW_COMPAT_2_5. Signed-off-by: Shmulik Ladkani <shmulik.ladkani@ravellosystems.com> Message-Id: <1450899731-19517-1-git-send-email-shmulik.ladkani@ravellosystems.com> Acked-by: Christian Borntraeger <borntraeger@de.ibm.com> Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
2016-01-13s390x/virtio: use qemu_check_nic_model()Cornelia Huck1-4/+1
Switching to the generally used interface changes the output of s390x-softmmu/qemu-system-s390x -net nic,model=? from S390 only supports VirtIO nics to the rather more useful qemu: Supported NIC models: virtio while still giving us a sensible error message for unsupported models: s390x-softmmu/qemu-system-s390x -net nic,model=foo qemu-system-s390x: Unsupported NIC model: foo Acked-by: David Hildenbrand <dahi@linux.vnet.ibm.com> Acked-by: Christian Borntraeger <borntraeger@de.ibm.com> Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
2016-01-13s390x/pci: code cleanupYi Min Zhao1-3/+3
Make use of the new FH_ENABLED define in existing code. Signed-off-by: Yi Min Zhao <zyimin@linux.vnet.ibm.com> Reviewed-by: Cornelia Huck <cornelia.huck@de.ibm.com> Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
2016-01-13s390x/pci: reject some operations to disabled PCI functionYi Min Zhao3-7/+11
According to the s390 architecture, any mpcifc, pcilg, pcistg, pcistb and rpcit instructions issued to disabled PCI functions are rejected, and the instruction completes by setting condition code 3. In addition, any DMA and MSIX interruption operations are ignored. Signed-off-by: Yi Min Zhao <zyimin@linux.vnet.ibm.com> Reviewed-by: Cornelia Huck <cornelia.huck@de.ibm.com> Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
2016-01-13s390x: remove s390-virtio devicesPierre Morel4-946/+1
The s390-virtio machine has been removed; remove the associated devices as well. hw/s390x/s390-virtio-bus.c and hw/s390x/s390-virtio-bus.h have been deleted and removed from hw/s390x/Makefile.objs virtio-size has no more meaning for the modern machine and has been removed from helper.c and cpu.h virtio-serial-s390 belonging to the old machine is being removed from vl.c Signed-off-by: Pierre Morel <pmorel@linux.vnet.ibm.com> Acked-by: Cornelia Huck <cornelia.huck@de.ibm.com> Acked-by: Christian Borntraeger <borntraeger@de.ibm.com> Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
2016-01-13s390x: remove s390-virtio machinePierre Morel1-162/+0
Remove machine code for the s390-virtio machine, but keep functions useful for the ccw machine. Signed-off-by: Pierre Morel <pmorel@linux.vnet.ibm.com> Acked-by: Cornelia Huck <cornelia.huck@de.ibm.com> Acked-by: Christian Borntraeger <borntraeger@de.ibm.com> Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
2016-01-13s390x: add 2.6 compat machineCornelia Huck1-2/+16
New qemu version, new machine. Acked-by: Christian Borntraeger <borntraeger@de.ibm.com> Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
2016-01-13virtio serial port: fix to incomplete QOMifyCao jin1-1/+1
Signed-off-by: Cao jin <caoj.fnst@cn.fujitsu.com> Message-Id: <1452068575-21543-1-git-send-email-caoj.fnst@cn.fujitsu.com> Reviewed-by: Amit Shah <amit.shah@redhat.com> Signed-off-by: Amit Shah <amit.shah@redhat.com>
2016-01-12Merge remote-tracking branch 'remotes/kvaneesh/tags/for-upstream-signed' ↵Peter Maydell23-618/+667
into staging VirtFS update: Cleanups mostly isolating virtio related details into separate files. This is done to enable easy addition of Xen transport for VirtFS. The changes include: 1. Rename a bunch of files and functions to make clear they are generic. 2. disentangle virtio transport code and generic 9pfs code. 3. Some function name clean-up. # gpg: Signature made Tue 12 Jan 2016 06:04:35 GMT using RSA key ID 04C4E23A # gpg: Good signature from "Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>" # gpg: WARNING: This key is not certified with a trusted signature! # gpg: There is no indication that the signature belongs to the owner. # Primary key fingerprint: 4846 9DE7 1860 360F A6E9 968C DE41 A4FE 04C4 E23A * remotes/kvaneesh/tags/for-upstream-signed: (25 commits) 9pfs: introduce V9fsVirtioState 9pfs: factor out v9fs_device_{,un}realize_common 9pfs: rename virtio-9p.c to 9p.c 9pfs: rename virtio_9p_set_fd_limit to use v9fs_ prefix 9pfs: move handle_9p_output and make it static function 9pfs: export pdu_{submit,alloc,free} 9pfs: factor out virtio_9p_push_and_notify 9pfs: break out 9p.h from virtio-9p.h 9pfs: break out virtio_init_iov_from_pdu 9pfs: factor out pdu_push_and_notify 9pfs: factor out virtio_pdu_{,un}marshal 9pfs: make pdu_{,un}marshal proper functions 9pfs: PDU processing functions should start pdu_ prefix 9pfs: PDU processing functions don't need to take V9fsState as argument fsdev: rename virtio-9p-marshal.{c,h} to 9p-iov-marshal.{c,h} fsdev: break out 9p-marshal.{c,h} from virtio-9p-marshal.{c,h} 9pfs: remove dead code 9pfs: merge hw/virtio/virtio-9p.h into hw/9pfs/virtio-9p.h 9pfs: rename virtio-9p-xattr{,-user}.{c,h} to 9p-xattr{,-user}.{c,h} 9pfs: rename virtio-9p-synth.{c,h} to 9p-synth.{c,h} ... Signed-off-by: Peter Maydell <peter.maydell@linaro.org>