summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* QError: Add QERR_DEVICE_NOT_ACTIVELuiz Capitulino2009-12-032-0/+7
| | | | | | | New class for device not active errors. Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* qdev: Use QError for 'device not found' errorLuiz Capitulino2009-12-031-2/+2
| | | | | | | | Please, note that we will lose the "Try -device '?' for a list" hint as it's qdev specific. Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* QError: Add QERR_DEVICE_NOT_FOUNDLuiz Capitulino2009-12-032-0/+6
| | | | | | | New class for device not found errors. Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* monitor: QError supportLuiz Capitulino2009-12-032-1/+49
| | | | | | | | | | | | | | | | | | | | | | | | | | | This commit adds QError support in the Monitor. A QError member is added to the Monitor struct. This new member stores error information and is also used to check if an error has occurred when the called handler returns. Additionally, a new macro called qemu_error_new() is introduced. It builds on top of the QemuErrorSink API and should be used in place of qemu_error(). When all conversion to qemu_error_new() is done, qemu_error() can be turned private. Basically, Monitor's error flow is something like this: 1. An error occurs in the handler, it calls qemu_error_new() 2. qemu_error_new() builds a new QError object and stores it in the Monitor struct 3. The handler returns 4. Top level Monitor code checks the Monitor struct and calls qerror_print() to print the error Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* Introduce QErrorLuiz Capitulino2009-12-035-1/+306
| | | | | | | | | | | | | | | | QError is a high-level data type which represents an exception in QEMU, it stores the following error information: - class Error class name (eg. "ServiceUnavailable") - description A detailed error description, which can contain references to run-time error data - filename The file name of where the error occurred - line number The exact line number of the error - function The function name of where the error occurred - run-time data Any run-time error data Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* utests: Add qstring_from_substr() unit-testLuiz Capitulino2009-12-031-0/+14
| | | | | Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* utests: Add qstring_append_chr() unit-testLuiz Capitulino2009-12-031-0/+17
| | | | | Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* QString: Introduce qstring_from_substr()Luiz Capitulino2009-12-032-5/+16
| | | | | | | Note that we can now write qstring_from_str() as a wrapper. Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* QString: Introduce qstring_append_int()Luiz Capitulino2009-12-032-0/+10
| | | | | Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* QString: Introduce qstring_append_chr()Luiz Capitulino2009-12-032-5/+20
| | | | | | | It appends a C char to a QString. Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* QJSON: Introduce qobject_from_jsonv()Luiz Capitulino2009-12-032-10/+13
| | | | | | | | | It accepts a va_list and will be used by QError. Also simplifies the code a little, as the other qobject_from_() functions can use it. Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* fix I2C slave addressingJuha Riihimäki2009-12-021-2/+4
| | | | | | | | | | | | With the recent device handling changes the I2C slave addressing code was broken. With current code, if a slave with the correct address is not found on the bus the last scanned slave on the bus will be addressed. This is wrong. Please find attached a patch to fix it. Signed-off-by: Juha Riihimäki <juha.riihimaki@nokia.com> Acked-by: Riku Voipio <riku.voipio@iki.fi> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
* Fix qdev property type definition for isa serial/parallel devicesGerd Hoffmann2009-12-022-2/+2
| | | | | | | Use the correct qdev property type for these devices. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* Fix qemu_malloc/qemu_free use in rtl8139.cJean-Christophe DUBOIS2009-12-021-2/+2
| | | | | | | | rtl8139.c is using malloc()/free() instead of qemu_malloc()/qemu_free(). Fix it. Signed-off-by: Jean-Christophe DUBOIS <jcd@tribudubois.net> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* Fix free use in xen_backend.cJean-Christophe DUBOIS2009-12-021-1/+1
| | | | | | | | xen_backend.c is using qemu_free() instead of free(). Fix it. Signed-off-by: Jean-Christophe DUBOIS <jcd@tribudubois.net> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* Fix qemu_free use in scsi-generic.cJean-Christophe DUBOIS2009-12-021-2/+2
| | | | | | | | scsi-generic.c is using free() instead of qemu_free(). Fix it. Signed-off-by: Jean-Christophe DUBOIS <jcd@tribudubois.net> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* Fix qemu_free use in nseries.cJean-Christophe DUBOIS2009-12-021-1/+1
| | | | | | | | nseries.c is using free() instead of qemu_free(). Fix it. Signed-off-by: Jean-Christophe DUBOIS <jcd@tribudubois.net> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* Fix qemu_free use in bt-l2cap.cJean-Christophe DUBOIS2009-12-021-1/+1
| | | | | | | | bt-l2cap.c is using free() instead of qemu_free(). Fix it. Signed-off-by: Jean-Christophe DUBOIS <jcd@tribudubois.net> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* Fix qemu_free use in nand.cJean-Christophe DUBOIS2009-12-021-2/+2
| | | | | | | | nand.c is using free() instead of qemu_free(). Fix it. Signed-off-by: Jean-Christophe DUBOIS <jcd@tribudubois.net> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* Fix qemu_free use in baum.cJean-Christophe DUBOIS2009-12-021-4/+4
| | | | | | | | baum.c is using free() instead of qemu_free(). Fix it. Signed-off-by: Jean-Christophe DUBOIS <jcd@tribudubois.net> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* Fix qemu_free use in acpi.cJean-Christophe DUBOIS2009-12-021-1/+1
| | | | | | | | acpi.c is using free() instead of qemu_free(). Fix it. Signed-off-by: Jean-Christophe DUBOIS <jcd@tribudubois.net> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* pci: move apb specific stuff to apb_pci.cMichael S. Tsirkin2009-12-023-20/+29
| | | | | | | | | pci code had a TODO to move apb specific pci bridge initialization to apb_pci. Implement this and remove the TODO. Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* configure: use correct cflags in compiler checksMichael S. Tsirkin2009-12-021-20/+21
| | | | | | | | | | | | | | | | | | | linux-user build on fedora 11 breaks because fallocate is broken on that system if -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 are specified, which is what QEMU uses. We do have a configure check to catch this and disable fallocate, however, it turns out that default QEMU_CFLAGS/LDFLAGS were assigned in script *after* all compiler checks: so during checks we were not running compiler with same flags that we used for build later. Fix this by moving QEMU_CFLAGS to before compiler checks, and using comple_prog when checking for fallocate. This also fixes the fact that we do some compiler checks while assigning the flags, right below a comment that says "no cc tests beyond this point". Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* vga-pci: Fix access to linear framebufferStefan Weil2009-12-021-0/+6
| | | | | | | | | | Anthony Liguori's patch fixes the problems with vga display in graphical mode and SeaBIOS. I only adapted some values for vga-pci. Signed-off-by: Stefan Weil <weil@mail.berlios.de> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* Makefile: Remove unneeded prerequisitesStefan Weil2009-12-021-3/+1
| | | | | | | | | Thanks to f527c57935e22b56952d1ed1af36070b682ecf70 (fix parallel build), these prerequisites are redundant now and can be removed. Signed-off-by: Stefan Weil <weil@mail.berlios.de> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* Merge commit 'mst/for_anthony' into mstAnthony Liguori2009-12-0139-235/+290
|\
| * msix: clear pending bit of an unused vectorMichael S. Tsirkin2009-12-011-10/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | PCI spec states: if a masked vector has its Pending bit set, and the associated underlying interrupt events are somehow satisfied (usually by software though the exact manner is function-specific), the function must clear the Pending bit, to avoid sending a spurious interrupt message later when software unmasks the vector. In our case this happens if vector becomes unused. Clear pending bit in this case. Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
| * msix: fix reset value for enable bitMichael S. Tsirkin2009-12-011-1/+2
| | | | | | | | | | | | | | | | | | On reset, we currently clear all bits in msix control register *except* enable bit. This is wrong: the spec says we should clear writeable bits: function mask and enable bit. Correct this. Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
| * msix: fix mask bit state after resetMichael S. Tsirkin2009-12-011-0/+11
| | | | | | | | | | | | | | PCI spec states that mask bit must be 1 after reset. Make it so. Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
| * virtio: do not reset msix state on soft resetMichael S. Tsirkin2009-12-011-4/+8
| | | | | | | | | | | | | | | | | | msix state is managed by OS, not the driver, so it's wrong to touch it on io from driver. Mark all vectors unused instead. Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
| * msix: add helper to unuse all msix entriesMichael S. Tsirkin2009-12-012-0/+8
| | | | | | | | | | | | will be used by virtio on soft reset Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
| * pci: convert goto into scope in bridge_filterMichael S. Tsirkin2009-12-011-6/+7
| | | | | | | | | | | | | | | | goto into scope is evil. rearrange pci_bridge_filter so that we always go to end of function on error. Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Acked-by: Isaku Yamahata <yamahata@valinux.co.jp>
| * pci: pci bridge related clean up.Isaku Yamahata2009-12-012-7/+12
| | | | | | | | | | | | | | | | - fix bridge prefetchable memory accesser to check 64bit or not. - use pcibus_t consistently instead mixing pcibus_t and uint64_t. Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
| * pci: fix pci_config_get_io_base().Isaku Yamahata2009-12-011-1/+1
| | | | | | | | | | | | | | fix typo in pci_config_get_io_base(). Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
| * pci: remove magic number, 256 in pci.cIsaku Yamahata2009-12-011-2/+3
| | | | | | | | | | | | | | This patch replaces magic number, 256, with ARRAY_SIZE(). Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
| * pci: split up up pci_update mappingsMichael S. Tsirkin2009-12-011-57/+68
| | | | | | | | | | | | | | | | | | Split bar address math into a separate function. In particular, this gets rid of an ugly forward goto into scope that we have there. Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Acked-by: Isaku Yamahata <yamahata@valinux.co.jp>
| * pci: clean up of pci_update_mappings()Isaku Yamahata2009-12-011-1/+1
| | | | | | | | | | | | | | This patch converts r->size == 0 to !r_size. Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
| * pci: remove unused constantsIsaku Yamahata2009-12-011-9/+0
| | | | | | | | | | | | | | | | This patch removes unused constants committed by fb23162885f7fd8cf7334bed22c25ac32c7d8b9d. Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
| * pci: move typedef, PCIHostState, PCIExpressHost to qemu-common.h.Isaku Yamahata2009-12-013-4/+6
| | | | | | | | | | | | | | | | | | This patch moves two typedefs, PCIHostState and PCIExpressHost to qemu-common.h for consistency as PCIBus and PCIDevice are typedefed in qemu-common.h. Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
| * pci: remove some unnecessary comment in pci.hIsaku Yamahata2009-12-011-9/+2
| | | | | | | | | | | | | | | | This patch removes some comment which should go into commit log in pci.h. Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
| * pci: clean up of pci_init_wmask().Isaku Yamahata2009-12-011-3/+3
| | | | | | | | | | | | | | This patch replaces for loop by memset in pci_init_wmask(). Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
| * pci: kill unnecessary included in pci.cIsaku Yamahata2009-12-011-1/+0
| | | | | | | | | | | | | | | | including pci_host.h isn't needed by pci.c. This patch kills it. Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
| * pci_host: remove unnecessary & 0xff.Isaku Yamahata2009-12-011-2/+3
| | | | | | | | | | | | | | This patch removes unnecessary & 0xff in pci_dev_find_by_addr(). Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
| * pci: s/pci_find_host_bus/pci_find_root_bus/gIsaku Yamahata2009-12-013-7/+7
| | | | | | | | | | | | | | | | This patch renames pci_find_host_bus() to pci_find_root_bus() as suggested by "Michael S. Tsirkin" <mst@redhat.com>. Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
| * pci: remove pci_sub_bus() by open coding.Isaku Yamahata2009-12-011-8/+4
| | | | | | | | | | | | | | | | Because pci_sub_bus() is used only once so eliminate it by open coding as suggested by "Michael S. Tsirkin" <mst@redhat.com>. Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
| * pci: shorten pci_host_{conf, data}_register_xxx function a bit.Isaku Yamahata2009-12-019-27/+27
| | | | | | | | | | | | | | | | | | pci_host_data_register_io_memory and its variants are too long a bit. So shorten them. Now they are pci_host_{conf, data}_register_{mmio, mmio_noswap, ioport}() Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
| * pci: rename (pci_/pcie_mmcfg_)addr_to_devIsaku Yamahata2009-12-012-6/+7
| | | | | | | | | | | | | | | | | | This patch renames pci_addr_to_dev(), pcie_mmcfg_addr_to_dev() to pci_dev_find_by_addr(), pcie_dev_find_by_mmcfg_addr() as "Michael S. Tsirkin" <mst@redhat.com> suggested. Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
| * pci: remove pci_addr_to_config() by open codeIsaku Yamahata2009-12-011-7/+2
| | | | | | | | | | | | | | | | This patch removes pci_addr_to_config() and open code it as suggested by Michael S. Tsirkin <mst@redhat.com>. Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
| * pci: simplify (pci_/pcie_mmcfg_)data_read()Michael S. Tsirkin2009-12-012-37/+11
| | | | | | | | | | | | | | | | | | Remove switch on length: we don't care about high bits for value, so just return all ones if no device. And add one assert(). Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Acked-by: Isaku Yamahata <yamahata@valinux.co.jp>
| * pci: move pci_data_{read, write}() declaration from pci.h to pci_host.hIsaku Yamahata2009-12-014-2/+5
| | | | | | | | | | | | | | | | | | | | Now pci host stuff has been moved from pci.[hc] to pci_host.[hc] so the declaration of pci_data_{read, write}() should be in pci_host.h This patch moves them from pci.h to pci_host.h for consistency. Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
OpenPOWER on IntegriCloud