summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2011-12-22nbd: fix error handling in the serverPaolo Bonzini1-9/+12
bdrv_read and bdrv_write return negative errno values, not -1. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2011-12-22nbd: allow multiple in-flight requestsPaolo Bonzini1-13/+56
Allow sending up to 16 requests, and drive the replies to the coroutine that did the request. The code is written to be exactly the same as before this patch when MAX_NBD_REQUESTS == 1 (modulo the extra mutex and state). Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2011-12-22nbd: split requestsPaolo Bonzini1-6/+46
qemu-nbd has a limit of slightly less than 1M per request. Work around this in the nbd block driver. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2011-12-22nbd: switch to asynchronous operationPaolo Bonzini2-65/+131
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2011-12-22sheepdog: move coroutine send/recv function to generic codePaolo Bonzini5-211/+260
Outside coroutines, avoid busy waiting on EAGAIN by temporarily making the socket blocking. The API of qemu_recvv/qemu_sendv is slightly different from do_readv/do_writev because they do not handle coroutines. It returns the number of bytes written before encountering an EAGAIN. The specificity of yielding on EAGAIN is entirely in qemu-coroutine.c. Reviewed-by: MORITA Kazutaka <morita.kazutaka@lab.ntt.co.jp> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2011-12-21virtio-serial-bus: Ports are expected to implement 'have_data' callbackAmit Shah1-3/+3
There's no need to check if ports can accept any incoming data from the guest each time the guest sends data. Check if the port implements such functionality during port initialisation. Signed-off-by: Amit Shah <amit.shah@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-12-21virtio-console: Properly initialise class methodsAmit Shah1-3/+6
The earlier code really was a hack: initialising class methods in an object init function as noted by Anthony. The motivation for that was to not have the virtio-serial-bus call into the callback functions if there was no chardev backend registered. However, that really wasn't a worthwhile optimisation, and definitely not one that was well-implemented. Get rid of it. Reported-by: Anthony Liguori <aliguori@us.ibm.com> Signed-off-by: Amit Shah <amit.shah@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-12-21virtio-console: Check if chardev backends available before calling into themAmit Shah1-0/+11
For the callback functions invoked by the virtio-serial-bus code, check if we have chardev backends registered before we call into the chardev functions. Signed-off-by: Amit Shah <amit.shah@redhat.com> Reported-by: Anthony Liguori <aliguori@us.ibm.com> Signed-off-by: Amit Shah <amit.shah@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-12-21add qemu_send_full and qemu_recv_fullPaolo Bonzini2-0/+71
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2011-12-21scripts/analyse-9p-simpletrace.py: Add symbolic names for 9p operations.Harsh Prateek Bora1-2/+73
Currently, we just print the numerical value of 9p operation identifier in case of RERROR which is less meaningful for readability. Mapping 9p operation ids to symbolic names provides a better tracelog: RERROR (tag = 1 , id = TWALK , err = " No such file or directory ") RERROR (tag = 1 , id = TUNLINKAT , err = " Directory not empty ") This patch provides a dictionary of all possible 9p operation symbols mapped to their numerical identifiers which are likely to be used in future at various places in this script. Signed-off-by: Harsh Prateek Bora <harsh@linux.vnet.ibm.com> Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
2011-12-21hw/9pfs: iattr_valid flags are kernel internal flags map them to 9p values.Aneesh Kumar K.V1-23/+24
Kernel internal values can change, add protocol values for these constant and use them. Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
2011-12-21hw/9pfs: Use the correct signed type for different variablesAneesh Kumar K.V4-16/+17
Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
2011-12-21hw/9pfs: replace iovec manipulation with QEMUIOVectorStefan Hajnoczi1-102/+60
The v9fs_read() and v9fs_write() functions rely on iovec[] manipulation code should be replaced with QEMUIOVector to avoid duplicating code. In the future it may be possible to make the code even more concise by using QEMUIOVector consistently across virtio and 9pfs. The "v" format specifier for pdu_marshal() and pdu_unmarshal() is dropped since it does not actually pack/unpack anything. The specifier was also not implemented to update the offset variable and could only be used at the end of a format string, another sign that this shouldn't really be a format specifier. Instead, see the new v9fs_init_qiov_from_pdu() function. This change avoids a possible iovec[] buffer overflow when indirect vrings are used since the number of vectors is now limited by the underlying VirtQueueElement and cannot be out-of-bounds. Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com> Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
2011-12-21sd: Remember to reset .expecting_acmd on reset.Andrzej Zaborowski1-0/+1
Signed-off-by: Andrzej Zaborowski <andrew.zaborowski@intel.com>
2011-12-21hw/sd.c: Clear status bits when read via response r6Peter Maydell1-0/+1
Response format r6 includes a subset of the status bits; clear the clear-on-read bits which are read by an r6 response. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Andrzej Zaborowski <andrew.zaborowski@intel.com>
2011-12-21hw/sd.c: Correct handling of APP_CMD status bitPeter Maydell1-7/+17
Fix some bugs in our implementation of the APP_CMD status bit: * the response to an ACMD should have APP_CMD set, not cleared * if an illegal ACMD is sent then the next command should be handled as a normal command This requires that we split "card is expecting an ACMD" from the state of the APP_CMD status bit (the latter indicates both "expecting ACMD" and "that was an ACMD"). Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Andrzej Zaborowski <andrew.zaborowski@intel.com>
2011-12-21hw/sd.c: Correct handling of type B SD status bitsPeter Maydell1-19/+25
Correct how we handle the type B ("cleared on valid command") status bits. In particular, the CURRENT_STATE bits in a response should be the state of the card when it received that command, not the state when it received the preceding command. (This is one of the issues noted in LP:597641.) Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Andrzej Zaborowski <andrew.zaborowski@intel.com>
2011-12-21hw/sd.c: Set ILLEGAL_COMMAND for ACMDs in invalid statePeter Maydell1-1/+1
App commands in an invalid state should set ILLEGAL_COMMAND, not merely return a zero response. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Andrzej Zaborowski <andrew.zaborowski@intel.com>
2011-12-21hw/sd.c: Handle CRC and locked-card errors in normal code pathPeter Maydell1-2/+5
Handle returning CRC and locked-card errors in the same code path we use for other responses. This makes no difference in behaviour but means that these error responses will be printed by the debug logging code. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Andrzej Zaborowski <andrew.zaborowski@intel.com>
2011-12-21hw/sd.c: Handle illegal commands in sd_do_commandPeter Maydell1-14/+11
Add an extra sd_illegal value to the sd_rsp_type_t enum so that sd_app_command() and sd_normal_command() can tell sd_do_command() that the command was illegal. This is needed so we can do things like reset certain status bits only on receipt of a valid command. For the moment, just use it to pull out the setting of the ILLEGAL_COMMAND status bit into sd_do_command(). Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Andrzej Zaborowski <andrew.zaborowski@intel.com>
2011-12-21hw/sd.c: When setting ADDRESS_ERROR bit, don't clear everything elsePeter Maydell1-2/+2
Fix a typo that meant that ADDRESS_ERRORs setting or clearing write protection would clear every other bit in the status register. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Andrzej Zaborowski <andrew.zaborowski@intel.com>
2011-12-21hw/sd.c: On CRC error, set CRC error status bit rather than clearing itPeter Maydell1-1/+1
If we fail to validate the CRC for an SD command we should be setting COM_CRC_ERROR, not clearing it. (This bug actually has no effect currently because sd_req_crc_validate() always returns success.) Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Andrzej Zaborowski <andrew.zaborowski@intel.com>
2011-12-21hw/sd.c: Add comment regarding CARD_STATUS_* definesPeter Maydell1-0/+5
Add a clarifying comment about what the CARD_STATUS_[ABC] macros are defining. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Andrzej Zaborowski <andrew.zaborowski@intel.com>
2011-12-21hw/sd.c: Fix the set of commands which are failed when card is lockedPeter Maydell1-7/+22
Fix bugs in the code determining whether to accept a command when the SD card is locked. Most notably, we had the condition completely reversed, so we would accept all the commands we should refuse and refuse all the commands we should accept. Correct this by refactoring the enormous if () clause into a separate function. We had also missed ACMD42 off the list of commands which are accepted in locked state: add it. This is one of the two problems reported in LP:597641. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Andrzej Zaborowski <andrew.zaborowski@intel.com>
2011-12-20hw/sysbus.c: Remove unnecessary conditionalsPeter Maydell1-13/+5
Now that all sysbus MMIO regions are MemoryRegions, mmio[n].memory is never NULL, and we can remove some unnecessary conditionals. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-12-20g_thread_init users: don't call it if glib >= 2.31Alon Levy3-0/+15
since commit f9b29ca03 included in release 2.31 (docs below say 2.32 but that is not correct) and onwards g_thread_init is deprecated and calling it is not required: http://developer.gnome.org/glib/unstable/glib-Deprecated-Thread-APIs.html#g-thread-init g_thread_init has been deprecated since version 2.32 and should not be used in newly-written code. This function is no longer necessary. The GLib threading system is automatically initialized at the start of your program. Fixes bulid failure when warnings are treated as errors on fedora 17. I only tested the change to vl.c, and copy pasted to the two other locations (couldn't decide if a wrapper for calling g_thread_init is uglier). Signed-off-by: Alon Levy <alevy@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-12-20audio: remove unused parameter isa_picHervé Poussineau12-19/+19
Signed-off-by: Hervé Poussineau <hpoussin@reactos.org> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-12-20isa: always use provided ISA bus in isa_bus_irqs()Hervé Poussineau1-2/+4
Signed-off-by: Hervé Poussineau <hpoussin@reactos.org> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-12-20isa: always use provided ISA bus when creating an isa deviceHervé Poussineau1-6/+4
Signed-off-by: Hervé Poussineau <hpoussin@reactos.org> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-12-20malta: give ISA bus to ISA methodsHervé Poussineau3-4/+4
Signed-off-by: Hervé Poussineau <hpoussin@reactos.org> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-12-20fulong2e: give ISA bus to ISA methodsHervé Poussineau3-7/+5
Signed-off-by: Hervé Poussineau <hpoussin@reactos.org> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-12-20sun4u: give ISA bus to ISA methodsHervé Poussineau1-2/+4
Signed-off-by: Hervé Poussineau <hpoussin@reactos.org> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-12-20alpha: give ISA bus to ISA methodsHervé Poussineau3-8/+9
Signed-off-by: Hervé Poussineau <hpoussin@reactos.org> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-12-20pc: give ISA bus to ISA methodsHervé Poussineau3-6/+7
Signed-off-by: Hervé Poussineau <hpoussin@reactos.org> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-12-20i8259: give ISA device to isa_register_ioport()Hervé Poussineau1-2/+2
Signed-off-by: Hervé Poussineau <hpoussin@reactos.org> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-12-20isa: move ISABus structure definition to header fileHervé Poussineau2-5/+6
Signed-off-by: Hervé Poussineau <hpoussin@reactos.org> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-12-20isa: give ISABus/ISADevice to isa_create(), isa_bus_irqs() and isa_get_irq() ↵Hervé Poussineau33-145/+170
functions NULL is a valid bus/device, so there is no change in behaviour. Signed-off-by: Hervé Poussineau <hpoussin@reactos.org> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-12-20net: store guest timestamp in dump file instead of time since guest startupHervé Poussineau1-1/+6
Stored dates are no more 1970-01-01 (+ run time), but have a real meaning. If someone wants to have comparable timestamps accross boots, it is possible to start qemu with -rtc to give the startup date. Signed-off-by: Hervé Poussineau <hpoussin@reactos.org> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-12-20net: truncate output file when using dump backendHervé Poussineau1-1/+1
This prevents data of a previous run to be seen in the new dump file. Reviewed-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com> Signed-off-by: Hervé Poussineau <hpoussin@reactos.org> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-12-20i440fx: remove piix3 fieldPaolo Bonzini1-3/+0
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-12-20memory: temporarily add memory_region_get_ram_addr()Avi Kivity2-0/+16
This is a layering violation, but needed while the code contains naked calls to qemu_get_ram_ptr() and the like. Signed-off-by: Avi Kivity <avi@redhat.com>
2011-12-20xen, vga: add API for registering the framebufferAvi Kivity4-0/+15
Xen currently uses the name of a memory region to determine whether it is the framebuffer. Replace with an explicit API. Signed-off-by: Avi Kivity <avi@redhat.com>
2011-12-20vhost: convert to MemoryListener APIAvi Kivity2-33/+96
Drop the use of cpu_register_phys_memory_client() in favour of the new MemoryListener API. The new API simplifies the caller, since there is no need to deal with splitting and merging slots; however this is not exploited in this patch. Signed-off-by: Avi Kivity <avi@redhat.com>
2011-12-20kvm: convert to MemoryListener APIAvi Kivity1-37/+70
Drop the use of cpu_register_phys_memory_client() in favour of the new MemoryListener API. The new API simplifies the caller, since there is no need to deal with splitting and merging slots; however this is not exploited in this patch. Signed-off-by: Avi Kivity <avi@redhat.com>
2011-12-20kvm: switch kvm slots to use host virtual address instead of ram_addr_tAvi Kivity4-21/+25
This simplifies a later switch to the memory API in slot management. Signed-off-by: Avi Kivity <avi@redhat.com>
2011-12-20memory: add API for observing updates to the physical memory mapAvi Kivity3-0/+145
Add an API that allows a client to observe changes in the global memory map: - region added (possibly with logging enabled) - region removed (possibly with logging enabled) - logging started on a region - logging stopped on a region - global logging started - global logging removed This API will eventually replace cpu_register_physical_memory_client(). Signed-off-by: Avi Kivity <avi@redhat.com>
2011-12-20memory: replace cpu_physical_sync_dirty_bitmap() with a memory APIAvi Kivity5-7/+19
The function is still used as the implementation. Signed-off-by: Avi Kivity <avi@redhat.com>
2011-12-20framebuffer: drop use of cpu_physical_sync_dirty_bitmap()Avi Kivity1-1/+1
Replace with memory API equivalent. Signed-off-by: Avi Kivity <avi@redhat.com>
2011-12-20loader: remove calls to cpu_get_physical_page_desc()Avi Kivity1-4/+5
cpu_get_physical_page_desc() is tied into the memory core's innards, replace it with uses of the API. Signed-off-by: Avi Kivity <avi@redhat.com>
2011-12-20framebuffer: drop use of cpu_get_physical_page_desc()Avi Kivity6-24/+27
cpu_get_physical_page_desc() is tied into the memory core's innards, replace it with uses of the API. Signed-off-by: Avi Kivity <avi@redhat.com>