Fix a Sparse warning about redefinition of offsetof()
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
Fix sys-queue.h conflict for good
Problem: Our file sys-queue.h is a copy of the BSD file, but there aresome additions and it's not entirely compatible. Because of that, there havebeen conflicts with system headers on BSD systems. Some hacks have beenintroduced in the commits 15cc9235840a22c289edbe064a9b3c19c5f49896,...
Try to fix BSD breakage by 806b60248218bd5f74a8b070f5a99a864e8e51c6
Include sys-queue.h early to override system queue definitions on BSD
Unbreak BSD: use qemu_fdatasync instead of fdatasync
Use proper format conversion specifier when printing size_t value
And untabify this while we are at it.
Signed-off-by: malc <av1474@comtv.ru>
oss: Unbreak mmaping the ability to mmap oss fd on Linux
gus: Do not manually free the state, qdev does it for us
audio: poll mode infrastructure
oss: poll mode handling
alsa: poll mode handling
audio: remove lsbindex/popcount in favour of host-utils's ctz32
vmstate: port hpet device
Signed-off-by: Juan Quintela <quintela@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
vmstate: port serial device
vmstate: port cirrus_vga device
kvm_arch_get_registers() shouldn't be called directly
Direct call to kvm_arch_get_registers() bypass logic incpu_synchronize_state()
Signed-off-by: Gleb Natapov <gleb@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
vmstate: port vmmouse device
vmstate: port pckbd device
vmstate: add uint64 array support
vmstate: port ioapic device
hpet: it is imposible that qemu_timer field is NULL at this point
vmstate: port dma device
vmstate: port fw_cfg device
vmstate: port i8259 device
vmstate: add support for uint8_t equal
vmstate: port fdc device
We can't move fifo back to an embeded array because it needs to be aligned
vmstate: add support for arrays of uint16_t
Make get_ticks_per_sec() a static inline
ticks_per_sec is a constant. There's no need to store it as a variable as itnever changes since our time is based on units.
Convert get_ticks_per_sec() to a static inline and move the constant intoqemu-timer.h. Remove all references to QEMU_TIMER_BASE so that we consistently...
vmstate: add sensible arguments to vmstate_unregister()
vmsd alone is not enugh, because we can have several structs saved with the same description (vmsd).
vmstate: rename run_after_load() -> post_load()
This naming was used in kvm tree, and is easier to remember
vmstate: Add pre_load() hook
vmstate: Add pre/post_save() hooks
vmstate: port cpu_comon
Unexport ticks_per_sec variable. Create get_ticks_per_sec() function
timers: Createt TimersState and put all timers state there
timers: move them to VMState
timers: remove useless check
loadvm_state is called from: vl.c during startup, vmstart() is called after finishing loading. The other caller do_loadvm() does the call after a vm_stop(). At both places where we can be saving state we are stoped a few lines before...
ram: remove support for loading v1
ram: Remove SaveVM Version 2 support
It don't work. It fails in this check
if (qemu_get_be32(f) != last_ram_offset)
With 512MB of ram, values were for me:
v = 20c00000 last_ram_offset = 20840000
Last time that some code changed that was this one....
Remove SaveVM v2 support
In previosu series I remove v2 support for RAM (that was the version that wassupported when SaveVM v3 appeared). Now we can't load RAM for any image saved in SaveVM v2, we can as well remove SaveVM v2 entirely.
Note: That SaveVM RAM was at v2 when General SaveVM support went from v2 to v3 makes talking about versions confusing at least...
convert windows console chardev to QemuOpts.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
convert tty + parport chardevs to QemuOpts.
new cmd line syntax: -chardev tty,id=name,path=/dev/tty* -chardev parport,id=name,path=/dev/parport*
convert vc chardev to QemuOpts.
new cmd line syntax: -chardev vc,id=name -chardev vc,id=name,width=pixels,height=pixels -chardev vc,id=name,cols=chars,rows=chars
convert mux chardev to QemuOpts.
new cmd line syntax: you can add mux=1 to any chardev to enable muxing,then attach it multiple times, like this:
-chardev pty,name=mux,mux=on
convert udp chardev to QemuOpts.
While being at it: create a new inet_dgram_opts() function for udp setup,so udp can handle IPv6 now.
new cmd line syntax: -chardev udp,id=name,host=remotehost,port=remoteport,\ localaddr=bindaddr,localport=bindport...
Allow -serial chardev:<name>
Lets put -chardev into use now. With this patch applied chardev:name isaccepted as chardev specification everywhere, i.e. now you can:
-chardev stdio,id=ttyS0 -serial chardev:ttyS0
which does the same as '-serial stdio"....
qdev: add parser for chardev properties
monitor: fix muxing
make the mux driver send mux_in and mux_out events when switchingfocus while hooking up more handlers.
stop using CharDriverState->focus in monitor.c, track state usingthe mux events instead. This also removes the implicit assumtion...
move mux focus field from CharDriverState to MuxDriver
Now that monitor stopped using focus we can make it internalto the mux driver.
sockets: add unix_connect_opts
Add unix_connect_opts(). Does the same as unix_connect(), but usesQemuOpts. unix_connect() is a compatibility wrapper forunix_connect_opts() now and should go away some day.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>...
sockets: add unix_listen_opts
Add unix_listen_opts(). Does the same as unix_listen(), but usesQemuOpts. unix_listen() is a compatibility wrapper forunix_listen_opts() now and should go away some day.
sockets: add unix_*_opts for windows.
Add unix_*_opts function dummys for windows.
sockets: add inet_connect_opts
Add inet_connect_opts(). Does the same as inet_connect(), but usesQemuOpts. inet_connect() is a compatibility wrapper forinet_connect_opts() now and should go away some day.
sockets: add inet_listen_opts
Add inet_listen_opts(). Does the same as inet_listen(), but usesQemuOpts. inet_listen() is a compatibility wrapper forinet_listen_opts() now and should go away some day.
convert unix+tcp chardevs to QemuOpts.
new cmd line syntax: unix socket: -chardev socket,id=name,path=/path/to/socket tcp socket: -chardev socket,id=name,host=hostaddr|ipaddr,port=portnr
server and nowait options work as usual. Alternatively you can use...
convert pty chardev to QemuOpts.
convert stdio chardev to QemuOpts.
convert msmouse chardev to QemuOpts.
convert braille chardev to QemuOpts.
VirtIO: Fix QEMU crash during Windows PNP tests
Hello,
In some cases bus driver can deassert "bus master" bit in PCI commandregister. The driver will no longer be able to update related registers inthe device. Eventually it will cause QEMU to exit in "virtqueue_num_heads"...
qdev: Fix i6300 upcast
Use DO_UPCAST() instead of container_of() to go from PCIDevice toI6300State. This ensures that PCIDevice is the first member of structI6300State.
Signed-off-by: Markus Armbruster <armbru@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
QemuOpts: split option parser into two functions.
looking for id= and creating a new QemuOpts instance is splitted fromthe actual option parser code now, so the parser can be called fromother contexts too.
qemu-option.h include protectors
qemu-option.h has no protection against including it twice.This patch adds the usual "#ifndef header" bits.
switch chardev to QemuOpts: infrastructure, null device
start switching chardevs to QemuOpts. This patch adds theinfrastructure and converts the null device.
The patch brings two new functions:
qemu_chr_open_opts() same as qemu_chr_open(), but uses QemuOpts instead of a...
convert file+pipe chardevs to QemuOpts.
new cmd line syntax: -chardev file,id=name,path=/path/to/file -chardev pipe,id=name,path=/path/to/pipe
qemu: make virtio-blk PCI compliant by default
commit bf011293faaa7f87e4de83185931e7411b794128 made virtio-blk-pci notPCI-compliant, since it makes region 0 (which is an i/o region)size > 256, and, since PCI 2.1, i/o regions are limited to 256 bytes size....
qemu: init all queues to NO_VECTOR value
initialize vectors for all vqs to VIRTIO_NO_VECTOR rather than 0 whichis a valid vector. This fixes migration which happened before driverwas loaded.
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>Reported-by: Amit Shah <amit.shah@redhat.com>...
block: add enable_write_cache flag
Add a enable_write_cache flag in the block driver state, and use it todecide if we claim to have a volatile write cache that needs controlledflushing from the guest. The flag is off if cache=writethrough isdefined because O_DSYNC guarantees that every write goes to stable...
block: use fdatasync instead of fsync if possible
If we are flushing the caches for our image files we only care about thedata (including the metadata required for accessing it) but not thingslike timestamp updates. So try to use fdatasync instead of fsync to...
block: add aio_flush operation
Instead stalling the VCPU while serving a cache flush try to do itasynchronously. Use our good old helper thread pool to issue anasynchronous fdatasync for raw-posix. Note that while Linux AIOimplements a fdatasync operation it is not useful for us because...
ide: use bdrv_aio_flush
Signed-off-by: Christoph Hellwig <hch@lst.de>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
virtio-blk: add volatile writecache feature
Add a new VIRTIO_BLK_F_WCACHE feature to virtio-blk to indicate that we havea volatile write cache that needs controlled flushing. Implement aVIRTIO_BLK_T_FLUSH operation to flush it.
Signed-off-by: Christoph Hellwig <hch@lst.de>...
usb-linux.c: fix buffer overflow
In usb-linux.c:usb_host_handle_control, we pass a 1024-byte buffer andlength to the kernel. However, the length was provided by the callerof dev->handle_packet, and is not checked, so the kernel might providetoo much data and overflow our buffer....
Fix conditional compilation (MIPS host)
Compilation for MIPS host (not part of official QEMU)checks __mips_isa_rev which is not always defined.
Signed-off-by: Stefan Weil <weil@mail.berlios.de>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Revert "don't call cpu_sychronize_state from reset handlers"
This reverts commit 733318ea9c6d846a6a047b87619e7d9d6e9707d1.
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Add bdrv_aio_multiwrite
One performance problem of qcow2 during the initial image growth aresequential writes that are not cluster aligned. In this case, when a firstrequests requires to allocate a new cluster but writes only to the firstcouple of sectors in that cluster, the rest of the cluster is zeroed - just...
virtio-blk: Use bdrv_aio_multiwrite
It is quite common for virtio-blk to submit more than one write request in arow to the qemu block layer. Use bdrv_aio_multiwrite to allow block drivers tooptimize its handling of the requests.
Signed-off-by: Kevin Wolf <kwolf@redhat.com>...
microblaze: Trap if QEMU finds an unknown insns.
If PVR settings enable illegal insn trap, trap when QEMU finds aninsn it knows nothing about.
Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
microblaze: Correct prio between MMU and unaligned exceptions.
The microblaze gives MMU faults priority. For stores we stillhave a flaw that the value leaks to memory in the case of anunaligned exception.
microblaze: HW Exception fixes.
Update OpenBIOS images to r577
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
X86_64: Use proper jumps/calls when displacement exceeds +-2G
Remove bit-rotten threshold handling
Thanks to Toshiya Takeda for bringing up an unrelated issue which ledto this.
F_DUPFD_CLOEXEC is not universally available
The same issue (and the same patch to the byte) was experienced/proposedby Vince Weaver.
Add information w.r.t default GUS IRQ assigment
Fix formatting
Fix formatting, get rid of conf and fix description
Fix formatting and and description field
qdev/isa: convert ne2000
Also split the isa bits into a separate source file, so we don't drag ina dependency for isa-bus.o for machines which want ne2k_pci only.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
qdev/isa: finish pckbd conversion
drop old init path and switch remaining users toisa_create_simple().
qdev/isa: convert real time clock
qdev/isa: convert soundblaster
qdev/isa: convert cs4231a sound card
qdev/isa: convert gravis ultrasound
qdev: simplify isa irq assignments
isa-bus owns the isa irqs now, so it can hand them out directly.There is no need for the separate isa_connect_irqs step, drop it.
Also hard-code isa interrupts which can't be configured anyway.
qdev: tag isabus-bridge as no-user
isabus-bridge isn't supposed to be added via -device ...
qdev: add isa_create() function
Like isa_create_simple, but doesn't call qdev_init, so one can setproperties after creating and before initializing the device.
isapc: pick a more sane default cpu for such old hardware.
qdev: add property type for 32bit signed integers.
qdev: drop iobase properties from isa bus
Lot of ISA devices work at fixed addresses, so having iobaseas bus property doesn't make much sense. Devices which canhave different iobases will get a device property.
Also simply hard-code stuff which can't be configured anyway....