aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2009-12-03QError: Add QERR_KVM_MISSING_CAPLuiz Capitulino2-0/+7
New class for KVM unavailable features errors. Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-12-03QError: Add QERR_DEVICE_NOT_ACTIVELuiz Capitulino2-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>
2009-12-03qdev: Use QError for 'device not found' errorLuiz Capitulino1-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>
2009-12-03QError: Add QERR_DEVICE_NOT_FOUNDLuiz Capitulino2-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>
2009-12-03monitor: QError supportLuiz Capitulino2-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>
2009-12-03Introduce QErrorLuiz Capitulino5-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>
2009-12-03utests: Add qstring_from_substr() unit-testLuiz Capitulino1-0/+14
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-12-03utests: Add qstring_append_chr() unit-testLuiz Capitulino1-0/+17
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-12-03QString: Introduce qstring_from_substr()Luiz Capitulino2-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>
2009-12-03QString: Introduce qstring_append_int()Luiz Capitulino2-0/+10
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-12-03QString: Introduce qstring_append_chr()Luiz Capitulino2-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>
2009-12-03QJSON: Introduce qobject_from_jsonv()Luiz Capitulino2-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>
2009-12-02fix I2C slave addressingJuha Riihimäki1-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>
2009-12-02Fix qdev property type definition for isa serial/parallel devicesGerd Hoffmann2-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>
2009-12-02Fix qemu_malloc/qemu_free use in rtl8139.cJean-Christophe DUBOIS1-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>
2009-12-02Fix free use in xen_backend.cJean-Christophe DUBOIS1-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>
2009-12-02Fix qemu_free use in scsi-generic.cJean-Christophe DUBOIS1-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>
2009-12-02Fix qemu_free use in nseries.cJean-Christophe DUBOIS1-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>
2009-12-02Fix qemu_free use in bt-l2cap.cJean-Christophe DUBOIS1-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>
2009-12-02Fix qemu_free use in nand.cJean-Christophe DUBOIS1-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>
2009-12-02Fix qemu_free use in baum.cJean-Christophe DUBOIS1-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>
2009-12-02Fix qemu_free use in acpi.cJean-Christophe DUBOIS1-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>
2009-12-02pci: move apb specific stuff to apb_pci.cMichael S. Tsirkin3-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>
2009-12-02configure: use correct cflags in compiler checksMichael S. Tsirkin1-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>
2009-12-02vga-pci: Fix access to linear framebufferStefan Weil1-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>
2009-12-02Makefile: Remove unneeded prerequisitesStefan Weil1-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>
2009-12-01Merge commit 'mst/for_anthony' into mstAnthony Liguori39-235/+290
2009-12-01msix: clear pending bit of an unused vectorMichael S. Tsirkin1-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>
2009-12-01msix: fix reset value for enable bitMichael S. Tsirkin1-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>
2009-12-01msix: fix mask bit state after resetMichael S. Tsirkin1-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>
2009-12-01virtio: do not reset msix state on soft resetMichael S. Tsirkin1-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>
2009-12-01msix: add helper to unuse all msix entriesMichael S. Tsirkin2-0/+8
will be used by virtio on soft reset Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2009-12-01pci: convert goto into scope in bridge_filterMichael S. Tsirkin1-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>
2009-12-01pci: pci bridge related clean up.Isaku Yamahata2-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>
2009-12-01pci: fix pci_config_get_io_base().Isaku Yamahata1-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>
2009-12-01pci: remove magic number, 256 in pci.cIsaku Yamahata1-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>
2009-12-01pci: split up up pci_update mappingsMichael S. Tsirkin1-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>
2009-12-01pci: clean up of pci_update_mappings()Isaku Yamahata1-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>
2009-12-01pci: remove unused constantsIsaku Yamahata1-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>
2009-12-01pci: move typedef, PCIHostState, PCIExpressHost to qemu-common.h.Isaku Yamahata3-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>
2009-12-01pci: remove some unnecessary comment in pci.hIsaku Yamahata1-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>
2009-12-01pci: clean up of pci_init_wmask().Isaku Yamahata1-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>
2009-12-01pci: kill unnecessary included in pci.cIsaku Yamahata1-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>
2009-12-01pci_host: remove unnecessary & 0xff.Isaku Yamahata1-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>
2009-12-01pci: s/pci_find_host_bus/pci_find_root_bus/gIsaku Yamahata3-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>
2009-12-01pci: remove pci_sub_bus() by open coding.Isaku Yamahata1-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>
2009-12-01pci: shorten pci_host_{conf, data}_register_xxx function a bit.Isaku Yamahata9-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>
2009-12-01pci: rename (pci_/pcie_mmcfg_)addr_to_devIsaku Yamahata2-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>
2009-12-01pci: remove pci_addr_to_config() by open codeIsaku Yamahata1-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>
2009-12-01pci: simplify (pci_/pcie_mmcfg_)data_read()Michael S. Tsirkin2-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>