summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* qemu-nbd: introduce NBDExportPaolo Bonzini2011-12-223-29/+61
| | | | | | | Wrap the common parameters of nbd_trip and nbd_negotiate in a single opaque struct. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
* qemu-nbd: introduce nbd_do_receive_requestPaolo Bonzini2011-12-221-21/+47
| | | | | | Group the receiving of a response and the associated data into a new function. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
* qemu-nbd: more robust handling of invalid requestsPaolo Bonzini2011-12-221-27/+30
| | | | | | | Fail invalid requests with EINVAL instead of dropping them into the void. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
* qemu-nbd: introduce nbd_do_send_replyPaolo Bonzini2011-12-221-14/+32
| | | | | | | | | | | Group the sending of a reply and the associated data into a new function. Without corking, the caller would be forced to leave 12 free bytes at the beginning of the data pointer. Not too ugly, but still ugly. :) Using nbd_do_send_reply everywhere will help when the routine will set up the write handler that re-enters the send coroutine. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
* qemu-nbd: simplify nbd_tripPaolo Bonzini2011-12-221-17/+8
| | | | | | | | | | Use TCP_CORK to remove a violation of encapsulation, that would later require nbd_trip to know too much about an NBD reply. We could also switch to sendmsg (qemu_co_sendv) later, it is even easier once coroutines are in. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
* move corking functions to osdep.cPaolo Bonzini2011-12-223-18/+12
| | | | Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
* qemu-nbd: remove data_size argument to nbd_tripPaolo Bonzini2011-12-223-7/+7
| | | | | | The size of the buffer is in practice part of the protocol. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
* qemu-nbd: remove offset argument to nbd_tripPaolo Bonzini2011-12-223-8/+5
| | | | | | The argument is write-only. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
* Update ioctl order in nbd_init() to detect EBUSYChunyan Liu2011-12-221-18/+9
| | | | | | | | | | | | | | | Update ioctl(s) in nbd_init() to detect device busy early. Current nbd_init() issues NBD_CLEAR_SOCKET before NBD_SET_SOCKET, if issuing "qemu-nbd -c /dev/nbd0 disk.img" twice, the second time won't detect EBUSY in nbd_init(), but in nbd_client will report EBUSY and do clear socket (the 1st time command will be affacted too because of no socket any more.) No change to previous version. Signed-off-by: Chunyan Liu <cyliu@suse.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
* nbd: add support for NBD_CMD_TRIMPaolo Bonzini2011-12-222-2/+38
| | | | Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
* nbd: add support for NBD_CMD_FLUSHPaolo Bonzini2011-12-222-9/+51
| | | | Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
* nbd: add support for NBD_CMD_FLAG_FUAPaolo Bonzini2011-12-222-2/+15
| | | | Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
* nbd: fix error handling in the serverPaolo Bonzini2011-12-221-9/+12
| | | | | | bdrv_read and bdrv_write return negative errno values, not -1. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
* nbd: allow multiple in-flight requestsPaolo Bonzini2011-12-221-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>
* nbd: split requestsPaolo Bonzini2011-12-221-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>
* nbd: switch to asynchronous operationPaolo Bonzini2011-12-222-65/+131
| | | | Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
* sheepdog: move coroutine send/recv function to generic codePaolo Bonzini2011-12-225-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>
* add qemu_send_full and qemu_recv_fullPaolo Bonzini2011-12-212-0/+71
| | | | Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
* sd: Remember to reset .expecting_acmd on reset.Andrzej Zaborowski2011-12-211-0/+1
| | | | Signed-off-by: Andrzej Zaborowski <andrew.zaborowski@intel.com>
* hw/sd.c: Clear status bits when read via response r6Peter Maydell2011-12-211-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>
* hw/sd.c: Correct handling of APP_CMD status bitPeter Maydell2011-12-211-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>
* hw/sd.c: Correct handling of type B SD status bitsPeter Maydell2011-12-211-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>
* hw/sd.c: Set ILLEGAL_COMMAND for ACMDs in invalid statePeter Maydell2011-12-211-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>
* hw/sd.c: Handle CRC and locked-card errors in normal code pathPeter Maydell2011-12-211-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>
* hw/sd.c: Handle illegal commands in sd_do_commandPeter Maydell2011-12-211-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>
* hw/sd.c: When setting ADDRESS_ERROR bit, don't clear everything elsePeter Maydell2011-12-211-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>
* hw/sd.c: On CRC error, set CRC error status bit rather than clearing itPeter Maydell2011-12-211-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>
* hw/sd.c: Add comment regarding CARD_STATUS_* definesPeter Maydell2011-12-211-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>
* hw/sd.c: Fix the set of commands which are failed when card is lockedPeter Maydell2011-12-211-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>
* hw/sysbus.c: Remove unnecessary conditionalsPeter Maydell2011-12-201-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>
* g_thread_init users: don't call it if glib >= 2.31Alon Levy2011-12-203-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>
* audio: remove unused parameter isa_picHervé Poussineau2011-12-2012-19/+19
| | | | | Signed-off-by: Hervé Poussineau <hpoussin@reactos.org> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* isa: always use provided ISA bus in isa_bus_irqs()Hervé Poussineau2011-12-201-2/+4
| | | | | Signed-off-by: Hervé Poussineau <hpoussin@reactos.org> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* isa: always use provided ISA bus when creating an isa deviceHervé Poussineau2011-12-201-6/+4
| | | | | Signed-off-by: Hervé Poussineau <hpoussin@reactos.org> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* malta: give ISA bus to ISA methodsHervé Poussineau2011-12-203-4/+4
| | | | | Signed-off-by: Hervé Poussineau <hpoussin@reactos.org> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* fulong2e: give ISA bus to ISA methodsHervé Poussineau2011-12-203-7/+5
| | | | | Signed-off-by: Hervé Poussineau <hpoussin@reactos.org> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* sun4u: give ISA bus to ISA methodsHervé Poussineau2011-12-201-2/+4
| | | | | Signed-off-by: Hervé Poussineau <hpoussin@reactos.org> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* alpha: give ISA bus to ISA methodsHervé Poussineau2011-12-203-8/+9
| | | | | Signed-off-by: Hervé Poussineau <hpoussin@reactos.org> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* pc: give ISA bus to ISA methodsHervé Poussineau2011-12-203-6/+7
| | | | | Signed-off-by: Hervé Poussineau <hpoussin@reactos.org> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* i8259: give ISA device to isa_register_ioport()Hervé Poussineau2011-12-201-2/+2
| | | | | Signed-off-by: Hervé Poussineau <hpoussin@reactos.org> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* isa: move ISABus structure definition to header fileHervé Poussineau2011-12-202-5/+6
| | | | | Signed-off-by: Hervé Poussineau <hpoussin@reactos.org> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* isa: give ISABus/ISADevice to isa_create(), isa_bus_irqs() and isa_get_irq() ↵Hervé Poussineau2011-12-2033-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>
* net: store guest timestamp in dump file instead of time since guest startupHervé Poussineau2011-12-201-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>
* net: truncate output file when using dump backendHervé Poussineau2011-12-201-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>
* i440fx: remove piix3 fieldPaolo Bonzini2011-12-201-3/+0
| | | | | Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* qdev: fix hotplug when no -device is specifiedAnthony Liguori2011-12-193-0/+16
| | | | | | | | | | The peripheral[-anon] containers are initialized lazily but since they sit on sysbus, they can not be created after realize. This was causing an abort() to occur during hotplug if no -device option was used. This was spotted by qemu-test::device-add.sh Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* sysbus: remove sysbus_init_mmio_cb2Benoît Canet2011-12-192-21/+0
| | | | | | | This function is not longer in use so remove it. Signed-off-by: Benoît Canet <benoit.canet@gmail.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* ppce500_pci: remove sysbus_init_mmio_cb2 usageBenoît Canet2011-12-191-21/+6
| | | | | | | | | Expose only one container MemoryRegion to sysbus. (Peter Maydell's idea) Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Benoît Canet <benoit.canet@gmail.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* sh_pci: remove sysbus_init_mmio_cb2 usageBenoît Canet2011-12-192-27/+16
| | | | | | | | | | The isa region is not exposed as a sysbus region because the iobr register contains its address and use it to remap dynamically the region. (Peter Maydell's idea) Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Benoît Canet <benoit.canet@gmail.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* qom: register qdev properties also as non-legacy propertiesPaolo Bonzini2011-12-192-7/+28
| | | | | | | | | | | | | Push legacy properties into a "legacy-..." namespace, and make them available with correct types too. For now, all properties come in both variants. This need not be the case for string properties. We will revisit this after -device is changed to actually use the legacy properties. Reviewed-by: Anthony Liguori <aliguori@us.ibm.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
OpenPOWER on IntegriCloud