summaryrefslogtreecommitdiff
path: root/hw
AgeCommit message (Collapse)AuthorFilesLines
2010-05-03virtio-9p: Add a virtio 9p device to qemuAnthony Liguori7-0/+1039
This patch doesn't implement the 9p protocol handling code. It adds a simple device which dump the protocol data. [jvrao@linux.vnet.ibm.com: Little-Endian to host format conversion] [aneesh.kumar@linux.vnet.ibm.com: Multiple-mounts support] Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-05-03virtio-9p: Create a commandline option -fsdevGautham R Shenoy1-0/+32
This patch creates a new command line option named -fsdev to hold any file system specific information. The option will currently hold the following attributes: -fsdev fstype id=id,path=path_to_share where fstype: Type of the file system. id: Identifier used to refer to this fsdev path: The path on the host that is identified by this fsdev. [aneesh.kumar@linux.vnet.ibm.com: Abstraction using FsContext] Signed-off-by: Gautham R Shenoy <ego@in.ibm.com> Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-05-03virtio-serial: Fix check for 'assert'; prevent NULL derefsAmit Shah1-1/+1
In the flush_queued_data() function, we expect port to be valid. Assert only for port and not port || discard. Reported-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Amit Shah <amit.shah@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-05-03lsi: Properly initialize controller state on resetJan Kiszka1-2/+8
The LSI controller was lacking a system reset handler. Simply invoke the existing soft reset handler in this case. This also allows to drop its explicit invocation during init. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-05-03lsi: Purge request queue on soft resetJan Kiszka1-0/+11
Avoid keeping zombie requests across controller reset by purging the queue and also dropping the currently active request. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-05-03Merge remote branch 'qemu-kvm/uq/master' into HEADAnthony Liguori1-2/+2
2010-05-02Fix missing '|' in '|=', spotted by clang analyzerBlue Swirl1-4/+4
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-05-01cmd646: fix abort due to changed opaque pointer for ioport readIgor V. Kovalenko1-4/+5
We cannot install different opaque pointer for read and write of the same i/o address. - handle zero address in bmdma_writeb_common and install the same opaque pointer for both read and write access. Signed-off-by: Igor V. Kovalenko <igor.v.kovalenko@gmail.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-05-01cmd646: pass pci_dev as it needs itIgor V. Kovalenko3-18/+45
Instead of doing tricks to get the pci_dev, just pass it in the 1st place. Patch is a bit longer that reverting the pci_dev field, but it states more clearly (IMHO) what we are doing. It also fixes the bm test, now that you told me that ->unit is not always valid. Signed-off-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Igor V. Kovalenko <igor.v.kovalenko@gmail.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-04-28vga: fix typo in length passed to kvm_log_stopMarcelo Tosatti1-2/+2
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
2010-04-28virtio-serial: Implement flow control for individual portsAmit Shah2-6/+53
Individual ports can now signal to the virtio-serial core to stop sending data if the ports cannot immediately handle new data. When a port later unthrottles, any data queued up in the virtqueue are sent to the port. Disable throttling once a port is closed (and we discard all the unconsumed buffers in the vq). The guest kernel can reclaim the buffers when it receives the port close event or when a port is being removed. Ensure we free up the buffers before we send out any events to the guest. Signed-off-by: Amit Shah <amit.shah@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-04-28virtio-serial: Discard data that guest sends us when ports aren't connectedAmit Shah1-37/+32
Before the earlier patch, we relied on incorrect virtio api usage to signal to the guest that a particular buffer wasn't consumed by the host. After fixing that, we now just discard the data the guest sends us while a host port is disconnected or doesn't have a handler registered for consuming data. This commit really doesn't change anything from the current behaviour, just makes the code slightly better by spinning off data handling to ports in another function. Signed-off-by: Amit Shah <amit.shah@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-04-28virtio-serial: Apps should consume all data that guest sends out / Fix ↵Amit Shah3-11/+8
virtio api abuse We cannot indicate to the guest how much data was consumed by an app for out_bufs. So we just have to assume the apps will consume all the data that are handed over to them. Fix the virtio api abuse in control_out() and handle_output(). Signed-off-by: Amit Shah <amit.shah@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-04-28virtio-serial: Handle scatter/gather input from the guestAmit Shah1-4/+8
Current guests don't send more than one iov but it can change later. Ensure we handle that case. Signed-off-by: Amit Shah <amit.shah@redhat.com> CC: Avi Kivity <avi@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-04-28virtio-serial: Handle scatter-gather buffers for control messagesAmit Shah1-3/+28
Current control messages are small enough to not be split into multiple buffers but we could run into such a situation in the future or a malicious guest could cause such a situation. So handle the entire iov request for control messages. Also ensure the size of the control request is >= what we expect otherwise we risk accessing memory that we don't own. Signed-off-by: Amit Shah <amit.shah@redhat.com> CC: Avi Kivity <avi@redhat.com> Reported-by: Avi Kivity <avi@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-04-28iov: Add iov_to_buf and iov_size helpersAmit Shah3-31/+44
iov_to_buf() puts the buffer contents in the iov in a linearized buffer. iov_size() gets the length of the contents in the iov. The iov_to_buf() function is the memcpy_to_iovec() function that was used in virtio-ballon.c. Signed-off-by: Amit Shah <amit.shah@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-04-28iov: Introduce a new file for helpers around iovs, add iov_from_buf()Amit Shah4-25/+59
The virtio-net code uses iov_fill() which fills an iov from a linear buffer. The virtio-serial-bus code does something similar in an open-coded function. Create a new iov.c file that has iov_from_buf(). Convert virtio-net and virtio-serial-bus over to use this functionality. virtio-net used ints to hold sizes, the new function is going to use size_t types. Later commits will add the opposite functionality -- going from an iov to a linear buffer. Signed-off-by: Amit Shah <amit.shah@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-04-28virtio-serial: Send out guest data to ports only if port is openedAmit Shah1-0/+5
Data should be written only when ports are open. Signed-off-by: Amit Shah <amit.shah@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-04-28virtio-serial: Propagate errors in initialising ports / devices in guestAmit Shah1-0/+10
If adding of ports or devices in the guest fails we can send out a QMP event so that management software can deal with it. Signed-off-by: Amit Shah <amit.shah@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-04-28virtio-serial: Update copyright year to 2010Amit Shah3-3/+3
Signed-off-by: Amit Shah <amit.shah@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-04-28virtio-serial: Remove redundant check for 0-sized write requestAmit Shah1-3/+0
The check for a 0-sized write request to a guest port is not necessary; the while loop below won't be executed in this case and all will be fine. Signed-off-by: Amit Shah <amit.shah@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-04-28virtio-serial: whitespace: match surrounding codeAmit Shah1-1/+4
The virtio-serial code doesn't mix declarations and definitions, so separate them out on different lines. Signed-off-by: Amit Shah <amit.shah@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-04-28virtio-serial: Use control messages to notify guest of new portsAmit Shah3-70/+133
Allow the port 'id's to be set by a user on the command line. This is needed by management apps that will want a stable port numbering scheme for hot-plug/unplug and migration. Since the port numbers are shared with the guest (to identify ports in control messages), we just send a control message to the guest indicating addition of new ports (hot-plug) or notifying the guest of the available ports when the guest sends us a DEVICE_READY control message. Signed-off-by: Amit Shah <amit.shah@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-04-28virtio-serial: save/load: Send target host connection status if differentAmit Shah1-0/+11
If the host connection to a port is closed on the destination machine after migration, whereas the connection was open on the source, the guest has to be informed of that. Similar for a host connection open on the destination. Signed-off-by: Amit Shah <amit.shah@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-04-28virtio-serial: save/load: Ensure we have hot-plugged ports instantiatedAmit Shah1-0/+7
If some ports that were hot-plugged on the source are not available on the destination, fail migration instead of trying to deref a NULL pointer. Signed-off-by: Amit Shah <amit.shah@redhat.com> Reported-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-04-28virtio-serial: save/load: Ensure nr_ports on src and dest are same.Amit Shah1-2/+16
The number of ports on the source as well as the destination machines should match. If they don't, it means some ports that got hotplugged on the source aren't instantiated on the destination. Or that ports that were hot-unplugged on the source are created on the destination. Signed-off-by: Amit Shah <amit.shah@redhat.com> Reported-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-04-28virtio-serial: save/load: Ensure target has enough portsAmit Shah1-2/+11
The target could be started with max_nr_ports for a virtio-serial device lesser than what was available on the source machine. Fail the migration in such a case. Signed-off-by: Amit Shah <amit.shah@redhat.com> Reported-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-04-25sh4: remove dead assignments, spotted by clang analyzerBlue Swirl1-2/+1
Value stored is never read. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-04-25ppc: add missing 'break', spotted by clang analyzerBlue Swirl1-0/+1
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-04-25ppc: remove dead assignments, spotted by clang analyzerBlue Swirl1-4/+0
Value stored is never read. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-04-25alpha: remove dead assignments, spotted by clang analyzerBlue Swirl1-2/+0
Value stored is never read. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-04-25microblaze: remove dead assignments, spotted by clang analyzerBlue Swirl1-2/+1
Value stored is never read. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-04-25cris: remove dead assignments, spotted by clang analyzerBlue Swirl1-1/+1
Value stored is never read. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-04-25arm: remove dead assignments, spotted by clang analyzerBlue Swirl12-38/+32
Value stored is never read. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-04-25x86: remove dead assignments, spotted by clang analyzerBlue Swirl6-16/+16
Value stored is never read. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-04-25Remove dead assignments in various common files, spotted by clang analyzerBlue Swirl1-3/+1
Value stored is never read. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-04-25usb: remove dead assignments, spotted by clang analyzerBlue Swirl6-12/+23
Value stored is never read. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-04-25bt: remove dead assignments, spotted by clang analyzerBlue Swirl2-8/+3
Value stored is never read. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-04-23Fix harmless if statement with empty body, spotted by clangBlue Swirl1-1/+2
This clang error is harmless but worth fixing: CC libhw32/rc4030.o /src/qemu/hw/rc4030.c:244:66: error: if statement has empty body [-Wempty-body] DPRINTF("read 0x%02x at " TARGET_FMT_plx "\n", val, addr); Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-04-23Remove un-needed codeBruce Rogers1-1/+0
The bdrv_set_geometry_hint call below is not needed - it's just setting what was just read. Signed-off-by: Bruce Rogers <brogers@novell.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2010-04-23Replace calls of old bdrv_openKevin Wolf1-1/+1
What is known today as bdrv_open2 becomes the new bdrv_open. All remaining callers of the old function are converted to the new one. In some places they even know the right format, so they should have used bdrv_open2 from the beginning. Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2010-04-23Make qemu-config available for toolsKevin Wolf2-2/+18
To be able to use config files for blkdebug, we need to make these functions available in the tools. This involves moving two functions that can only be built in the context of the emulator. Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2010-04-22bt-sdp: Fix an excessive ; and assignment of the wrong variableAndrzej Zaborowski1-2/+2
Problem-spotted-by: Blue Swirl <blauwirbel@gmail.com> Signed-off-by: Andrew Zaborowski <balrogg@gmail.com>
2010-04-22bt-l2cap: fix if statement with empty body, spotted by clangBlue Swirl1-3/+3
Fix clang error: CC bt-l2cap.o /src/qemu/hw/bt-l2cap.c:1000:41: error: if statement has empty body [-Wempty-body] /* TODO: Signal an error? */; This means that l2cap_sframe_in() may now get called. Signed-off-by: Blue Swirl <blauwirbel@gmail.com> Signed-off-by: Andrew Zaborowski <balrogg@gmail.com>
2010-04-20pci: fix pci_find_bus().Isaku Yamahata1-9/+16
When looking down child bus, it should look parent bridge's bus number, not child bus's. Optimized tail recursion and style fix. Cc: Blue Swirl <blauwirbel@gmail.com> Cc: "Michael S. Tsirkin" <mst@redhat.com> Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-04-19Check for invalid initrd fileM. Mohan Kumar1-0/+6
When qemu is invoked with an invalid initrd file, it crashes. Following patch prints a error message and exits if an invalid initrd is specified. Includes changes suggested by JV. Signed-off-by: M. Mohan Kumar <mohan@in.ibm.com> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2010-04-18virtio-blk: Fix use after free in error caseKevin Wolf1-3/+3
virtio_blk_req_complete frees the request, so we can't access it any more when calling bdrv_mon_event. Use the pointer that was copied earlier. Signed-off-by: Kevin Wolf <kwolf@redhat.com> Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
2010-04-18error: Use QERR_INVALID_PARAMETER_VALUE instead of QERR_INVALID_PARAMETERMarkus Armbruster1-1/+1
Signed-off-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
2010-04-18error: Drop extra messages after qemu_opts_set() and qemu_opts_parse()Markus Armbruster1-2/+0
Both functions report errors nicely enough now, no need for additional messages. Signed-off-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
2010-04-18monitor: convert do_device_del() to QObject, QErrorMarkus Armbruster2-5/+5
Signed-off-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>