summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2009-07-10flush pending aio requestsGlauber Costa1-0/+1
When we finish migration, there may be pending async io requests in flight. If we don't flush it before stage3 starting, it might be the case that the guest loses it. Signed-off-by: Glauber Costa <glommer@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-07-10kvm: Work around borken MSR_GET_INDEX_LISTJan Kiszka1-2/+5
Allocate enough memory for KVM_GET_MSR_INDEX_LIST as older kernels shot far beyond their limits, corrupting user space memory. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-07-10qemu/virtio: mark msi vectors used on loadMichael S. Tsirkin1-5/+17
Usage of msi vectors is controlled by the guest and so needs to be restored on load. Do this for msi vectors used by the virtio device. Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-07-10qemu/msi: missing bracesMichael S. Tsirkin1-1/+2
MSIX present bit is tested incorrectly, and only happens to work because the bit we are testing is 0x1. Add braces to fix this. Reported-by: Blue Swirl <blauwirbel@gmail.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-07-10qemu/msi: clean used vectors state on loadMichael S. Tsirkin1-0/+1
Clean up msix vector usage state on load. Since guest might have control over it through the device, the device will have to load this state from file. Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-07-10qcow2: Fix L1 table memory allocationKevin Wolf3-3/+4
Contrary to what one could expect, the size of L1 tables is not cluster aligned. So as we're writing whole sectors now instead of single entries, we need to ensure that the L1 table in memory is large enough; otherwise write would access memory after the end of the L1 table. Signed-off-by: Kevin Wolf <kwolf@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-07-10qcow1: Fix qcow_aio_writevKevin Wolf1-1/+1
Pass is_write = 1 to qcow_aio_setup when writing. Signed-off-by: Kevin Wolf <kwolf@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-07-10Prefer sysfs for USB host devicesMark McLoughlin1-9/+9
Scanning for devices via /sys/bus/usb/devices/ and using them via the /dev/bus/usb/<bus>/<device> character devices is the prefered method on modern kernels, so try that first. When using SELinux and libvirt, qemu will have access to /sys/bus/usb but not /proc/bus/usb, so although the current code will work just fine, it will generate SELinux AVC warnings. See also: https://bugzilla.redhat.com/508326 Reported-by: Daniel Berrange <berrange@redhat.com> Signed-off-by: Mark McLoughlin <markmc@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-07-10usb-ohci: Fix endianness issueMichael Buesch1-2/+2
This fixes a possible endianness issue in the usb-ohci hw module. hcca.frame and ohci->frame_number are 16bit, so use cpu_to_le16(). Signed-off-by: Michael Buesch <mb@bu3sch.de> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-07-10Make sure to mark MCE defines as ULLAnthony Liguori1-4/+4
Fixes build on 32-bit Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-07-10qemu-io: fix memory leakKevin Wolf1-22/+38
qemu-io leaks the request buffer whenever the read or write function isn't executed completely down the "normal" code path. [hch: also fix the aio and vectored variants the same way] Signed-off-by: Kevin Wolf <kwolf@redhat.com> Signed-off-by: Christoph Hellwig <hch@lst.de>
2009-07-10qemu-io: add flag to mark files growableChristoph Hellwig1-5/+26
Add a -g flag to the open command and the main qemu-io command line to allow opening a file growable. This is only allowed for protocols, mirroring the limitation exposed through bdrv_file_open. Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Kevin Wolf <kwolf@redhat.com>
2009-07-10qemu-io: better input validation for vector-based commandsChristoph Hellwig1-150/+68
Fix up a couple of issues with validating the input of the various length arguments for the vectored I/O commands: - do the alignment check on each length instead the always 0 count argument - use a long long varibale for the cvtnum return value so that we can check wether it wasn't a number - check for a too large argument instead of truncating it Also refactor it into a common helper for all four calers and avoid parsing the numbers twice. Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Kevin Wolf <kwolf@redhat.com>
2009-07-10qemu-io: small cleanups for the aio codeChristoph Hellwig1-24/+16
Address a couple of review comments from Kevin. Signed-off-by: Christoph Hellwig <hch@lst.de>
2009-07-09Disable kqemu by default at run timeAnthony Liguori3-7/+7
-no-kqemu -> -enable-kqemu kqemu is still present at compile time by default Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-07-09Make sure to only vm_start() a failed migration if we were running to beginAnthony Liguori1-1/+5
with. Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-07-09Allow setting qemu process name v2Andi Kleen2-2/+31
Set the Linux process name to the name argument specified with name. I find this useful to see which guests are taking CPU time in top. This doesn't affect ps, which checks argv[0], but rewriting the environment uses much more code, so I only used this simple way. v2: Use separate process= argument, no prefixes. Signed-off-by: Andi Kleen <ak@linux.intel.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-07-09configure: Append extra cflags and ldflagsJan Kiszka1-6/+6
In order to allow overriding flags that are set by configure, we have to append them instead of prepending as it is done so far. v2: Clarify documentation. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-07-09qemu: remove control vector saveMichael S. Tsirkin1-3/+0
control vector is saved/restored by virtio-pci, it does not belong in virtio. Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-07-09fix segfault in msix_saveMichael S. Tsirkin1-5/+7
This fixes segfault reported by Kevin Wolf, and simplifies the code in msix_save. Reported-by: Kevin Wolf <kwolf@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-07-09Unregister savevm callback in eeprom93xx_free()Mark McLoughlin1-0/+1
Otherwise if you hot remove an eepro100 NIC and then migrate, you get: Unknown savevm section or instance 'eeprom' 0 on the destination side. Signed-off-by: Mark McLoughlin <markmc@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-07-09Don't leak VLANClientState on PCI hot removeMark McLoughlin9-27/+25
destroy_nic() requires that NICInfo::private by a PCIDevice pointer, but then goes on to require that the same pointer matches VLANClientState::opaque. That is no longer the case for virtio-net since qdev and wasn't previously the case for rtl8139, ne2k_pci or eepro100. Make the situation a lot more clear by maintaining a VLANClientState pointer in NICInfo. Signed-off-by: Mark McLoughlin <markmc@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-07-09Don't abort if TUNSETSNDBUF fails where no sndbuf= arg is suppliedMark McLoughlin1-1/+1
If no tap,sndbuf= arg is supplied, we use a default value. If TUNSETSNDBUF fails in this case, we should not abort. Signed-off-by: Mark McLoughlin <markmc@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-07-09Substitute O_DSYNC with O_SYNC or O_FSYNC when needed.G 31-0/+4
Signed-off-by: John Arbuckle <programmingkidx@gmail.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-07-09Allow adjustment of http block device's readahead size, via a newNolan1-3/+47
":readahead=###:" suffix. Signed-off-by: Nolan Leake <nolan <at> sigbus.net> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-07-09consolidate user cpu_{in, out}[bwl] into ioport-user.cIsaku Yamahata7-137/+65
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-07-09ioport: consolidate duplicated logic in register_ioport_{read, write}().Isaku Yamahata1-14/+16
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-07-09use constant IOPORTS_MASK instead of 0xffff.Isaku Yamahata5-15/+16
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-07-09split out ioport related stuffs from vl.c into ioport.c.Isaku Yamahata7-248/+317
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-07-09Replace signrom with shell script v3Alexander Graf3-85/+48
In order to not execute code we just compiled, let's replace signrom with a shell script that does the same thing while staying compatible to pretty much every system available. This should make cross-compilation for windows easier. aliguori: fix build when objdir != srcdir Signed-off-by: Alexander Graf <agraf@suse.de> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-07-09Revert "support colon in filenames"Anthony Liguori6-48/+11
This reverts commit 707c0dbc97cddfe8d2441b8259c6c526d99f2dd8. Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-07-09Fix build for ESD audioAnthony Liguori1-5/+5
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-07-09qcow2: Make cache=writethrough defaultKevin Wolf4-16/+3
The performance of qcow2 has improved meanwhile, so we don't need to special-case it any more. Switch the default to write-through caching like all other block drivers. Signed-off-by: Kevin Wolf <kwolf@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-07-09net: set a default value for sndbuf=Mark McLoughlin2-6/+31
On reflection, perhaps it does make sense to set a default value for the sndbuf= tap parameter. For best effect, sndbuf= should be set to just below the capacity of the physical NIC. Setting it higher will cause packets to be dropped before the limit is hit. Setting it much lower will not cause any problems unless you set it low enough such that the guest cannot queue up new packets before the NIC has emptied its queue. In Linux, txqueuelen=1000 by default for ethernet NICs. Given a 1500 byte MTU, 1Mb is a good choice for sndbuf. If it turns out that txqueuelen is actually much lower than this, then sndbuf is essentially disabled. In the event that txqueuelen is much higher, it's unlikely that the NIC will be able to empty a 1Mb queue. Thanks to Herbert Xu for this logic. Signed-off-by: Mark McLoughlin <markmc@redhat.com> Cc: Herbert Xu <herbert.xu@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-07-09configure: detect xen with --extra-cflags / --extra-ldflagsChristoph Egger1-2/+2
Attached patch lets configure find xen headers and xen libs when called with --extra-cflags and --extra-ldflags options. Signed-off-by: Christoph Egger <Christoph.Egger@amd.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-07-09QEMU: MCE: Add MCE simulation to qemu/tcgHuang Ying8-2/+217
- MCE features are initialized when VCPU is intialized according to CPUID. - A monitor command "mce" is added to inject a MCE. - A new interrupt mask: CPU_INTERRUPT_MCE is added to inject the MCE. aliguori: fix build for linux-user Signed-off-by: Huang Ying <ying.huang@intel.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-07-09Merge commit 'linux-user/linux-user-for-upstream' into tmp-stagingAnthony Liguori4-92/+116
2009-07-09MIPS signal handling fixPaul Brook1-0/+2
Add explicit padding to MIPS signal frame structures. Signed-off-by: Paul Brook <paul@codesourcery.com>
2009-07-09Enable MIPS NPTLPaul Brook1-0/+1
Enable NPTL support for MIPS usermode emulation. Signed-off-by: Paul Brook <paul@codesourcery.com>
2009-07-09MIPS atomic instructionsPaul Brook3-24/+124
Implement MIPS ll/sc instructions using atomic compare+exchange. Signed-off-by: Paul Brook <paul@codesourcery.com>
2009-07-09MIPS usermode TLS registerPaul Brook1-0/+5
Implement cpu_set_tls for MIPS. Signed-off-by: Paul Brook <paul@codesourcery.com>
2009-07-09Fix MIPS sys_clonePaul Brook1-1/+1
The clone syscall takes 6 args. Signed-off-by: Paul Brook <paul@codesourcery.com>
2009-07-09qdev: convert ac97.Gerd Hoffmann1-20/+22
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2009-07-09qdev: convert es1370.Gerd Hoffmann1-19/+22
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2009-07-09qdev/pci: misc fixes.Gerd Hoffmann1-2/+3
* fix secondary bus setup. * use base->name instead of "FIXME" for device name. Yes, the device name is redundant. Only for drivers converted to qdev already though. Once all drivers are converted we can and should kill it. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2009-07-09qdev: remove DeviceTypeGerd Hoffmann2-27/+18
The only purpose DeviceType serves is creating a linked list of DeviceInfo structs. This removes DeviceType and add a next field to DeviceInfo instead, so the DeviceInfo structs can be changed that way. Elimitates a pointless extra level of indirection. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2009-07-09qdev: replace bus_type enum with bus_info struct.Gerd Hoffmann6-62/+103
BusInfo is filled with name and size (pretty much like I did for DeviceInfo as well). There is also a function pointer to print bus-specific device information to the monitor. sysbus is hooked up there, I've also added a print function for PCI. Device creation is slightly modified as well: The device type search loop now also checks the bus type while scanning the list instead of complaining thereafter in case of a mismatch. This effectively gives each bus a private namespace for device names. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Paul Brook <paul@codesourcery.com>
2009-07-09qdev: update pci device registration.Gerd Hoffmann10-36/+103
Makes pci_qdev_register take a PCIDeviceInfo struct instead of a bunch of parameters. Also adds config_read and config_write callbacks to PCIDeviceInfo, so drivers needing these can be converted to the qdev device API too. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2009-07-08Remove SDL/ prefixmalc1-1/+1
2009-07-08Add out of memory and zero size argument checks to be consistent withmalc1-5/+25
the qemu_malloc routines