qemu/msi: clean used vectors state on load
Clean up msix vector usage state on load. Since guest might have controlover it through the device, the device will have to load this state fromfile.
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
qemu/msi: missing braces
MSIX present bit is tested incorrectly, and only happens to work becausethe 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>
Prefer sysfs for USB host devices
Scanning for devices via /sys/bus/usb/devices/ and using them via the/dev/bus/usb/<bus>/<device> character devices is the prefered methodon modern kernels, so try that first.
When using SELinux and libvirt, qemu will have access to /sys/bus/usb...
qcow1: Fix qcow_aio_writev
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>
qcow2: Fix L1 table memory allocation
Contrary to what one could expect, the size of L1 tables is not clusteraligned. 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...
Make sure to mark MCE defines as ULL
Fixes build on 32-bit
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
usb-ohci: Fix endianness issue
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>
qemu-io: small cleanups for the aio code
Address a couple of review comments from Kevin.
Signed-off-by: Christoph Hellwig <hch@lst.de>
qemu-io: better input validation for vector-based commands
Fix up a couple of issues with validating the input of the variouslength 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...
qemu-io: add flag to mark files growable
Add a -g flag to the open command and the main qemu-io command line toallow 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>...
qemu-io: fix memory leak
qemu-io leaks the request buffer whenever the read or write function isn'texecuted 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>...
Disable kqemu by default at run time
-no-kqemu -> -enable-kqemu
kqemu is still present at compile time by default
Unregister savevm callback in eeprom93xx_free()
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>
fix segfault in msix_save
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>
qemu: remove control vector save
control vector is saved/restored by virtio-pci,it does not belong in virtio.
configure: Append extra cflags and ldflags
In order to allow overriding flags that are set by configure, we have toappend 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>
Allow setting qemu process name v2
Set the Linux process name to the name argument specified with name. I findthis useful to see which guests are taking CPU time in top.
This doesn't affect ps, which checks argv0, but rewriting theenvironment uses much more code, so I only used this simple way....
Make sure to only vm_start() a failed migration if we were running to beginwith.
Substitute O_DSYNC with O_SYNC or O_FSYNC when needed.
Signed-off-by: John Arbuckle <programmingkidx@gmail.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Don't abort if TUNSETSNDBUF fails where no sndbuf= arg is supplied
If no tap,sndbuf= arg is supplied, we use a default value. IfTUNSETSNDBUF fails in this case, we should not abort.
Don't leak VLANClientState on PCI hot remove
destroy_nic() requires that NICInfo::private by a PCIDevice pointer,but then goes on to require that the same pointer matchesVLANClientState::opaque.
That is no longer the case for virtio-net since qdev and wasn't...
consolidate user cpu_{in, out}[bwl] into ioport-user.c
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Allow adjustment of http block device's readahead size, via a new":readahead=###:" suffix.
Signed-off-by: Nolan Leake <nolan <at> sigbus.net>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
use constant IOPORTS_MASK instead of 0xffff.
ioport: consolidate duplicated logic in register_ioport_{read, write}().
Revert "support colon in filenames"
This reverts commit 707c0dbc97cddfe8d2441b8259c6c526d99f2dd8.
Replace signrom with shell script v3
In order to not execute code we just compiled, let's replace signromwith a shell script that does the same thing while staying compatibleto pretty much every system available.
This should make cross-compilation for windows easier....
split out ioport related stuffs from vl.c into ioport.c.
net: set a default value for sndbuf=
On reflection, perhaps it does make sense to set a default value forthe sndbuf= tap parameter.
For best effect, sndbuf= should be set to just below the capacity ofthe physical NIC.
Setting it higher will cause packets to be dropped before the limit...
qcow2: Make cache=writethrough default
The performance of qcow2 has improved meanwhile, so we don't need tospecial-case it any more. Switch the default to write-through cachinglike all other block drivers.
Fix build for ESD audio
configure: detect xen with --extra-cflags / --extra-ldflags
Attached patch lets configure find xen headers and xen libswhen 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>
QEMU: MCE: Add MCE simulation to qemu/tcg
- 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...
Merge commit 'linux-user/linux-user-for-upstream' into tmp-staging
MIPS signal handling fix
Add explicit padding to MIPS signal frame structures.
Signed-off-by: Paul Brook <paul@codesourcery.com>
Enable MIPS NPTL
Enable NPTL support for MIPS usermode emulation.
MIPS atomic instructions
Implement MIPS ll/sc instructions using atomic compare+exchange.
MIPS usermode TLS register
Implement cpu_set_tls for MIPS.
Fix MIPS sys_clone
The clone syscall takes 6 args.
qdev: replace bus_type enum with bus_info struct.
BusInfo is filled with name and size (pretty much like I did forDeviceInfo as well). There is also a function pointer to printbus-specific device information to the monitor. sysbus is hookedup there, I've also added a print function for PCI....
qdev: remove DeviceType
The only purpose DeviceType serves is creating a linked list ofDeviceInfo structs. This removes DeviceType and add a next field toDeviceInfo instead, so the DeviceInfo structs can be changed that way.Elimitates a pointless extra level of indirection....
qdev/pci: misc fixes.
qdev: convert es1370.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
qdev: convert ac97.
qdev: update pci device registration.
Makes pci_qdev_register take a PCIDeviceInfo struct instead of a bunchof parameters. Also adds config_read and config_write callbacks toPCIDeviceInfo, so drivers needing these can be converted to the qdevdevice API too....
Remove SDL/ prefix
Add out of memory and zero size argument checks to be consistent withthe qemu_malloc routines
wrap path for access syscall
Signed-off-by: Ulrich Hecht <uli@suse.de>Signed-off-by: Riku Voipio <riku.voipio@iki.fi>
getrlimit conversion mix-up
Fixes getrlimit implementation that overwrote the result of the syscallinstead of converting it
pipe argument should not be signed
pipedes is an address, it should not be signed (breaks for addresses
0x80000000)
64-bit clean socketcall syscall
makes socketcall 64-bit clean so it works on 64-bit big-endian systems
linux-user: increment MAX_ARG_PAGES
There's a error When doing something like that :find / -type f -print0 | xargs -0 echo
[ done in a arm chroot with qemu-arm and linux binfmt stuff or withfind / -type f -print0 | qemu-arm -L <path> <path>/usr/bin/xargs -0...
linux-user: check some parameters for some socket syscalls.
This patch is fixing following issues :
- commit 8fea36025b9d6d360ff3b78f88a84ccf221807e8 was applied to do_getsockname instead of do_accept.- Some syscalls were not checking properly the memory addresses passed...
linux-user/syscall.c: remove warning: ‘array’ may be used uninitialized in this function
Removes the following warning
CC i386-linux-user/syscall.occ1: warnings being treated as errors/media/nfs/qemu/linux-user/syscall.c: In function ‘do_syscall’:/media/nfs/qemu/linux-user/syscall.c:2219: warning: ‘array’ may be used uninitialized in this function...
configure: remove bogus linux-user check
linux-user=yes is not a reliable identifier that linux-user targetshave been selected. user targets can be selected via --target-listas well.
Fix the PCI header type of APB
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
Update OpenBIOS images to r505
For Sparc64, this fixes the PCI bridge configuration bugs revealed by theimproved bridge handling (b7ee1603c16c1feb0d439d2ddf6cf824119d0aab).
Fix Sparse warning
Work around Solaris gas problem
Rename target_cpu to target_arch2
monitor: Fix typo in documentation
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
target-mips: fix MADD and MSUB/MSUBU instructions
MADD was not correctly writing to HI.
MSUB/MSUBU are specified as `HI||LO - product', not `product - HI||LO'.
Signed-off-by: Nathan Froyd <froydnj@codesourcery.com>Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
Fix hxtool.
When converting from hx to texi format, hxtool (or to bemore precise sh which interprets hxtool) used standardshell expansion of wildcards while writing lines to theoutput.
Thus, something like "Password: **" looked very different in the generated documentation....
Use ctz64 in favor of ffsll
Not all host platforms support ffsll.
Respect the standard
Use pstrcpy and pstrcat to avoid OpenBSD linker warning
Suppress a GCC warning
Fix breakage by obsolete _P() for good
Fix sdl_zoom compile problems on OpenBSD
Fix missing strnlen problems
Fix missing strnlen (a GNU extension) problems by using qemu_strnlenused for user emulators also for system emulators.
Fix typo
Signed-off-by: malc <av1474@comtv.ru>
Remove bogus -Werror
Revert rules.mak changes from aba800a. These should not have been hereto start with.
Revert "Introduce reset notifier order"
This reverts commit 8217606e6edb49591b4a6fd5a0d1229cebe470a9 (andupdates later added users of qemu_register_reset), we solved theproblem it originally addressed less invasively.
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>...
monitor: Add completion for help command
monitor: Refactor acl commnds
Refactor the ACL monitor interface to make full use of the monitorcommand dispatcher. This also gives proper help formatting and commandcompletion. Note that 'acl allow' and 'acl deny' were combined to'acl_add aclname match allow|deny [index]' for consistency reasons....
x86: Factor out pc_new_cpu
At this point, this refactoring looks like overkill. But we will need itfor CPU hotplugging, and qemu-kvm already carries it. Merging it earlywould help qemu-kvm when rebasing against upstream.
KVM: x86: Refactor persistent CPU state
This patch aligns the KVM-related layout and encoding of the CPU stateto be saved to disk or migrated with qemu-kvm. The major differences arereordering of fields and a compressed interrupt_bitmap into a singlenumber as there can be no more than one pending IRQ at a time....
sdl: Fix memory leakage
Valgrind was so kind to remark that no one bothers to release keycodesafter use and that something is fishy about cleaning up the requestedkeyboard descriptor. With this patch applied, we no longer leak about12k during startup....
slirp: tftp: Relax filename format check
[ Applies on top of my recently posted slirp series. ]
Allow tftp requests with filenames that do not start with a slash.
Replace -no-virtio-balloon by -balloon
We want to do (at least) two things to the virtio-balloon device:suppress it, and control its PCI address. Option -no-virtio-balloonlets us do only the former. To get the latter, replace-no-virtio-balloon with...
move CONFIG_* values from yes to y
Signed-off-by: Juan Quintela <quintela@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Substitute ifdef CONFIG_FOO by obj-
Rename SOUND_HW to sound-obj-y
Substitute ifdef CONFIG_FOO by sound-obj-
make tags useful for block drivers and hardaware devices
block-raw: Allow pread beyond the end of growable images
When using O_DIRECT, qcow2 snapshots didn't work any more for me. In theprocess of creating the snapshot, qcow2 tries to pwrite some new information(e.g. new L1 table) which will often end up being after the old end of the...
qcow2: Cache refcount blocks during snapshot creation
The really time consuming part of snapshotting is to adjust the reference countof all clusters. Currently after each adjusted cluster the refcount block iswritten to disk.
Don't write each single byte immediately to disk but cache all writes to the...
monitor: Drop pci_addr prefix from hotplug commands
The "pci_addr=" prefix currently required by pci_add/remove anddrive_add has no practical use. Drop it, but still silently accept itfor backward compatibility.
kvm: Rework VCPU synchronization
During startup and after reset we have to synchronize user space to thein-kernel KVM state. Namely, we need to transfer the VCPU registers whenthey change due to VCPU as well as APIC reset.
This patch refactors the required hooks so that kvm_init_vcpu registers...
monitor: Make pci_add device options truely optional
Rename OBJS to obj-y
Rename LIBOBJS to libobj-y
Rename BLOCK_OBJS to block-obj-y
Rename AUDIO_OBJS to audio-obj-y
Rename SLIRP_OBJS to slirp-obj-y
Rename XEN_OBJS to xen-obj-y
Rename USER_OBJS to user-obj-y