History | View | Annotate | Download (105.2 kB)
Fix error message in drive_init
The real error is the return value of bdrv_open. errno might be overwritten ornot even set to that value in the first place.
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
close all the block drivers before the qemu process exits
This patch calls the close handler of the block driver before the qemuprocess exits.
This is necessary because the sheepdog block driver releases the lockof VM images in the close handler.
Signed-off-by: MORITA Kazutaka <morita.kazutaka@lab.ntt.co.jp>...
blockdev: Hide QEMUMachine from drive_init()
To pave the way for moving it out of vl.c.
Signed-off-by: Markus Armbruster <armbru@redhat.com>Signed-off-by: Kevin Wolf <kwolf@redhat.com>
blockdev: Belatedly remove MAX_DRIVES
Unused since commit 751c6a17.
blockdev: Belatedly remove driveopts
Unused since commit 9dfd7c7a.
usb: Remove unused usb_device_add() parameter is_hotplug
Unused since commit b3e461d3.
drive: allow rerror, werror and readonly for if=none
When creating guest disks the qdev way using ...
-drive if=none,id=$name,args -device $driver,drive=$name
it is not possible to specify rerror, werror and readonly argumentsfor drive as drive_init allows/blocks them based on the interface (if=)...
Make cache=unsafe the default for -snapshot
When using -snapshot we don't care about data integrity of the cow fileat all, so let's disable flushing there and squeeze out the last dropof performance we could possibly get.
Signed-off-by: Alexander Graf <agraf@suse.de>...
Add cache=unsafe parameter to -drive
Usually the guest can tell the host to flush data to disk. In some cases wedon't want to flush though, but try to keep everything in cache.
So let's add a new cache value to -drive that allows us to set the cachepolicy to most aggressive, disabling flushes. We call this mode "unsafe",...
Fix error handling in qemu_read_config_file
We need to close the file even in error case. While at it, make the callerscatch all kind of errors. ENOENT is allowed for default config files, theyare optional.
Reported-by: Luiz Capitulino <lcapitulino@redhat.com>...
Revert "Monitor: Return before exiting with 'quit'"
This reverts commit 0e8d2b5575938b8876a3c4bb66ee13c5d306fb6d.
Next commits will do the same thing in a better way.
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
fix chardev_init for win32
chardev_init functions use socket,so socket_init() shoud be placed atthe front of chardev_init on win32.
Signed-off-by: TeLeMan <geleman@gmail.com>Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
Fix cpu list("-cpu ?") breakage, spotted by TeLeMan
Fix breakage by 04c9a0cbc2bf496889cef6da2d61bf00ef190a4f.
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
QMP: Introduce RESUME event
It's emitted when the Virtual Machine resumes execution.
We currently have the STOP event but don't have the matchingRESUME one, this means that clients are notified when the VMis stopped but don't get anything when it resumes....
virtio-9p: Create a syntactic shortcut for the file-system pass-thru
Currently the commandline to create a virtual-filesystem pass-through betweenthe guest and the host is as follows:#qemu -fsdev fstype,id=ID,path=path/to/share \ -device virtio-9p-pci,fsdev=ID,mount_tag=tag \...
virtio-9p: Create a commandline option -fsdev
This patch creates a new command line option named -fsdev to hold any filesystem specific information.
The option will currently hold the following attributes:-fsdev fstype id=id,path=path_to_sharewherefstype: Type of the file system....
Fix boot once option
The boot once options seems to have gotten broken since it originallywent in. We need to wait until the second time restore_boot_devices()gets called before restoring the standard boot order and removing itselffrom the reset list....
fix old typos in help header
1) Qemu is not only a PC emulator.2) "image image" has already been changed to "disk image" in qemu-doc.texi
Signed-off-by: Thomas Monjalon <thomas@monjalon.net>Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
monitor: Cleanup ID assignment for compat switch
Canonicalize the ID assignment when creating monitor devices via thelegacy switch and use less easily colliding names.
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
monitor: Reorder intialization to drop initial mux focus
So far a multiplexed monitor started disabled. Restore this property forthe new way of configuring by moving the monitor initialization beforeall devices (the last one to attach to a char-mux will gain the focus)....
Monitor: Return before exiting with 'quit'
The 'quit' Monitor command (implemented by do_quit()) callsexit() directly, this is problematic under QMP because QEMUexits before having a chance to send the ok response.
Clients don't know if QEMU exited because of a problem or...
Replace calls of old bdrv_open
What is known today as bdrv_open2 becomes the new bdrv_open. All remainingcallers of the old function are converted to the new one. In some places theyeven know the right format, so they should have used bdrv_open2 from the...
cleanup block driver option handling in vl.c
Assign directly to the bdrv_flags variable instead of usingmagic numbers before translating to the BDRV_O_* options.
Signed-off-by: Christoph Hellwig <hch@lst.de>Signed-off-by: Kevin Wolf <kwolf@redhat.com>
qemu-config: qemu_read_config_file() reads the normal config file
Introduce a new function qemu_read_config_file which reads the VM configurationfrom a config file. Unlike qemu_config_parse it doesn't take a open file but afilename and reduces code duplication as a side effect....
provide a stub version of kvm-all.c if !CONFIG_KVM
This allows limited use of kvm functions (which will return ENOSYS)even in once-compiled modules. The patch also improves a bit the errormessages for KVM initialization.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>...
error: Drop extra messages after qemu_opts_set() and qemu_opts_parse()
Both functions report errors nicely enough now, no need for additionalmessages.
Signed-off-by: Markus Armbruster <armbru@redhat.com>Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
Fix build when configured with --enable-io-thread
boot: remove unused boot_devices_bitmap variable
In addition to removing the variable, this also renames the parse_bootdevices()function to validate_bootdevices(), as we don't need its return value anymore.
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>...
net: remove broken net_set_boot_mask() boot device validation
There are many problems with net_set_boot_mask():
1) It is broken when using the device model instead of "-net nic". Example: $ qemu-system-x86_64 -device rtl8139,vlan=0,id=net0,mac=52:54:00:82:41:fd,bus=pci.0,addr=0x4 -net user,vlan=0,name=hostnet0 -vnc 0.0.0.0:0 -boot n...
move balloon handling to balloon.c
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
move socket_init to qemu-sockets.c
move two variable declarations out of vl.c
read-only: allow read-only CDROM with any interface
Signed-off-by: Naphtali Sprei <nsprei@redhat.com>Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
Use sysctl instead of /proc to find executable path on FreeBSD
..since /proc usually isn't mounted on FreeBSD.
Signed-off-by: Juergen Lock <nox@jelal.kn-bremen.de>Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
Refactor target specific handling, compile vl.c only once
Move target specific functions and RAM handling to arch_init.c.
Add a flag to QEMUOptions structure to indicate for whicharchitectures the option is allowed, check the flagin run time and remove conditional code in option handling....
Refactor a few architecture dependent pieces in vl.c
These will be moved later.
Refactor CPUState handling out of vl.c
Move KVM and Xen global flags to vl.c
Adjust debug handling
Fix driftfix option
Based on patch by Zachary Amsden.
Refactor numa mode setting
Compile ide/core only once
Make win2k install hack unconditional as it is still restricted tox86 only in vl.c.
Replace TARGET_PAGE_SIZE and 4096 with PAGE_SIZE.
Revert "Introduce a default qmp session"
This reverts commit 3290c4aac5b97bb1e3b2b28d94669f2c611ce84a.
Conflicts:
vl.c
Revert "qmp: don't make -qmp disable the default monitor"
This reverts commit d49f626ed00cecc90fb1ff88da9bdf11e57094d1.
Revert "Convert atexit users to exit_notifier"
This reverts commit d7234f4d7e373a708e1df9ab565a71b71b189025.
hw/xen_machine_pv.c
This should have never been committed.
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Revert "Add exit notifiers"
This reverts commit 3b6304f706ef7eebc0b3b3f3a5093ec75448ee19.
This was mistakenly committed.
Fix mingw32 build
mkdir() only takes path argument on mingw32:
CC i386-softmmu/vl.o/src/qemu/vl.c: In function 'qmp_add_default':/src/qemu/vl.c:3763: error: too many arguments to function 'mkdir'/src/qemu/vl.c:3769: error: too many arguments to function 'mkdir'...
qmp: don't make -qmp disable the default monitor
Instead, we introduce a default_qmp flag. We don't use it yet, but will in thenext patch.
This has a user-visible impact as specifying just -qmp will now also show amonitor on the 'vc'.
Introduce a default qmp session
Basically, -qmp unix:%{home}/.qemu/qmp/%{uuid}.sock,server,nowait
%{uuid} will be -uuid if it's specified, otherwise, if libuuid is available,we generate a uuid. If it's not available, we don't create one.
Add exit notifiers
Like atexit() but with state
Convert atexit users to exit_notifier
All of these users have global state so we really don't see a benefit fromexit_notifier. However, using exit_notifier means that there's one lessjustification for having global state in the first place.
Convert io handlers to QLIST
Signed-off-by: Juan Quintela <quintela@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
rename IOCanRWHandler to IOCanReadHandler
It was always only used for reads
Handle deleted IOHandlers in a single buffer
split out qemu-timer.c
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
place together more #ifdef CONFIG_IOTHREAD blocks
disentangle tcg and deadline calculation
Just tell main_loop_wait whether to be blocking or nonblocking, so thatthere is no need to call qemu_cpus_have_work from the timer subsystem.Instead, tcg_cpu_exec can say "we want the main loop not to block because...
only one flag is needed for alarm_timer
The ALARM_FLAG_DYNTICKS can be testing simply by checking if there isa rearm function.
more alarm timer cleanup
The timer_alarm_pending variable is related to the alarm timer but notplaced in the struct. Also, in qemu_mod_timer the wrong flag was beingtested: the timer is rearmed in the alarm timer "bottom half", so theright flag to test there is the "pending" flag....
do not use qemu_event_increment outside qemu_notify_event
qemu_notify_event in the non-iothread case is only stopping the currentCPU. However, if the CPU is idle and the main loop is in the selectcall then a call to qemu_event_increment is needed too (as done in...
tweak qemu_notify_event
Instead of testing specially next_cpu in host_alarm_handler, just dothat in qemu_notify_event. The idea is, if we are not running (ornot yet running) target CPU code, prepare things so that the executionloop is exited asap; just make that clear....
remove qemu_rearm_alarm_timer from main loop
Make the timer subsystem register its own callback instead.
extract timer handling out of main_loop_wait
change qemu_run_timers interface
introduce and use qemu_clock_enable
By adding the possibility to turn on/off a clock, yet anotherincestuous relationship between timers and CPUs can be disentangled.
centralize handling of -icount
A simple patch to place together all handling of -icount.
add qemu_icount_round
add qemu_alarm_pending
new function qemu_icount_delta
Tweaking the rounding in qemu_next_deadline ensures that there'sno change whatsoever.
move vmstate registration of vmstate_timers earlier
avoid dubiously clever code in win32_start_timer
The code is initializing an unsigned int to UINT_MAX using "-1", so thatthe following always-true comparison seems to be always-false at afirst look. Since alarm timer initializations are never nested, it is...
fix error in win32_rearm_timer
The TIME_ONESHOT and TIME_PERIODIC flags are mutually exclusive.The code after the patch matches the flags used in win32_start_timer.
Merge remote branch 'markus/qerror' into staging
qemu-option: Move the implied first name into QemuOptsList
We sometimes permit omitting the first option name, for example-device foo is short for -device driver=foo. The name to use("driver" in the example) is passed as argument to qemu_opts_parse()....
error: Replace qemu_error() by error_report()
error_report() terminates the message with a newline. Strip it itfrom its arguments.
This fixes a few error messages lacking a newline:net_handle_fd_param()'s "No file descriptor named %s found", andtap_open()'s "vnet_hdr=1 requested, but no kernel support for...
error: Include the program name in error messages to stderr
error: Track locations in configuration files
New LOC_FILE. Use it for tracking file name and line number inqemu_config_parse(). We now report errors like
qemu:foo.conf:42: Did not find I2C bus for smbus-eeprom
In particular, gems like this message:...
error: Track locations on command line
New LOC_CMDLINE. Use it for tracking option with argument inlookup_opt(). We now report errors like this
qemu: -device smbus-eeprom: Did not find I2C bus for smbus-eeprom
savevm: Fix -loadvm to report errors to stderr, not the monitor
A monitor may not even exist.
Change load_vmstate() to use qemu_error() instead of monitor_printf().Parameter mon is now unused, remove it.
error: Simplify error sink setup
qemu_error_sink can either point to a monitor or a file. In practice,it always points to the current monitor if we have one, else tostderr. Simply route errors to the current monitor or else to stderr,and remove qemu_error_sink along with the functions to control it....
Don't set default monitor when there is a mux'ed one
This fixes eg. "-nographic -serial mon:stdio [-serial ...]".
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
QMP: Really move the RESET event to qemu_system_reset()
Something bad has happened in the merge of commit 0ee44250, asthe log message says it's supposed to be in qemu_system_reset()but it is do_vm_stop().
Possibly, it was a problem with the conflict resolution with...
QMP: Introduce RTC_CHANGE event
Emitted whenever the RTC time changes.
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
QMP: Move RESET event into qemu_system_reset()
Nothing will change as that function is currently only called bythe main loop code, but it's the right place for the RESET event,as it's where the reset is actually performed.
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>...
QMP: Drop DEBUG event
This event has been introduced in the first round of QMP commits,turns out that it's based on the usage of the EXCP_DEBUG macro,which has discussable semantics when exposed through QMP.
As libvirt doesn't use this, let's just drop it....
QMP: Move STOP event into do_vm_stop()
I've introduced the STOP event in the main loop, this is wrongas it will be only emitted if the io thread is enabled.
This fixes that by moving the STOP event to do_vm_stop().
KVM: Rework VCPU state writeback API
This grand cleanup drops all reset and vmsave/load relatedsynchronization points in favor of four(!) generic hooks:
- cpu_synchronize_all_states in qemu_savevm_state_complete (initial sync from kernel before vmsave)...
Add option to use file backed guest memory
Port qemu-kvm's -mem-path and -mem-prealloc options. These are usefulfor backing guest memory with huge pages via hugetlbfs.
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>CC: john cooper <john.cooper@redhat.com>
Merge remote branch 'qemu-kvm/uq/master' into staging
Add cpu model configuration support..
This is a reimplementation of prior versions which addsthe ability to define cpu models for contemporary processors.The added models are likewise selected via -cpu <name>,and are intended to displace the existing convention...
block SIGCHLD in vcpu thread(s)
Otherwise a vcpu thread can run the sigchild handler causingwaitpid() from iothread to fail.
Signed-off-by: Marcelo Tosatti <mtosa...@redhat.com>Signed-off-by: Avi Kivity <avi@redhat.com>
kvm specific wait_io_event
In KVM mode the global mutex is released when vcpus are executing,which means acquiring the fairness mutex is not required.
Also for KVM there is one thread per vcpu, so tcg_has_work is meaningless.
Add a new qemu_wait_io_event_common function to hold common code...
kvm: consume internal signal with sigtimedwait
Change the way the internal qemu signal, used for communication betweeniothread and vcpus, is handled.
Block and consume it with sigtimedwait on the outer vcpu loop, whichallows more precise timing control....
use lazy initialization for display_state
Ensure initialization of a dumb display, if needed, by makingall accesses go through get_displaystate.
remove knowledge of defaultallocator_free_displaysurface from sdl.c
Let register_displayallocator hand over the old width/height to the newallocator.
move default allocator to console.c
Moving stuff in console.c to avoid the need for prototypes makesthis patch a bit bigger, but there's no change in the code.
net: net_check_clients() runs too early to see -device, fix
Call it right after -device devices get created.
Signed-off-by: Markus Armbruster <armbru@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
use eventfd for iothread
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>Signed-off-by: Avi Kivity <avi@redhat.com>
iothread: fix vcpu stop with smp tcg
Round robin vcpus in tcg_cpu_next even if the vm stopped. Thisallows all cpus to enter stopped state.
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
loop write in qemu_event_increment upon EINTR
Same as what qemu-kvm does.