slirp: Remove UDP protocol emulation (talk, cuseeme)
The UDP emulation code for talk has been commented out since thebeginning of time, and unless someone who runs CU-SeeMe on qemu withuser-mode networking can vouch that the special magic (a) is necessary...
slirp: Use monotonic clock if available (v2)
Calling gettimeofday() to compute a time interval can cause problems ifthe system clock jumps forwards or backwards; replace updtime() withqemu_get_clock(rt_clock), which calls clock_gettime(CLOCK_MONOTONIC) if...
Fix broken build
The only caller of on_vcpu() is protected by ifdefKVM_CAP_SET_GUEST_DEBUG, so protect on_vcpu() too otherwise QEMUmay not to build.
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
fix broken migration
While fixing migration with -S, commit89befdd1a6b18215153b8976682d57b7d03d5782 broke the rest of us. Poorglommer, with a poor family, spare him his life from this monstruosity.
Since the unconditional vm_start, not autostart was the villain, I'm putting...
tap-win32: Use correct headers.
Replace the usage of DDK headers with the SDK counterpart "winioctl.h".
Signed-off-by: Filip Navara <filip.navara@gmail.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Use 64bit pointer for dirty log
Dirty logs currently get written with native "long" size. On little endianit doesn't matter if we use uint64_t instead though, because we'd still endup using the right bytes.
On big endian, this does become a bigger problem, so we need to ensure that...
Use Little Endian for Dirty Log
We currently use host endian long types to store informationin the dirty bitmap.
This works reasonably well on Little Endian targets, because theu32 after the first contains the next 32 bits. On Big Endian thisbreaks completely though, forcing us to be inventive here....
Introduce -smp , maxcpus= flag to specify maximum number of CPUS.
Follow on patch will use it to determine the size of the MADT andother BIOS tables.
Signed-off-by: Jes Sorensen <jes@sgi.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
QEMU BOCHS bios patches to use maxcpus value.
qemu: msix nit: clear msix_entries_nr on error
I don't think it's critical to do this, but it'sbest to keep uninit and error recovery consistent.
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
kill drives_table
First step cleaning up the drives handling. This one does nothing butremoving drives_table[], still it became seriously big.
drive_get_index() is gone and is replaced by drives_get() which handsout DriveInfo pointers instead of a table index. This needs adaption in...
add support for drive ids.
-drive accepts the new id= now, allowing to explicitely name yourdrives. They will show up with that name in "info block" if specified,otherwise the existing namimg scheme is used to autogenerate one.
There is also a new function to lookup drives by name. Not used yet....
kill drives_opt
cleanup pretty simliar to the drives_table removal patch: - drop the table and make a linked list out of it. - pass around struct pointers instead of table indices.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
move parser functions from vl.c to qemu-option.c
qemu-option: factor out parse_option_bool
qemu-option: factor out parse_option_size
QemuOpts: framework for storing and parsing options.
This stores device parameters in a better way than unparsed strings.
New types: QemuOpt - one key-value pair. QemuOpts - group of key-value pairs, belonging to one device, i.e. one drive....
switch -drive to QemuOpts.
Demo QemuOpts in action ;)
Implementing a alternative way to specify the filename should bejust a few lines of code now once we decided how the cmd line syntaxshould look like.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>...
slirp: Fix guestfwd for incoming data
Unless a virtual server address was explicitly defined (which isimpossible with the legacy net channel format), guestfwd did notproperly forwarded host>guest packets. This patch fixes it.
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>...
HPET fixes for reg writes
This patch addresses the problems found by Andriy Gapon:
- The code was incorrectly overwriting the high order 32 bits of the timer and hpet config registers. This didn't show up in testing because linux and windows use hpet in legacy mode,...
qdev/pci: hook up i440fx.
Hook i44fx pcihost into sysbus.Convert Host bridge and ISA bridge pci devices to qdev.Tag as no-user.
qdev/prop: add pci devfn property
So we can parse "$slot.$fn" strings into devfn numbers.
qdev/pci: use qdev_prop_pci_devfn
Put the new property into use.
qdev: create default bus names.
Create a default bus name if none is passed to qbus_create().
If the parent device has DeviceState->id set it will be used to createthe bus name,. i.e. -device lsi,id=foo will give you a scsi bus named"foo.0".
If there is no id BusInfo->name (lowercased) will be used instead, i.e....
qdev: bus walker + qdev_device_add()
This patch implements a parser and qdev tree walker for bus paths andadds qdev_device_add on top of this.
A bus path can be: (1) full path, i.e. /i440FX-pcihost/pci.0/lsi/scsi.0 (2) bus name, i.e. "scsi.0". Best used together with id= to make...
qdev: add -device command line option.
The -device switch is the users frontend to the qdev_device_add functionadded by the previous patch.
Also adds a linked list where command line options can be saved.Use it for the new -device and for the -usbdevice and -bt switches....
Add SCM_RIGHTS support to unix socket character devices
If a file descriptor is passed via a message with SCM_RIGHTS ancillarydata on a unix socket, store the file descriptor for use in thechr_read() handler. Close the file descriptor if it was not used....
Add getfd and closefd monitor commands
Add monitor commands to support passing file descriptors viaSCM_RIGHTS.
getfd assigns the passed file descriptor a name for use with othermonitor commands.
closefd allows passed file descriptors to be closed. If a monitor...
Add monitor_get_fd() command for fetching named fds
Signed-off-by: Mark McLoughlin <markmc@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Add support for fd=name to tap and socket networking
This allows a program to initialize a host networking device using afile descriptor passed over a unix monitor socket.
The program must first pass the file descriptor using SCM_RIGHTSancillary data with the getfd monitor command. It then may do...
Add machine type aliases
Add an 'alias' field to QEMUMachine and display it in the output of'qemu -M ?' with an '(aliased to foo)' suffix.
Aliases can change targets in newer versions of qemu, so management toolsmay choose canonicalize machine types to ensure that if a user chooses an...
Add a pc-0.11 machine type and make the pc type an alias
The pc-0.11 type allows users of qemu-0.11 to use a machine type whichthey know will remain compatible when the upgrade to qemu-0.12.
Management tools may choose to canonicalize the 'pc' machine type to...
Make tcp_chr_read() use recvmsg()
Split out tcp_chr_recv() out of tcp_chr_read() and implement it onnon-win32 using recvmsg(). This is needed for a subsequent patchwhich implements SCM_RIGHTS support.
Signed-off-by: Mark McLoughlin <markmc@redhat.com>...
sparc64 really implement itlb/dtlb automatic replacement writes
- implement "used" bit in tlb translation entry- mark tlb entry used if qemu code/data translation succeeds- fold i/d mmu replacement writes code into replace_tlb_1bit_lru whichadds 1bit lru replacement algorithm; previously code tried to replace...
sparc64 name mmu registers and general cleanup
- add names to mmu registers, this helps understanding the code whichuses/modifies them.- fold i/d mmu tlb entries tag and tte arrays into arrays of tlb entries- extract demap_tlb routine (code duplication)...
Give the kernel more room
My self-built PPC kernel doesn't fit in the region reserved forthe kernel, so I can't use -kernel with it.
Let's just extend the region.
Signed-off-by: Alexander Graf <agraf@suse.de>
PPC: Round VGA BIOS size to page boundary
When giving KVM a slot of a size not on page boundary, it chokes. So let'sjust round up the VGA BIOS size so nobody complains anymore and we don't needto implement sub-page slots.
Required for booting a PPC guest in KVM....
Fix period initialization
Signed-off-by: malc <av1474@comtv.ru>
introduce on_vcpu
on_vcpu is a qemu-kvm function that will make sure that a specificpiece of code will run on a requested cpu. We don't need that becausewe're restricted to -smp 1 right now, but those days are likely to end soon.
So for the benefit of having qemu-kvm share more code with us, I'm...
notify io_thread at the end of rx handling
This is a backport from qemu-kvm. Just instead of using kvm's specificnotification mechanism, we use qemu_notify_event()
Signed-off-by: Glauber Costa <glommer@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
signrom.sh: portability fix
Attached patch makes signrom.sh working on NetBSD.The output of the 'od' command leads to a syntax errorwhich breaks the build.
Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Link bios files when building out of tree
When starting a qemu binary directly from the build directory and thatdir is located outside the source files, the search for bios filesfails. Fix this by linking them from the build to the source directory.
qemu-thread: use pthread_equal
Fixes
qemu-thread.c: In function `qemu_thread_equal':qemu-thread.c:161: error: invalid operands to binary ==
Use of pthread_equal suggested by Filip Navara.
Signed-off-by: Sebastian Herbszt <herbszt@gmx.de>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
provide tests for pit in kernel and irqchip in kernel
KVM can have an in-kernel pit or irqchip. While we don't implement ityet, having a way for test for it (that always returns zero) will allow usto reuse code in qemu-kvm that tests for it.
Signed-off-by: Glauber Costa <glommer@redhat.com>...
Add save/restore support to the LSI logic SCSI device model.
This patch requires "Handle BH's queued by AIO completions inqemu_aio_flush()" to work reliably. The combination of those twopatches survived 300+ migrations with heavy IO load running in the...
use struct initializer for audio.c
Signed-off-by: Juan Quintela <quintela@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
vmdk: Fix backing file handling
Instead of storing the backing file in its own BlockDriverState, VMDK uses theBlockDriverState of the raw image file it opened. This is wrong and breaksfunctions that access the backing file or protocols. This fix replaces all...
qmu-img: fix qemu-img convert to generate a valid image when the source referenced a backing file
Make 'qemu-img convert' copies unallocated parts of the source imagewhen -B option was not specified.
Signed-off-by: Akkarit Sangpetch <asangpet@andrew.cmu.edu>...
qemu-io: Rework alloc command
The alloc command in qemu-io is mostly useless currently. Instead of doing asingle call to bdrv_is_allocated, we must call bdrv_is_allocated in a loopuntil we have found out for each requested sector if it is allocated or not...
qemu-io: reject invalid pattern
Replace the use of atoi which is used for pattern parsing currently withstrtol. Atoi won't parse sedecimal pattern values (it always returns 0),but qemu-iotests use such pattern values. Also reject every patternthat is not a unsigned char as we pass the pattern to memset which...
Fix warning in kvm-all.c
This fixes a warning I stumbled across while compiling qemu on PPC64.
Signed-off-by: Alexander Graf <agraf@suse.de>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Use correct input constant
440 and desktop codes use different input constants for interrupt indication.
Let's use the respective ones for KVM.
Fake dirty loggin when it's not there
Some KVM platforms don't support dirty logging yet, like IA64 and PPC,so in order to still have screen updates on those, we need to fake it.
This patch just tells the getter function for dirty bitmaps, that allpages within a slot are dirty when the slot has dirty logging enabled....
Handle BH's queued by AIO completions in qemu_aio_flush()
Without this, the call to qemu_aio_flush during migration doesn'tactually flush all in-flight SCSI IOs.
Signed-off-by: Nolan Leake <nolan <at> sigbus.net>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Enable PPC KVM for non-embedded
We now have KVM on PPC64 too and might get it on PPC32 as well, as soonas someone writes it.
So let's enable KVM for PPC32 and PPC64 targets.
Set PVR in sregs
We need to tell the kernel about some initial CPU state we don't have yet,so let's use the "sregs" IOCTL for that and simply put the Processor VersionRegister in there.
Now the kernel knows which guest CPU to virtualize.
Signed-off-by: Alexander Graf <agraf@suse.de>...
Sparc32: convert Sun4c interrupt controller to qdev
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
Sparc32: convert SBI to qdev
Fix CONFIG_PROFILER
Sparc32/64: use 64 bit type for memory size
qdev: add 64 bit type
Sparc64: refactor kernel init
Sparc64: refactor CPU init
Sparc64: convert memory to qdev
Sparc64: convert boot prom to qdev
Sparc32: Fix lance
Sparc64: convert APB to qdev
Thanks to Igor Kovalenko for a bugfix.
Fix most warnings (errors with -Werror) when debugging is enabled
I used the following command to enable debugging:perl -p -i -e 's/^\/\/#define DEBUG/#define DEBUG/g' * /* *//*
Fix build with DEBUG_PCI in pci_host.h enabled
Clean up fdc qdev conversion
Fix rbase initialization
Fix a similar configure typo from microblaze.
this patch fixes a typo where armv4l was incorrectly spelled arm4l,preventing the correct handling of --cpu=armv4l.
Laurent
Signed-off-by: Laurent Desnogues <laurent.desnogues@gmail.com>Signed-off-by: Andrzej Zaborowski <andrew.zaborowski@intel.com>
this patch improves the ARM back-end in the following way:
- use movw/movt to load immediate values for ARMv7-A- implement add/sub/and/or/xor with immediate (only 8-bit)
tcg: Fix tcg_gen_rotr_i64
Reported-by: Laurent Desnogues <laurent.desnogues@gmail.com>Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
Use correct byteswap routine for elf_note
All elf64_note structure members are Elf64_Word (which is 32bit value)hence using bswaptls to byteswap it on 64bit platforms is incorrect.
Avoid name clashes with symbols that leak from system headers
PPC 32/64 GUEST_BASE support
Fix LHZX opcode value
Userspace guest address offsetting
Fix type in i386 tcg.
Signed-off-by: Juan Quintela <quintela@redhat.com>
bsd-users: fix strace
Hi!
Attached patch fixes an unlock bug in strace.Catched by gcc due to an use of uninitialized variable.
Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
-----to satisfy European Law for business letters:Advanced Micro Devices GmbH...
isxdigit -> qemu_isxdigit
Attached patch uses qemu_isxdigit() instead of isxdigit().Fixes build warning on NetBSD.
fix build warnings
Attached patch fixes build warnings due to use of different pointersignedness.
-----to satisfy European Law for business letters:Advanced Micro Devices GmbHKarl-Hammerschmidt-Str. 34, 85609 Dornach b. Muenchen...
ELF codedump build failures
Rename ELF coredump types to avoid conflict with the corresponding host types.
Signed-off-by: Laurent Desnogues <laurent.desnogues@gmail.com>
Re-implement GUEST_BASE support.Offset guest ddress space by default if the guest binary containsregions below the host mmap_min_addr.Implement support for i386, x86-64 and arm hosts.
Signed-off-by: Riku Voipio <riku.voipio@iki.fi>...
Suppress a Sparse warning
Move the export to a file used by both qdev.c and sysbus.c.
Sparc32: use hex for version numbers
0x10000000 looks better than 268435456.
Sparc32: fix escc devices broken by ee6847d19be16c789b8bd4e553b7cd6701ba1245
The logic of Zilog makes channel B the first device and channel A thesecond one.
Sparc32: fix fdc io_base
On some Sparc32 machines, fdc is located above 4G limit, so uint32_t is notappropriate type for io_base.
Fix sparc-softmmu breakage by ee6847d19be16c789b8bd4e553b7cd6701ba1245
Move the qdev_init(dev); call after the setting of d->size.Thanks to Filip Navara.
Fix OpenBSD build
The header sys-queue.h must be #included early, otherwise at some point OSqueue macros will be used. On OpenBSD, those don't define TAILQ_FOREACH_SAFE.
ARM host fixes
Minor TCG cleanups and warning fixes for ARM hosts.
Signed-off-by: Paul Brook <paul@codesourcery.com>
Only allow -cpu host when KVM is enabled
-cpu host is not at all useful when using tcg.
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Move CLOCKLIBS and PTHREADLIBS out of CONFIG_LINUX_USER_ONLY
Otherwise, -lrt doesn't get added to the softmmu build.
Initialize cpuid variables
This causes a build break when !KVM.
Ignore -Waddress for alsaaudio.c
/usr/include/alsa/pcm.h contains:
#define snd_pcm_sw_params_alloca(ptr) do { assert(ptr); *ptr = (snd_pcm_sw_params_t *) alloca(snd_pcm_sw_params_sizeof()); memset(*ptr, 0, snd_pcm_sw_params_sizeof()); } while (0)
The assert generates: "error: the address of 'sw_params' will always...
Update version for 0.11 development
Update version for 0.11.0-rc0
Refactor config_softfloat selection in another list
Generate $target_dir/config.h from $target_dir/config.mak