virtio-9p: Add P9_TOPEN support.
Implement P9_TOPEN 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>
virtio-9p: Add P9_TREAD support
Implement P9_TREAD support.
virtio-9p: Add P9_TCLUNK support
Implement P9_TCLUNK support.This patch gets `ls -al` to work.
virtio-9p: Add P9_TWRITE support
Implement P9_TWRITE support.This gets write to file to work
virtio-9p: Add P9_TCREATE support
Implement P9_TCREATE support.[jvrao@linux.vnet.ibm.com: strdup to qemu_strdup conversion]
virtio-9p: Add string manipulation support.
Add helpers to do string manipulation.
virtio-9p: Add minimal set of FileOperations
Add minimal set of FileOperations and the corresponding implementations forlocal fstype. These will be required for the FID management patches later on.
[aneesh.kumar@linux.vnet.ibm.com: rpath fix ]Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>...
virtio-9p: Add fid and qid management support.
Helper APIs for FID and QID management.
virtio-9p: Add stat and mode related helper functions.
Add helpers to obtain file stat and mode details.
virtio-9p: Add sg helper functions
Add scatter-gather helper functions.
virtio-9p: Add P9_TVERSION support
Implement P9_TVERSION support.
[sripathik@in.ibm.com: Handle unknown 9P versions as per the standards]
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>...
virtio-9p: Add P9_TATTACH support.
Implement P9_TATTACH support.
virtio-9p: Add P9_TSTAT support
Implement P9_TSTAT support. This get the mount to work on the guest.
[kiran@linux.vnet.ibm.com: malloc to qemu_malloc conversion]
virtio-9p: Add P9_TWALK support
Implement P9_TWALK support.
virtio-9p: Create a commandline option -fsdev
This patch creates a new command line option named -fsdev to hold any filesystem specific information.
The option will currently hold the following attributes:-fsdev fstype id=id,path=path_to_sharewherefstype: Type of the file system....
virtio-9p: Add a virtio 9p device to qemu
This patch doesn't implement the 9p protocol handlingcode. 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]...
virtio-9p: pdu processing support.
Add helpers to process the PDUs.
[kiran@linux.vnet.ibm.com: malloc to qemu_malloc coversion]
lsi: Purge request queue on soft reset
Avoid keeping zombie requests across controller reset by purging thequeue 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>
lsi: Properly initialize controller state on reset
The LSI controller was lacking a system reset handler. Simply invoke theexisting soft reset handler in this case. This also allows to drop itsexplicit invocation during init.
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>...
virtio-serial: Fix check for 'assert'; prevent NULL derefs
In the flush_queued_data() function, we expect port to be valid. Assertonly for port and not port || discard.
Reported-by: Juan Quintela <quintela@redhat.com>Signed-off-by: Amit Shah <amit.shah@redhat.com>...
Merge remote branch 'qemu-kvm/uq/master' into HEAD
Fix missing '|' in '|=', spotted by clang analyzer
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
cmd646: fix abort due to changed opaque pointer for ioport read
We cannot install different opaque pointer for read and writeof the same i/o address.
- handle zero address in bmdma_writeb_common and install the same opaque pointer for both read and write access....
cmd646: pass pci_dev as it needs it
Instead of doing tricks to get the pci_dev, just pass it in the 1stplace. Patch is a bit longer that reverting the pci_dev field, but itstates more clearly (IMHO) what we are doing.
It also fixes the bm test, now that you told me that ->unit is not...
vga: fix typo in length passed to kvm_log_stop
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
iov: Introduce a new file for helpers around iovs, add iov_from_buf()
The virtio-net code uses iov_fill() which fills an iov from a linearbuffer. The virtio-serial-bus code does something similar in anopen-coded function.
Create a new iov.c file that has iov_from_buf()....
iov: Add iov_to_buf and iov_size helpers
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 wasused in virtio-ballon.c....
virtio-serial: Handle scatter-gather buffers for control messages
Current control messages are small enough to not be split into multiplebuffers but we could run into such a situation in the future or amalicious guest could cause such a situation.
So handle the entire iov request for control messages....
virtio-serial: Handle scatter/gather input from the guest
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>
virtio-serial: Apps should consume all data that guest sends out / Fix virtio api abuse
We cannot indicate to the guest how much data was consumed by an app forout_bufs. So we just have to assume the apps will consume all the datathat are handed over to them....
virtio-serial: Discard data that guest sends us when ports aren't connected
Before the earlier patch, we relied on incorrect virtio api usage tosignal to the guest that a particular buffer wasn't consumed by thehost.
After fixing that, we now just discard the data the guest sends us while...
virtio-serial: Implement flow control for individual ports
Individual ports can now signal to the virtio-serial core to stopsending data if the ports cannot immediately handle new data. When aport later unthrottles, any data queued up in the virtqueue are sent to...
virtio-serial: save/load: Ensure target has enough ports
The target could be started with max_nr_ports for a virtio-serial devicelesser than what was available on the source machine. Fail the migrationin such a case.
Signed-off-by: Amit Shah <amit.shah@redhat.com>...
virtio-serial: save/load: Ensure nr_ports on src and dest are same.
The number of ports on the source as well as the destination machinesshould match. If they don't, it means some ports that got hotplugged onthe source aren't instantiated on the destination. Or that ports that...
virtio-serial: save/load: Ensure we have hot-plugged ports instantiated
If some ports that were hot-plugged on the source are not available onthe destination, fail migration instead of trying to deref a NULLpointer.
virtio-serial: save/load: Send target host connection status if different
If the host connection to a port is closed on the destination machineafter migration, whereas the connection was open on the source, theguest has to be informed of that.
Similar for a host connection open on the destination....
virtio-serial: Use control messages to notify guest of new ports
Allow the port 'id's to be set by a user on the command line. This isneeded by management apps that will want a stable port numbering schemefor hot-plug/unplug and migration.
Since the port numbers are shared with the guest (to identify ports in...
virtio-serial: whitespace: match surrounding code
The virtio-serial code doesn't mix declarations and definitions, soseparate them out on different lines.
Signed-off-by: Amit Shah <amit.shah@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
virtio-serial: Remove redundant check for 0-sized write request
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 befine.
virtio-serial: Update copyright year to 2010
virtio-serial: Propagate errors in initialising ports / devices in guest
If adding of ports or devices in the guest fails we can send out a QMPevent so that management software can deal with it.
virtio-serial: Send out guest data to ports only if port is opened
Data should be written only when ports are open.
sh4: remove dead assignments, spotted by clang analyzer
Value stored is never read.
ppc: add missing 'break', spotted by clang analyzer
ppc: remove dead assignments, spotted by clang analyzer
alpha: remove dead assignments, spotted by clang analyzer
microblaze: remove dead assignments, spotted by clang analyzer
cris: remove dead assignments, spotted by clang analyzer
arm: remove dead assignments, spotted by clang analyzer
x86: remove dead assignments, spotted by clang analyzer
Remove dead assignments in various common files, spotted by clang analyzer
usb: remove dead assignments, spotted by clang analyzer
bt: remove dead assignments, spotted by clang analyzer
Fix harmless if statement with empty body, spotted by clang
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;...
Remove un-needed code
The bdrv_set_geometry_hint call below is not needed - it's just settingwhat was just read.
Signed-off-by: Bruce Rogers <brogers@novell.com>Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Replace calls of old bdrv_open
What is known today as bdrv_open2 becomes the new bdrv_open. All remainingcallers of the old function are converted to the new one. In some places theyeven know the right format, so they should have used bdrv_open2 from the...
Make qemu-config available for tools
To be able to use config files for blkdebug, we need to make these functionsavailable in the tools. This involves moving two functions that can only bebuilt in the context of the emulator.
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
bt-sdp: Fix an excessive ; and assignment of the wrong variable
Problem-spotted-by: Blue Swirl <blauwirbel@gmail.com>Signed-off-by: Andrew Zaborowski <balrogg@gmail.com>
bt-l2cap: fix if statement with empty body, spotted by clang
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....
pci: fix pci_find_bus().
When looking down child bus, it should look parent bridge'sbus 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>...
Check for invalid initrd file
When qemu is invoked with an invalid initrd file, it crashes. Followingpatch prints a error message and exits if an invalid initrd isspecified. Includes changes suggested by JV.
Signed-off-by: M. Mohan Kumar <mohan@in.ibm.com>...
virtio-blk: Fix use after free in error case
virtio_blk_req_complete frees the request, so we can't access it any more whencalling 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>
qdev: Convert qdev_unplug() to QError
Note: our device unplug methods don't need conversion work, becausethey can't currently fail.
Signed-off-by: Markus Armbruster <armbru@redhat.com>Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
monitor: convert do_device_del() to QObject, QError
error: Drop extra messages after qemu_opts_set() and qemu_opts_parse()
Both functions report errors nicely enough now, no need for additionalmessages.
error: Use QERR_INVALID_PARAMETER_VALUE instead of QERR_INVALID_PARAMETER
Fix harmless if statements with empty body, spotted by clang
These clang errors are harmless but worth fixing: CC ppc-softmmu/usb-ohci.o/src/qemu/hw/usb-ohci.c:1104:59: error: if statement has empty body [-Wempty-body] ohci->ctrl_head, ohci->ctrl_cur);...
sparc32 use empty_slot for missing RAM v1
use empty_slot device for the RAM which is not installed
Models without ECC don't trap when missing ram is accessed.
v0->v1 compile only once and fix indentation
Signed-off-by: Artyom Tarasenko <atar4qemu@gmail.com>...
create empty_slot device
The empty_slot device emulates known to a bus but not connected devices.
Signed-off-by: Artyom Tarasenko <atar4qemu@gmail.com>Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
These clang errors are harmless but worth fixing: CC libhw64/fdc.o/src/qemu/hw/fdc.c:998:74: error: if statement has empty body [-Wempty-body] FLOPPY_DPRINTF("Floppy digital input register: 0x%02x\n", retval);...
Merge remote branch 'mst/for_anthony' into staging
vhost.c: include <linux/vhost.h> last
So the userspace headers define KERNEL_STRICT_NAMES and there's noconflict on type definition for older kernels.
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>Acked-by: Michael S. Tsirkin <mst@redhat.com>Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
vhost-net: disable mergeable buffers
vhost in current kernels doesn't support mergeable buffers.Disable this feature if vhost is enabled, until suchsupport is implemented.
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
vhost: fix features ack
vhost driver in qemu didn't ack features, and this happensto work because we don't really require any features. However,it's better not to rely on this. This patch passes features tovhost as guest acks them.
Signed-off-by: David L Stevens <dlstevens@us.ibm.com>...
r2d: always enable IDE and flash
IDE and flash are part of the R2D board, and can't be removed. Emulatethem even if there is no hard-drive plugged to the IDE or if the flashcontent is empty.
sh_pci: fix memory and I/O access
Since commit 8da3ff180974732fc4272cb4433fef85c1822961 ("MMIO callbackinterface changes"), the addresses passed to the I/O functions are anoffset to the start of the area. As a consequence, there is no need tocorrect the address using the value of IOBR. This make possible the use...
hw/r2d: add initrd support
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
eepro100: convert to new capability API
Using new pci_add_capability_at_offset makeseepro100 code cleaner.
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>Acked-by: Stefan Weil <weil@mail.berlios.de>
pci: add API to add capability at a known offset
Unlike virtio, device emulations need to add pci capabilitiesat known offsets to match real hardware. Make this possibleby adding an appropriate API.
hw/r2d: add flash memory
Implement virtio reset
The guest may issue a RESET command for virtio. So far we didn't botherto implement it, but with my new bootloader we actually need it for Linuxto get back to a safe state.
Signed-off-by: Alexander Graf <agraf@suse.de>Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
lsi: fix segfault in lsi_command_complete
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
move targphys.h and hw/poison.h inclusion to cpu-common.h
With more files from outside the hw/ directory being placed intolibhw, avoid the need to include hw/hw.h for the sake of targ_phys_addr_t.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
move two variable declarations out of vl.c
Debugcon: Fix debugging printf
Signed-off-by: Adam Lackorzynski <adam@os.inf.tu-dresden.de>Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
e1000: fix build on Ubuntu with _FORTIFY_SOURCE
There was a pointer cast warning on Ubuntu since _FORTIFY_SOURCE has been reenabled.
_FORTIFY_SOURCE had been disabled by 4a24470497360d8b77568b83008d0e9d6eb0787dand reenabled by 849583050d5f6f782718be8cb50688978973fbea....
smc91c111: allow access to reserved register
Some drivers seems to access the reserved register in bank 0 so allow andignore these accesses.
Signed-off-by: Lars Munch <lars@segv.dk>Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
smc91c111: mask register offset
this fixes the smc91c111 emulation which has been broken for gumstix andmainstone and maybe others since the "MMIO callback interface changes" 8da3ff180974732fc4272cb4433fef85c1822961 was commited.
Signed-off-by: Lars Munch <lars@segv.dk>...
baum: add destroy hook
Add a destroy hook for the baum character device, to properly close the BrlAPIconnection.
Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
update bochs vbe interface
The bochs vbe interface got a new register a while back, which specifiesthe linear framebuffer size in 64k units. This patch adds support forthe new register to qemu. With this patch applied vgabios 0.6c workswith qemu.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>...
eepro100: Set power management capability using pci_reserve_capability
pci_add_capability automatically updates PCI status andPCI capability pointer, so use it. Use pci_reserve_capabilityto make the new capability appear at the correct offset.
Signed-off-by: Stefan Weil <weil@mail.berlios.de>...
eepro100: fix mapping of flash memory
Signed-off-by: Stefan Weil <weil@mail.berlios.de>Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
eepro100: fix PCI interrupt pin configuration regression
Commit 15e89f5916c9e82347cbd1fd416db3e348bab426removed this setting, but it is still needed.
Without this patch, e100 device drivers usinginterrupts don't work with qemu.
See other nic emulations which also set the...
eepro100: Set configuration bit for standard TCB
For some devices, this bit is always set.For the others, it is set by default.
eepro100: Add new device variant i82801
This ethernet device is used in Toshiba Tecra 8200 notebooks.
eepro100: Simplified device instantiation
By using a private device info structure(as suggested by Gerd Hoffmann), handling of thedifferent device variants becomes much easier.
eepro100: Simplify status handling
Includes a minor STATUS_NOT_OK -> 0 tweak.