History | View | Annotate | Download (151.9 kB)
Open chr device for all serial ports
Now that labels must be unique, the chr devices can't be opened anymorewithin the serial port code (in case they are not already opened invl.c), as they end up with the same label. Instead opened sonon-assigned one directly in vl.c, with a different label....
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,...
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...
Unexport ticks_per_sec variable. Create get_ticks_per_sec() function
Signed-off-by: Juan Quintela <quintela@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
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....
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...
Revert "don't call cpu_sychronize_state from reset handlers"
This reverts commit 733318ea9c6d846a6a047b87619e7d9d6e9707d1.
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
qemu-kvm: fix segfault when running kvm without /dev/kvm, falling back to non-accelerated mode
qemu-kvm: fix segfault when running kvm without /dev/kvm, falling backto non-accelerated mode
We're seeing segfaults on systems without access to /dev/kvm. It...
don't call cpu_sychronize_state from reset handlers
Doing this will make the vcpu ioctl be issued from the I/O thread, insteadof cpu thread. The correct behaviour is to call it from within the cpu thread,as soon as we are ready to go.
Signed-off-by: Glauber Costa <glommer@redhat.com>...
fix PATH_MAX conditional compilation
PATH_MAX is used elsewhere in the qemu source tree without protection.
In addtion the actual code would not compile if PATH_MAX is not defined
Last the free() call is wrong as p is not malloc()ed.
Signed-off-by: Jean-Christophe Dubois <jcd@tribudubois.net>...
fix vl.c compilation if CONFIG_KVM is not defined
vl.c will not link if CONFIG_KVM is not defined.
This patch fixes the problem.
Signed-off-by: Jean-Christophe Dubois <jcd@tribudubois.net>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
mv strdup to qemu_strdup in vl.c
There are few places in vl.c not using the qemu version ofmalloc/free/strdup.
Fix it.
allow passing null machine pointer to drive_init().
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
qdev/usb: add usb bus support to qdev, convert drivers.
TODO: * make the rest of qemu aware of usb busses and kill the FIXMEs added by this patch....
qdev/usb: make qemu aware of usb busses.
Move usb code from vl.c to usb-bus.c and make it use the new datastructures added by qdev conversion. qemu usb core should be ableto handle multiple USB busses just fine now (untested though).
Kill some usb_*_init() legacy functions, use usb_create_simple()...
Checks in select_soundhw were never intended to accept abbreviations
Signed-off-by: malc <av1474@comtv.ru>
monitor: Port handler_1 to use QDict
This commit ports command handlers that receive one argument to usethe new monitor's dictionary.
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
do not issue ioctl from within the io thread
According to Documentation/kvm/api.txt, (and well, to common sense),we should not be calling vcpu ioctls from within the iothread.Since vcpu initialization issues a vcpu ioctl, move it a little bitfurther in time to prevent it....
Support for multiple -monitor devices
Rebased version of Anthony's patch: Allow to specify more than onemonitor terminal via the -monitor command line switch. This isparticularly useful when libvirt or some other management tool alreadyoccupies the primary monitor but you need another one for debugging....
Delay sighandler_setup()
If we are using --serial telnet:0:5555,server or similar, ^C will notkill qemu. We need to first connect using telnet, and the the ^C takeseffect.
switch balloon initialization to -device.
With that patch applied "-balloon virtio,args" becomes a shortcut for"-device virtio-balloon-pci,args".
Side effects: - ballon device gains support for id=<tag>. - ballon device is off by default now. - initialization order changes, which may in different pci slot...
add qemu_error() + friends
This patch adds some functions for error reporting to address theproblem that error messages should be routed to different destinationsdepending on the context of the caller, i.e. monitor command errorsshould go to the monitor, command line errors to stderr....
qdev: convert watchdogs
-watchdog NAME is now equivalent to -device NAME, except it treatsoption argument '?' specially, and supports only one watchdog.
A side effect is that a device created with -watchdog may now receivea different PCI address.
i6300esb is now available on any machine with a PCI bus, not just PCs....
Move watchdog, watchdog_action, give them internal linkage
Signed-off-by: Markus Armbruster <armbru@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
raw-posix: add Linux native AIO support
Now that do have a nicer interface to work against we can add Linux nativeAIO support. It's an extremly thing layer just setting up an iocb forthe io_submit system call in the submission path, and registering an...
split do_loadvm() into do_loadvm() and load_vmstate()
do_loadvm() is now called from the monitor.load_vmstate() is called by do_loadvm() and when -loadvm command line is used.Command line don't have to play games with vmstop()/vmstart()
Signed-off-by: Juan Quintela <quintela@redhat.com>...
make load_vmstate() return errors
extend -smp parsing to include cores= and threads= options
For injecting multi-core and multi-threading CPU topology into guestsextend the -smp syntax to accommodate cores and threads specification.Syntax: -smp smp_value[,cores=nr_cores][,threads=nr_threads]\...
Unbreak large mem support by removing kqemu
kqemu introduces a number of restrictions on the i386 target. The worst is thatit prevents large memory from working in the default build.
Furthermore, kqemu is fundamentally flawed in a number of ways. It relies on...
QEMU set irq0override in fw_cfg
Hi,
After discussing the issue with Avi, Gleb and a couple others on irq,we came to the conclusion that it is preferred to have QEMU requestfeatures from the BIOS, rather than notifying the BIOS that it isrunning on QEMU or KVM. This way memory ranges can change etc. and...
Clean up VGA type selection; far too many variables being used to track one state leads to confusion if new variables are added.
Signed-off-by: Zachary Amsden <zamsden@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Do not disable autostart for live migration
If the user does not want autostart, they can specify -S.
Signed-off-by: Avi Kivity <avi@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
check for PR_SET_NAME being defined
Depending on what glibc/kernel headers you are compiling against,PR_SET_NAME may or may not be defined. Do the right thing ifPR_SET_NAME isn't defined and skip setting the process name.
Signed-off-by: Nathan Froyd <froydnj@codesourcery.com>...
variable timer intervals
This patch introduces dynamic timer intervals: we slow down the refreshrate when there in no much activity but we get back to a fast refreshrate when the activity resume.
Please note that qemu_timer_expired is not an inline function any more...
qdev-ify virtio-blk.
First user of the new drive property. With this patch applied hostand guest config can be specified separately, like this:
-drive if=none,id=disk1,file=/path/to/disk.img -device virtio-blk-pci,drive=disk1
You can set any property for virtio-blk-pci now. You can set the pci...
QemuOpts: switch over -device.
Make -device switch use the QemuOpts framework.Everything should continue to work like it did before.
New: "-set device.$id.$property=$value" works.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>...
constify drive_get_by_id arg
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>Message-Id:
add -drive if=none
This adds a host drive, but doesn't implicitly add a guest drive for it.First step in splitting host and guest configuration, check thefollowing patches to see how this can be used ...
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>...
QemuOpts: make the drive id actually show up in "info block".
QemuOpts: create qemu-config.h
Move drive option description there.Rename it, give it a qemu_ prefix.
QemuOpts: add -set option
One use case will be file for drives (no filename quoting issues), i.e.
-drive id=test,if=virtio -set drive.test.file=/vmdisk/test-virtio.img
It will work for any other option (assuming handled by QemuOpts) though.Except for id= for obvious reasons ;)....
Use qemu_irq for system_powerdown
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
fix migration to obey -S
Since migration returns right away, starting the VM rightafter calling qemu_start_incoming_migration is wrong evenif -S is not passed. We have to do this after migrationhas completed.
Cc: Glauber Costa <glommer@redhat.com>Cc: Anthony Liguori <aliguori@us.ibm.com>...
rename WORDS_BIGENDIAN to HOST_WORDS_BIGENDIAN
rename HOST_BSD to CONFIG_BSD
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...
Remove setvbuf(<handle>, NULL, _IOLBF, 0) calls for Win32
On Win32 the setvbuf function requires the last parameter to be size between 2 and INT_MAX bytes, so the calls always failed. Since the whole point of the calls is to set line-buffered mode for the file handle and that's not supported on Win32 anyway, conditionally remove them....
Remove special Win32 code in vl.c that's no longer needed.
Signed-off-by: Filip Navara <filip.navara@gmail.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
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>
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.
move parser functions from vl.c to qemu-option.c
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.
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 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...
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.
qdev/compat: compat property infrastructure.
This add support for switching devices into a compatibility modeusing device properties. Machine types can have a list of propertiesfor specific devices attached to allow the easy creation of machinetypes compatible to older qemu versions....
honor -S on incoming migration
-S is not honored by qemu on incoming migration. If a domain is migratedwhile paused, thus, it will start running on the remote machine; thisis wrong.
Given the trivial patch to fix this, it looks more like a thinkothan anything else, probably dating back to the qemu-kvm merge....
Move boot_set callback backend
Move registration function for the boot_set callback handler and provideqemu_boot_set so that it can also be used outside the monitor code.
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Rework reset handler management
Convert the reset handler maintenance code to TAILQ services.
Add qemu_unregister_reset
Will be used by '-boot once=...', and should also help in other usecases.
Add boot-once support
This allows to specify an exceptional boot order only for the firststartup of the guest. After reboot, qemu will switch back to the defaultorder (or what was specified via 'order='). Makes installing from CDimages and then booting the freshly set up harddisk more handy....
Add boot menu control via command line switch
Disable the lengthy BIOS prompt for selecting a boot device by default,but let the user reenable it via '-boot menu=on'.
Rework -boot option
This patch changes the boot command line option to the canonical format
-boot [order=drives][,...]
where 'drives' is using the same format as the old -boot. The formatswitch allows to add the 'menu' and 'once' options in later patches. The...
Disable kqemu by default at run time
-no-kqemu -> -enable-kqemu
kqemu is still present at compile time by default
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....
split out ioport related stuffs from vl.c into ioport.c.
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
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.
Signed-off-by: Kevin Wolf <kwolf@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
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>...
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...
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...
slirp: Kill slirp_is_inited
Avoid the need for slirp_is_inited by refactoring the protectedslirp_select_* functions. This also avoids the clearing of all fd setson select errors.
slirp: Rework monitor commands for host forwarding
Improve the monitor interface for adding and removing host forwardingrules by splitting it up in two commands and rename them to hostfwd_addand hostfwd_remove. Also split up the paths taken for legacy -redir...
Introduce get_next_param_value
In order to parse multiple instances of the same param=value pair,introduce get_next_param_value which can pass back to string parsingposition after reading a parameter value.
slirp: Move smb, redir, tftp and bootp parameters and -net channel
So far a couple of slirp-related parameters were expressed viastand-alone command line options. This it inconsistent and unintuitive.Moreover, it prevents both dynamically reconfigured (host_net_add/...
Make sure to zero out memory before calling madvise to increase robustness
Avi pointed out that it's not entirely safe to rely on madvise zeroing outmemory. So let's do it explicitly before calling madvise.
Win32: Fix compilation with SDL.
`sdl-config --cflags` defines main = SDL_mainon some platforms. One of these platforms isWindows with mingw32.
For those platforms, the solution already developedfor APPLE is now applied.
A compiler warning (missing return value) is fixed, too....
Support addr=... in option argument of -drive if=virtio
Make drive_init() accept addr=, put the value into struct DriveInfo.Use it in all the places that create virtio-blk-pci devices:pc_init1(), bamboo_init(), mpc8544ds_init().
Don't support addr= in third argument of monitor command pci_add and...
Instead of writing a zero page, madvise it away
Otherwise, after migration, we end up with a much larger RSS size then weought to have.
Make nic option rom loading less painful.
The code how it is today, is totally painful to read and keep.To begin with, the code is duplicated with the option rom loadingcode that linux_boot and vga are already using.
This patch introduces a "bootable" state in NICInfo structure,...
add non-arbitrary migration stop condition
Currently, we're entering migration's stage 3 whena treshold of 10 pages remain to be transferred in the system.
This has hurt some users. However, any proposed threshold isarbitrary by nature, and would only shift the annoyance....
Remove dead code
vl.c contains some dead code that initialises a 'label' string with the nameof the char device being initialised. This is unused.
Signed-off-by: Amit Shah <amit.shah@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Add -no-virtio-balloon command-line option
This new option may be used to disable the virtio-balloon device.
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Fix SDL include path.
SDL header files can be included in two different ways:
The 1st alternative is simple and works in many cases.
The 2nd alternative needs sdl-config to get thecorrect compiler flags. It is the recommended way...
Merge branch 'net-queue'
Fix "defined but not used" warning
The function qemu_calculate_timeout() is only used when CONFIG_IOTHREADis not defined. When CONFIG_IOTHREAD is defined, we have the followingwarning:
vl.c:4389: warning: ‘qemu_calculate_timeout’ defined but not used...
Use snprintf to avoid OpenBSD warning
Fix warning
slirp: Avoid zombie processes after fork_exec
Slirp uses fork_exec for spawning service processes, and QEMU uses thisfor running smbd. As SIGCHLD is not handled, these processes becomezombies on termination. Fix this by installing a proper signal handler,...
Revert "Fix output of uninitialized strings"
This reverts commit 8cf07dcbe7691dbe4f47563058659dba6ef66b05.
This is a sorry saga.
This commit:
8e4416af45 net: Add parameter checks for VLAN clients
broken '-net socket' and this commit:
ffad4116b9 net: Fix -net socket parameter checks...
net: Real fix for check_params users
OK, last try: 8e4416af45 broke -net socket, ffad4116b9 tried to fix itbut broke error reporting of invalid parameters. So this patch widelyreverts ffad4116b9 again and intead fixes those callers of check_paramsthat originally suffered from overwritten buffers by using separate...
net: Improve parameter error reporting
As host network devices can also be instantiated via the monitor, errorsshould then be reported to the related monitor instead of stderr. Thisrequires larger refactoring, so this patch starts small with introducing...
Use relative path for bios
Look for bios and other support files relative to qemu binary, rather thana hardcoded prefix.
Signed-off-by: Paul Brook <paul@codesourcery.com>
kvm: Mark full address range dirty on live migration start
As Avi correctly noted, last_ram_offset does not mark the last physicalRAM address the guest may see (due to non-continuous memory regions).Ensure that we catch them all by marking the full possible address range...
User Networking: Enable removal of redirections
Using the new host_net_redir command you can easily create redirectionson the fly while your VM is running.
While that's great, it's missing the removal of redirections, in case youwant to have a port closed again at a later point in time....