]> git.ipfire.org Git - thirdparty/qemu.git/log
thirdparty/qemu.git
15 years agoAvoid permanently disabled QEMU monitor when UNIX migration fails
Daniel P. Berrange [Fri, 11 Dec 2009 21:01:14 +0000 (21:01 +0000)] 
Avoid permanently disabled QEMU monitor when UNIX migration fails

If a UNIX migration command is attempt to a UNIX socket which does
not exist, then the monitor is suspended, but never resumed. This
prevents any further use of the monitor

* migration-unix.c: Only call migrate_fd_monitor_suspend() once
  connected to the UNIX socket.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
(cherry picked from commit 2dd650e58acbafedc7bf34045b7f81bb6c912e72)

15 years agoFix loading of ELF multiboot kernels
Kevin Wolf [Fri, 4 Dec 2009 16:19:25 +0000 (17:19 +0100)] 
Fix loading of ELF multiboot kernels

The multiboot implementation assumed that there is only one program header
(which contains the entry point) and that the entry point is at the start of
the code. This doesn't hold true generally and caused too little data to be
loaded.

Fix the loading code to pass the whole loaded data to the Multiboot Option ROM.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
(cherry picked from commit 092493be3caab1ac77f4223b4c3fb0975d1ed490)

15 years agoRevert "Rename DriveInfo.onerror to on_write_error" (fix mismerge)
Kevin Wolf [Fri, 4 Dec 2009 11:06:32 +0000 (12:06 +0100)] 
Revert "Rename DriveInfo.onerror to on_write_error" (fix mismerge)

Part of the first patch of the -drive rerror series has been merged once more
on top of the rest of the series. This effectively disables the rerror option
and always goes with the default value. Reverting the commit re-enables the
option.

This reverts commit fc072ec4df0996682dfbff6c735e2bbc0d93132f.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
(cherry picked from commit 75f124753922451ee697defd81a80a91ce3f9888)

15 years agoqemu-io: Fix memory leak
Kevin Wolf [Wed, 18 Nov 2009 09:42:59 +0000 (10:42 +0100)] 
qemu-io: Fix memory leak

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
(cherry picked from commit 40a0d7c395f4d18a8061ba075d8f9aab2fa0ec2a)

15 years agoFix thinko in linuxboot.S
Paolo Bonzini [Sun, 13 Dec 2009 10:36:40 +0000 (11:36 +0100)] 
Fix thinko in linuxboot.S

The %gs segment that was used was not matching the comments.
I just moved the GDT descriptor on the stack instead.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
(cherry picked from commit 36ecd7c016f682437941a54193251cbf918bef0d)

15 years agotarget-i386: Fix evaluation of DR7 register
Jan Kiszka [Mon, 14 Dec 2009 11:26:27 +0000 (12:26 +0100)] 
target-i386: Fix evaluation of DR7 register

hw_breakpoint_type and hw_breakpoint_len used the wrong index multiplier
to extract type and len.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
(cherry picked from commit d46272c774a94a8b2f0849703070dbcd93057f50)

15 years agokvm: x86: Use separate exception_injected CPUState field
Jan Kiszka [Mon, 14 Dec 2009 11:26:17 +0000 (12:26 +0100)] 
kvm: x86: Use separate exception_injected CPUState field

Marcelo correctly remarked that there are usage conflicts between QEMU
core code and KVM /wrt exception_index. So spend a separate field and
also save/restore it properly.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
(cherry picked from commit 31827373f03b0ff1550d45ddef0ca1305a2ae70d)

15 years agovnc: hextile: do not generate ForegroundSpecified and SubrectsColoured tiles
Anthony Liguori [Mon, 14 Dec 2009 20:11:56 +0000 (14:11 -0600)] 
vnc: hextile: do not generate ForegroundSpecified and SubrectsColoured tiles

This violates the RFB specification (section 6.6.4).  It happens to work with
most clients but it's still wrong.

Reported-by: Yaniv Kaul <ykaul@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
(cherry picked from commit 02c2b87fff97e77a1f6033fb09f53afa267c0c1e)

15 years agoRevert "pci: interrupt disable bit support"
Anthony Liguori [Mon, 14 Dec 2009 17:36:53 +0000 (11:36 -0600)] 
Revert "pci: interrupt disable bit support"

This reverts commit 0ea5709a32085f7d14901a09d12bd35f9b267607.

Per discussion with Michael Tsirkin, this is too risky for 0.12

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
(cherry picked from commit d587e0787153f0224a6140c5015609963ceaabfb)

15 years agotarget-ppc: fix ppc32 kvm build
Alexander Graf [Sat, 19 Dec 2009 00:58:59 +0000 (01:58 +0100)] 
target-ppc: fix ppc32 kvm build

My segment sync patch broke compilation on PPC32, because it was trying to
sync the SLB even though ppc32 CPUs don't have an SLB.

So let's only sync it when we're on a PP64 one!

Signed-off-by: Alexander Graf <agraf@suse.de>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
(cherry picked from commit 82c09f2f0d0f405428ce0c567da2ada493acc30b)

15 years agoS390: Bail out without KVM
Alexander Graf [Fri, 18 Dec 2009 15:29:04 +0000 (16:29 +0100)] 
S390: Bail out without KVM

Currently only the S390 KVM target works. To keep users from accidently not
using KVM, let's not even initialize the machine when KVM is not used.

Signed-off-by: Alexander Graf <agraf@suse.de>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
(cherry picked from commit e249651ca94058547f7ae84694e82bb1ee03bc3c)

15 years agoS390: Don't tell guest we're updating config space
Alexander Graf [Thu, 17 Dec 2009 12:06:09 +0000 (13:06 +0100)] 
S390: Don't tell guest we're updating config space

Currently we always set the "config space changed" bit to 1 when triggering
any virtio interrupt. While that worked in 2.6.27, newer kernels interpret
that value as "only the config space changed and nothing else happened".

Since we usually trigger interrupts to tell the guest that something did
happen, we just not tell it the config space changed for now until we
implement the correct callback for that.

Signed-off-by: Alexander Graf <agraf@suse.de>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
(cherry picked from commit 86f3dba6518bd5fd106e1cf3f36dafda41ff377b)

15 years agoadd default virtcon initialization
Alexander Graf [Thu, 17 Dec 2009 12:06:08 +0000 (13:06 +0100)] 
add default virtcon initialization

When going through the default devices, we don't initialize the virtio
console, unless we're doing -nographic.

I suppose that's just a leftover from the recent code restructuring, so
let's put it in.

Signed-off-by: Alexander Graf <agraf@suse.de>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
(cherry picked from commit 38536da1e3cfde355169a81a3abe3235fd13fc6a)

15 years agoS390: Loop through virtio console devices
Alexander Graf [Thu, 17 Dec 2009 12:06:07 +0000 (13:06 +0100)] 
S390: Loop through virtio console devices

We used to always create one single virtio console device. This breaks when
either zero of multiple virtio console devices are requested, so let's use
the same code as on x86.

Signed-off-by: Alexander Graf <agraf@suse.de>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
(cherry picked from commit a1e4b07f04d8f31e8c0c1bf97385f426d3fcf5e6)

15 years agotarget-s390: Fail on unknown instructions
Alexander Graf [Thu, 17 Dec 2009 12:56:47 +0000 (13:56 +0100)] 
target-s390: Fail on unknown instructions

We were being a bit too nice and didn't give the guest an invalid instruction
interrupt.

While that works, it's not exactly the fastest thing to do, since now the
guest doesn't know that we're not really implementing that instruction, so it
continues doing it.

We run into this with the set_page_unstable hint instruction. So let's bail out
in these cases.

Signed-off-by: Alexander Graf <agraf@suse.de>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
(cherry picked from commit d7963c43b9646e4dfc69a4253c61e4bab7b661cd)

15 years agoosdep: Fix runtime failure on older Linux kernels
Andre Przywara [Fri, 18 Dec 2009 09:45:07 +0000 (10:45 +0100)] 
osdep: Fix runtime failure on older Linux kernels

If QEMU finds newer kernel header files on compilation time, it will use
advertised features like pipe2 or SOCK_CLOEXEC by just doing a compile test.
If later the executables are executed on an older kernel (<2.6.27,
like Xen Dom0 2.6.18), then QEMU will fail on opening sockets and creating
pipes and returns the rather unspecific "qemu_init_main_loop failed".
This patch fixes this by checking the return values of these calls
for EINVAL and ENOSYS and falling back to the older versions automatically.

Signed-off-by: Andre Przywara <andre.przywara@amd.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
15 years agoFix a make -j race
Juergen Lock [Mon, 14 Dec 2009 20:54:43 +0000 (21:54 +0100)] 
Fix a make -j race

Make libuser.a depend on $(GENERATED_HEADERS) too so make -j won't start
building it before the headers exist.  (There may be more bugs like this
but at least this makes (g)make -j4 started from scratch on a quadcore
now always complete here again.)

Signed-off-by: Juergen Lock <nox@jelal.kn-bremen.de>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
(cherry picked from commit c1bb0dcef2d3a62c89cef81a0f1a0e5e97ef325b)

15 years agotarget-alpha: Fix generic ctz64.
Richard Henderson [Mon, 14 Dec 2009 01:47:25 +0000 (17:47 -0800)] 
target-alpha: Fix generic ctz64.

Signed-off-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
(cherry picked from commit 06445248d23d2422a0fb5736b64f9e5a66539749)

15 years agos390: Fix buggy assignment
Stefan Weil [Mon, 14 Dec 2009 09:39:12 +0000 (10:39 +0100)] 
s390: Fix buggy assignment

nd->model keeps dynamically allocated model names.
So casting of a constant string is wrong here.

Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Acked-by: Alexander Graf <agraf@suse.de>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
(cherry picked from commit 5a2b3fc5aaae48859e09a8d96f4f92578b060892)

15 years agotarget-mips: fix user-mode emulation startup
Nathan Froyd [Fri, 11 Dec 2009 17:29:20 +0000 (09:29 -0800)] 
target-mips: fix user-mode emulation startup

Running programs with the MIPS user-mode emulator fails during dynamic
loading, as floating-point instructions are not enabled in in
env->hflags.  Move the code for doing so from fpu_init to cpu_reset so
the MIPS_HFLAG_{FPU,F64} setting doesn't get clobbered by cpu_reset
setting env->hflags to MIPS_HFLAG_UM.

The same end can be achieved by swapping the ordering of fpu_init and
cpu_reset in cpu_mips_init, but it seemed better to consolidate the
CONFIG_USER_ONLY code into a single location.

Signed-off-by: Nathan Froyd <froydnj@codesourcery.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
(cherry picked from commit 91a759352623e4a3da969fa66626cc99241e9da2)

15 years agotarget-i386: Update CPUID feature set for TCG
Andre Przywara [Mon, 7 Dec 2009 11:05:38 +0000 (12:05 +0100)] 
target-i386: Update CPUID feature set for TCG

The CPUID features QEMU presented to the guest were not up-to-date
with QEMU's emulated feature set.
Add the missing bits of recent (and not so recent) additions to
QEMU's emulation engine.
For stability reasons only the user mode usable bits are exposed for
now, features like Monitor or CR8LEG are left out.

Signed-off-by: Andre Przywara <andre.przywara@amd.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
(cherry picked from commit f1e00a9cf326acc1f2386a72525af8859852e1df)

15 years agos390: typo fix
Michael S. Tsirkin [Sun, 13 Dec 2009 14:45:47 +0000 (16:45 +0200)] 
s390: typo fix

s390 code has an obvious typo, which results in:
hw/s390-virtio.c: At top level:
hw/s390-virtio.c:249: error: request for member ‘no_vga’ in something not a structure or union

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Acked-by: Alexander Graf <agraf@suse.de>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
15 years agos390: fix build on 32 bit host
Michael S. Tsirkin [Sun, 13 Dec 2009 14:44:33 +0000 (16:44 +0200)] 
s390: fix build on 32 bit host

Building on 32 bit host we get:
hw/s390-virtio.c: In function ‘s390_init’:
hw/s390-virtio.c:184: error: integer constant is too large for ‘unsigned long’ type
64 bit values must be ULL.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Acked-by: Alexander Graf <agraf@suse.de>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
15 years agoUpdate Changelog and VERSION for 0.12.0-rc2 v0.12.0-rc2
Anthony Liguori [Sat, 12 Dec 2009 14:29:25 +0000 (08:29 -0600)] 
Update Changelog and VERSION for 0.12.0-rc2

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
15 years agov2: properly save kvm system time msr registers
Glauber Costa [Thu, 22 Oct 2009 12:26:56 +0000 (10:26 -0200)] 
v2: properly save kvm system time msr registers

Currently, the msrs involved in setting up pvclock are not saved over
migration and/or save/restore. This patch puts their value in special
fields in our CPUState, and deal with them using vmstate.

kvm also has to account for it, by including them in the msr list
for the ioctls.

This is a backport from qemu-kvm.git

[v2: sucessfully build without kerneldir ]

Signed-off-by: Glauber Costa <glommer@redhat.com>
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
(cherry picked from commit 1a03675db146dfc760b3b48b3448075189f142cc)

15 years agoVNC: Convert do_info_vnc() to QObject
Luiz Capitulino [Thu, 10 Dec 2009 19:16:10 +0000 (17:16 -0200)] 
VNC: Convert do_info_vnc() to QObject

Return a QDict with server information. Connected clients are returned
as a QList of QDicts.

The new functions (vnc_qdict_remote_addr(), vnc_qdict_local_addr() and
put_addr_qdict()) are used to insert 'host' and 'service' information
in the returned QDict.

This patch is big, but I don't see how to split it.

Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
(cherry picked from commit d96fd29cca420d1ff3d34cde233cf41a3818c550)

15 years agoPCI: Convert pci_device_hot_add() to QObject
Luiz Capitulino [Thu, 10 Dec 2009 19:16:09 +0000 (17:16 -0200)] 
PCI: Convert pci_device_hot_add() to QObject

Return a QDict with information about the just added device.

This commit should not change user output.

Please, note that this patch does not do error handling
conversion. In error conditions the handler still calls
monitor_printf().

Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
(cherry picked from commit 7a344f7ac7bb651d0556a933ed8060d3a9e5d949)

15 years agochar: Convert qemu_chr_info() to QObject
Luiz Capitulino [Thu, 10 Dec 2009 19:16:08 +0000 (17:16 -0200)] 
char: Convert qemu_chr_info() to QObject

Each device is represented by a QDict. The returned QObject is a QList
of all devices.

This commit should not change user output.

Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
(cherry picked from commit 588b38320134edee4a569f60ed88c9848961d6ee)

15 years agoblock: Convert bdrv_info_stats() to QObject
Luiz Capitulino [Thu, 10 Dec 2009 19:16:07 +0000 (17:16 -0200)] 
block: Convert bdrv_info_stats() to QObject

Each device statistic information is stored in a QDict and
the returned QObject is a QList of all devices.

This commit should not change user output.

Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
(cherry picked from commit 218a536a7a7c6d3679d5eca0103f32fd11fbfaf0)

15 years agoblock: Convert bdrv_info() to QObject
Luiz Capitulino [Thu, 10 Dec 2009 19:16:06 +0000 (17:16 -0200)] 
block: Convert bdrv_info() to QObject

Each block device information is stored in a QDict and the
returned QObject is a QList of all devices.

This commit should not change user output.

Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
(cherry picked from commit d15e546567d75fca36d852c39e30adaab02121a7)

15 years agomigration: Convert do_info_migrate() to QObject
Luiz Capitulino [Thu, 10 Dec 2009 19:16:05 +0000 (17:16 -0200)] 
migration: Convert do_info_migrate() to QObject

Return a QDict, which may contain up to more two QDicts, depending
on the type of migration we're performing.

IMPORTANT: as a QInt stores a int64_t integer, RAM values are going
to be stored as int64_t and not as uint64_t as they are today. If
this is a problem QInt will have to be changed.

This commit should not change user output.

Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
(cherry picked from commit c86a668390d16d6b3249acd50bfa61ad825c7a80)

15 years agomonitor: Convert do_info_mice() to QObject
Luiz Capitulino [Thu, 10 Dec 2009 19:16:04 +0000 (17:16 -0200)] 
monitor: Convert do_info_mice() to QObject

Each mouse is represented by a QDict, the returned QObject is a QList of
all mice.

This commit should not change user output.

Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
(cherry picked from commit e78c48ec4e192ef1b1a210bdf5a8d253d7826c25)

15 years agomonitor: Convert do_info_uuid() to QObject
Luiz Capitulino [Thu, 10 Dec 2009 19:16:03 +0000 (17:16 -0200)] 
monitor: Convert do_info_uuid() to QObject

snprintf() is used because the UUID_FMT is too complex for
qobject_from_jsonf().

Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
(cherry picked from commit 9603ceba2edd1dc7e3823da76d84706d3d1c3d78)

15 years agomonitor: Convert do_info_hpet() to QObject
Luiz Capitulino [Thu, 10 Dec 2009 19:16:02 +0000 (17:16 -0200)] 
monitor: Convert do_info_hpet() to QObject

Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
(cherry picked from commit 14f0720df929181eed5424b3f436d84ce05541c3)

15 years agomonitor: Convert do_info_name() to QObject
Luiz Capitulino [Thu, 10 Dec 2009 19:16:01 +0000 (17:16 -0200)] 
monitor: Convert do_info_name() to QObject

Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
(cherry picked from commit e05486cba662ccceef6be4b3ce38961876aa8f6e)

15 years agomonitor: Convert do_info_kvm() to QObject
Luiz Capitulino [Thu, 10 Dec 2009 19:16:00 +0000 (17:16 -0200)] 
monitor: Convert do_info_kvm() to QObject

Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
(cherry picked from commit 2af5ba712b3e03cf644320f7386bf1dfd2c2b6a8)

15 years agomonitor: Convert do_info_status() to QObject
Luiz Capitulino [Thu, 10 Dec 2009 19:15:59 +0000 (17:15 -0200)] 
monitor: Convert do_info_status() to QObject

Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
(cherry picked from commit c0e8520ed5efef2891e2e930a1bb21c1b040410f)

15 years agomonitor: do_info_version(): Use QDict
Luiz Capitulino [Thu, 10 Dec 2009 19:15:58 +0000 (17:15 -0200)] 
monitor: do_info_version(): Use QDict

All 'info' commands should use QDict, this commit also kills
monitor_print_qobject() as do_info_version() doesn't use it
anymore (and no handler will).

Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
(cherry picked from commit 45e914cfe03f9fcf946bdc124f752d8f288eff05)

15 years agomonitor: do_info_cpus(): Use QBool
Luiz Capitulino [Thu, 10 Dec 2009 19:15:57 +0000 (17:15 -0200)] 
monitor: do_info_cpus(): Use QBool

While there update the documentation as well.

Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
(cherry picked from commit 55483ad657dcb62cde09bce3b38a5fc28d08f999)

15 years agomonitor: Fix do_info_commands() output
Luiz Capitulino [Thu, 10 Dec 2009 19:15:56 +0000 (17:15 -0200)] 
monitor: Fix do_info_commands() output

Should return a QDict and should not print the user protocol bits
(eg. "c|cont").

Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
(cherry picked from commit 1a728677d4e2f0434caf352c0e88100652fd6711)

15 years agomonitor: Fix do_info_balloon() output
Luiz Capitulino [Thu, 10 Dec 2009 19:15:55 +0000 (17:15 -0200)] 
monitor: Fix do_info_balloon() output

Monitor commands should always return values in bytes and info
commands should always return a QDict.

Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
(cherry picked from commit 7f1796713ed2f338bd9abc094aacf10f67aed1e5)

15 years agoQDict: Introduce qdict_get_qlist()
Luiz Capitulino [Thu, 10 Dec 2009 19:15:54 +0000 (17:15 -0200)] 
QDict: Introduce qdict_get_qlist()

A helper function to get a QList from a QDict.

Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
(cherry picked from commit f2e1750803240ec8b78ae126af0d54f7896ee11d)

15 years agoQDict: Introduce qdict_get_qbool()
Luiz Capitulino [Thu, 10 Dec 2009 19:15:53 +0000 (17:15 -0200)] 
QDict: Introduce qdict_get_qbool()

This is a helper function that does type checking before retrieving
a QBool from the dictionary.

Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
(cherry picked from commit cd4dde36ae8e7bd8e02839533c5708011bf994cf)

15 years agoMakefile: move QObject objs to their own entry
Luiz Capitulino [Thu, 10 Dec 2009 19:15:52 +0000 (17:15 -0200)] 
Makefile: move QObject objs to their own entry

Other subsystems will need to link against them.

Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
(cherry picked from commit 2a01000f7df5faeeb06742b8f7afabf9e8a9d2b6)

15 years agoIntroduce qemu-objects.h header file
Luiz Capitulino [Thu, 10 Dec 2009 19:15:51 +0000 (17:15 -0200)] 
Introduce qemu-objects.h header file

An easy way to include all QEMU objects.

Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
(cherry picked from commit 2471dd00ef212af4b7e1262d5339f0db17e55661)

15 years agovnc: fix capslock tracking logic.
Gerd Hoffmann [Fri, 11 Dec 2009 10:25:07 +0000 (11:25 +0100)] 
vnc: fix capslock tracking logic.

The capslock tracking logic added by commit
6b1325029d80455b9da7cd7bd84a88cb915b867c doesn't work correctly for vnc
clients without EXT_KEY_EVENT support.  The reason is that qemu converts
keysyms for letters to lowercase for the keysym2scancode lookup.  It
then also passes the lowercase value down to do_key_event(), but the
capslock tracking code needs it with the correct case to work properly.

This patch adds a new variable for the lowercase keysym so we'll keep
the unmodified value for do_key_event().

The keysym2scancode is not needed with EXT_KEY_EVENT capable clients
like any app based on the gtk-vnc widget, so I missed that case in
testing ...

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
(cherry picked from commit 4a93fe17081c7ae7f4d5607b266ca384d328986c)

15 years agoQemuOpts: allow larger option values.
Gerd Hoffmann [Thu, 10 Dec 2009 10:11:08 +0000 (11:11 +0100)] 
QemuOpts: allow larger option values.

Use case: loooooooooooooooooong file names for -drive file=...

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
(cherry picked from commit d318ff9900f080dfa802bbbea81f1a68dcd02013)

15 years agoscsi: fix drive hotplug.
Gerd Hoffmann [Thu, 10 Dec 2009 10:11:07 +0000 (11:11 +0100)] 
scsi: fix drive hotplug.

This patch fills the DriveInfo->unit after hotplugging a scsi disk.
It makes a difference when auto-assigning a scsi id, where unit was
left filled with '-1' instead of the actual scsi id.

With this patch applied the the drive naming logic in drive_init() works
as good as it did in previous releases.  Which means it works fine with
a single scsi bus.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
(cherry picked from commit 11f4d7f483d9ca3a8979abd605cf1468b3e96aa2)

15 years agopci: don't hw_error() when no slot is available.
Gerd Hoffmann [Thu, 10 Dec 2009 10:11:06 +0000 (11:11 +0100)] 
pci: don't hw_error() when no slot is available.

Current PCI code will simply hw_error() and thus abort in case no free
PCI slot is available or the requested PCI slot is already in use by
another device.  For the hotplug case this behavior is not acceptable.
This patch makes qemu pass up the error properly, so the calling code
can decide whenever it wants to exit with an error (on startup) or
whenever it wants to continue (hotplug).

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
(cherry picked from commit 09e3acc6cfabfd85a9dacc04471df5f05019c779)

15 years agopci: don't abort() when trying to hotplug with acpi off.
Gerd Hoffmann [Thu, 10 Dec 2009 10:11:05 +0000 (11:11 +0100)] 
pci: don't abort() when trying to hotplug with acpi off.

The PCI bus on x86 requires ACPI for hotplug support, thus disbling ACPI
also disables hotplug for the PCI bus.  This patch makes qemu check
whenever the PCI bus in question can handle hotplug before trying to add
devices.  This is needed because qdev will abort() on any attempt to
hotplug devices into a non-hotpluggable bus.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
(cherry picked from commit 53e0d8affe8514b070db2d265af13a534cb8eda4)

15 years agoSet default console to virtio on S390x
Gerd Hoffmann [Tue, 8 Dec 2009 12:11:54 +0000 (13:11 +0100)] 
Set default console to virtio on S390x

All "normal" system emulation targets in qemu I'm aware of display
output on either VGA or serial output.

Our S390x virtio machine doesn't have such kind of legacy hardware. So
instead we need to default to a virtio console.

Add flags to QEMUMachine to indicate which kind of default devices make
sense for the machine in question.  Use it for S390x: enable virtcon,
disable serial, parallel and vga.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
(cherry picked from commit 986c5f78543bdbd696664447ecdd08cf6d935370)

15 years agodefault devices: virtio consoles.
Gerd Hoffmann [Tue, 8 Dec 2009 12:11:53 +0000 (13:11 +0100)] 
default devices: virtio consoles.

This patch adds a variable default_virtcon which says whenever a default
virtio console should be added.  It is disabled by default, followup
patch will enable it for s390.  It is cleared when qemu finds
'-virtiocon', '-device virtio-console-s390' or '-device
virtio-console-pci' on the command line.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
(cherry picked from commit aee1b935c53cc747528138a85fcce8163d272598)

15 years agoadd -qmp convinience switch
Gerd Hoffmann [Tue, 8 Dec 2009 12:11:52 +0000 (13:11 +0100)] 
add -qmp convinience switch

Acts like -monitor but switched into qmp mode.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
(cherry picked from commit 6ca5582d4f06d8ff0c646b8fe3cfe721dc573597)

15 years agoadd new -mon switch
Gerd Hoffmann [Tue, 8 Dec 2009 12:11:51 +0000 (13:11 +0100)] 
add new -mon switch

Add -mon switch which maps pretty straight forward into the QemuOpts
internal representation:

  -mon chardev=<name>[,mode=[control|readline]][,[no]default]

Via config file:

[mon]
   chardev = "<name>"
   mode = "readline"
   default = "on"

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
(cherry picked from commit 22a0e04b9bb5a02e13b3e5cf5ea8abfac5f34120)

15 years agorework -monitor handling, switch to QemuOpts
Gerd Hoffmann [Tue, 8 Dec 2009 12:11:50 +0000 (13:11 +0100)] 
rework -monitor handling, switch to QemuOpts

This patch reworks the -monitor handling:

 - It adds a new "mon" QemuOpts list for the monitor(s).
 - It adds a monitor_parse() function to parse the -monitor switch.
 - It adds a mon_init function to initialize the monitor(s) from the
   "mon" QemuOpts list.
 - It winds up everything and removes the old bits.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
(cherry picked from commit 88589343708f10f1ded0af100b2e11eec623bae2)

15 years agoun-static qemu_chr_parse_compat()
Gerd Hoffmann [Tue, 8 Dec 2009 12:11:49 +0000 (13:11 +0100)] 
un-static qemu_chr_parse_compat()

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
(cherry picked from commit 33521634bf15996e020c51c47abaaa68e27bf356)

15 years agodefault devices: drives
Gerd Hoffmann [Tue, 8 Dec 2009 12:11:48 +0000 (13:11 +0100)] 
default devices: drives

Add a default_drive variable which specified whenever the default drives
(cdrom, floppy, sd) should be created.  It is cleared when the new
-nodefaults switch is specified on the command line.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
(cherry picked from commit aa40fc9c96474b0135d1b940611862f260aedba7)

15 years agodefault devices: network
Gerd Hoffmann [Tue, 8 Dec 2009 12:11:47 +0000 (13:11 +0100)] 
default devices: network

Add a default_net variable which specified whenever a default network
should be created.  It is cleared in case any -net option is specified
and it is also added to the new -nodefaults switch.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
(cherry picked from commit cb4522ccf67ba84d246291d9f75bd7f3df137d1a)

15 years agodefault devices: add global cmd line option.
Gerd Hoffmann [Tue, 8 Dec 2009 12:11:46 +0000 (13:11 +0100)] 
default devices: add global cmd line option.

Add global command line option to disable default devices.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
(cherry picked from commit d8c208dd8a038d24ba4890156101bc679a8c8fef)

15 years agodefault devices: vga adapter.
Gerd Hoffmann [Tue, 8 Dec 2009 12:11:45 +0000 (13:11 +0100)] 
default devices: vga adapter.

Qemu creates a vga display for you in case you didn't specify one on the
command line.  Right now this is tied to the '-vga <type>' command line
switch, which in turn causes trouble if you are creating your gfx card
using '-device VGA,<props>'.

This patch adds a variable default_vga which says whenever a default
serial line should be added.  It is enabled by default.  It is cleared
when qemu finds '-vga' or '-device {VGA,Cirrus VGA,QEMUware SVGA}' on
the command line.

'-device VGA' still doesn't work though due to a initialization order
issue (vga must init before calling i440fx_init_memory_mappings).

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
(cherry picked from commit 64465297cd4c701942988f36f7ce707fb21cc1d8)

15 years agozap serial_monitor_mux
Gerd Hoffmann [Tue, 8 Dec 2009 12:11:44 +0000 (13:11 +0100)] 
zap serial_monitor_mux

The logic in this code obviously predates the multiple monitor
capability of qemu and looks increasingly silly these days.

I think the intention of this piece of code is to get a reasonable
default for the -nographic case: have monitor and serial line muxed
on stdio.

With the new default_serial and default_monitor variables we have now
doing just that became much easier ;)

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
(cherry picked from commit e1c09175bc00dd8dfb2ad1b26e1858dcdc109b59)

15 years agodefault devices: qemu monitor.
Gerd Hoffmann [Tue, 8 Dec 2009 12:11:43 +0000 (13:11 +0100)] 
default devices: qemu monitor.

This patch makes the monitor default device configuration work like the
default serial and parallel port devices.  It adds a variable
default_monitor which says whenever a default monitor should be added.
It is enabled by default.  It is cleared when qemu finds '-monitor' on
the command line.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
(cherry picked from commit abdeed06b416eefb7eb1ec65cc1b87241cb3b6d2)

15 years agodefault devices: parallel port.
Gerd Hoffmann [Tue, 8 Dec 2009 12:11:42 +0000 (13:11 +0100)] 
default devices: parallel port.

Qemu creates a default parallel port for you in case you didn't specify
one on the command line.  Right now this is tied to the '-parallel
<chardev>' command line switch, which in turn causes trouble if you are
creating your parallel port via '-device isa-parallel,<props>'.

This patch adds a variable default_parallel which says whenever a default
parallel port should be added.  It is enabled by default.  It is cleared
when qemu finds '-parallel' or '-device isa-parallel' on the command line.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
(cherry picked from commit 6a5e8b0e310c483d8d14553a2b7b601d39ed8b75)

15 years agodefault devices: core code & serial lines.
Gerd Hoffmann [Tue, 8 Dec 2009 12:11:41 +0000 (13:11 +0100)] 
default devices: core code & serial lines.

Qemu creates a default serial line for you in case you didn't specify
one on the command line.  Right now this is tied to the '-serial
<chardev>' command line switch, which in turn causes trouble if you are
creating your serial line via '-device isa-serial,<props>'.

This patch adds a variable default_serial which says whenever a default
serial line should be added.  It is enabled by default.  It is cleared
when qemu finds '-serial' or '-device isa-serial' on the command line.

Part of the patch is some infrastructure for the '-device $driver'
checking (default_driver_check function) which will also be used by the
other patches of this series.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
(cherry picked from commit 998bbd74b9d813b14a3a3b5009a5d5a48c7dce51)

15 years agovc: colorize chardev title line with blue background.
Gerd Hoffmann [Tue, 8 Dec 2009 12:11:40 +0000 (13:11 +0100)] 
vc: colorize chardev title line with blue background.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
(cherry picked from commit 735ba5884943ad91be660b59092ab7592c4bde07)

15 years agochardev: move greeting into vc backend.
Gerd Hoffmann [Tue, 8 Dec 2009 12:11:39 +0000 (13:11 +0100)] 
chardev: move greeting into vc backend.

Make the 'vc' chardev backend print a title line with the chardev name
after initialization, using CharDriverState->label.

This replaces the banner printing code in vl.c.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
(cherry picked from commit 51bfa4d3160fe1d5c2eca381020b8b6dd69c3c80)

15 years agoRevert "Set default console to virtio on S390x"
Gerd Hoffmann [Tue, 8 Dec 2009 12:11:38 +0000 (13:11 +0100)] 
Revert "Set default console to virtio on S390x"

This reverts commit 93d434b4aec0702b87ebf52449a3cdf2c3596825.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
(cherry picked from commit 014100bb73d8512fb3d62f5cb123bfb2d04f3089)

15 years agoRevert "monitor: Command-line flag to enable control mode"
Gerd Hoffmann [Tue, 8 Dec 2009 12:11:37 +0000 (13:11 +0100)] 
Revert "monitor: Command-line flag to enable control mode"

This reverts commit adcb181afe5a951c521411c7a8e9d9b791aa6742.

Conflicts:

monitor.h

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
(cherry picked from commit 4e307fc883b39c89ffc093c79eb9c9735724d227)

15 years agochardev: make chardevs specified in config file work.
Gerd Hoffmann [Tue, 8 Dec 2009 12:11:36 +0000 (13:11 +0100)] 
chardev: make chardevs specified in config file work.

The patch decuples the -chardev switch and the actual chardev
initialization.  Without this patch qemu ignores chardev entries
coming via -readconfig.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
(cherry picked from commit 1a688d3bbc2a44bfefa3f6774a11b0385dafc029)

15 years agoqdev: also match bus name for global properties
Gerd Hoffmann [Tue, 8 Dec 2009 12:11:35 +0000 (13:11 +0100)] 
qdev: also match bus name for global properties

i.e. -global PCI.<property>=<value> will set a default property for all
PCI devices.  Also works for the compat properties used by machine
types.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
(cherry picked from commit 07a8de3566bd576dc33e55af830d63dcc2287617)

15 years agoqdev: add command line option to set global defaults for properties.
Gerd Hoffmann [Tue, 8 Dec 2009 12:11:34 +0000 (13:11 +0100)] 
qdev: add command line option to set global defaults for properties.

This patch adds infrastructure and command line option for setting
global defaults for device properties, i.e. you can for example use

  -global virtio-blk-pci.vectors=0

to turn off msi by default for all virtio block devices.  The config
file syntax is:

[global]
  driver = "virtio-blk-pci"
  property = "vectors"
  value = "0"

This can also be used to set properties for devices which are not
created via -device but implicitly via machine init, i.e.

  -global isa-fdc,driveA=<name>

This patch uses the mechanism which configures properties for the
compatibility machine types (pc-0.10 & friends).  The command line
takes precedence over the machine type values.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
(cherry picked from commit d0fef6fbea36c62d29f3e3fa2214b7b52322983e)

15 years agoqdev: make compat stuff more generic
Gerd Hoffmann [Tue, 8 Dec 2009 12:11:33 +0000 (13:11 +0100)] 
qdev: make compat stuff more generic

This patch renames the compat properties into global properties and
makes them more generic.  The compatibility stuff is only one of
multiple possible users now.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
(cherry picked from commit 458fb6792d834474c6b289738b6bf9601fad87ab)

15 years agokvm: x86: Save/restore exception_index
Jan Kiszka [Tue, 8 Dec 2009 16:54:55 +0000 (17:54 +0100)] 
kvm: x86: Save/restore exception_index

As KVM now makes use of exception_index to keep pending exceptions, we
have to save&restore this field as well.

NOTE: We have to nail the arch-independent exception_index down to a
certain bit width for proper vmstate processing, namely to 32 bit.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
(cherry picked from commit 4d6e3ac5d411c461d0fb4b1cd2ace854963c9e30)

15 years agoFix recently added QERR_ definitions
Markus Armbruster [Tue, 8 Dec 2009 12:33:54 +0000 (13:33 +0100)] 
Fix recently added QERR_ definitions

Commits c7c338c441471a237a046f5f and a488be27 used
lower_case_with_underscores for class values.  Existing usage
CamelCase.  ChangeToThatForConsistency.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
(cherry picked from commit bd9d30640c3c2489175fd9ddd5459c69f94688f8)

15 years agoqdev: Replace device names containing whitespace
Markus Armbruster [Wed, 9 Dec 2009 16:07:53 +0000 (17:07 +0100)] 
qdev: Replace device names containing whitespace

Device names with whitespace require quoting in the shell and in the
monitor.  Some of the offenders are also overly long.  Some have a
more convenient alias, some don't.

The place for verbose device names is DeviceInfo member desc.  The
name should be short & sweet.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
(cherry picked from commit 556cd09885bec3f69ba78228fe4e46dc1dad145b)

15 years agoqdev: Separate USB product description from qdev name
Markus Armbruster [Wed, 9 Dec 2009 16:07:52 +0000 (17:07 +0100)] 
qdev: Separate USB product description from qdev name

Using the qdev name for the product description makes for inconvenient
qdev names.

Put the product description in new USBDeviceInfo member product_desc.
Make usb_qdev_init() use it.  No user or guest visible change, since
the value is still the same.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
(cherry picked from commit 063846984ce7eb1c1ddce6dda39b662c64a80dc0)

15 years agoqdev: Rename USBDevice member devname to product_desc
Markus Armbruster [Wed, 9 Dec 2009 16:07:51 +0000 (17:07 +0100)] 
qdev: Rename USBDevice member devname to product_desc

It's not a device name, it's the USB product description string.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
(cherry picked from commit 0fe6d12e0bc752c29a93ac83a274e3650d457069)

15 years agofix rtc-td-hack on host without high-res timers
Gleb Natapov [Tue, 8 Dec 2009 13:50:54 +0000 (15:50 +0200)] 
fix rtc-td-hack on host without high-res timers

On hosts without high-res timers it is impossible to inject rtc interrupt
faster then 1kHz. Windows sometimes configures RTC to generate 1kHz
interrupts, so we can't inject missed interrupts when running on such
hosts. Always injecting an interrupt on REG_C read is also not an option
since Windows wait for REG_C to become zero with interrupt disabled
during boot. This patch uses mixed approach: accelerate timer + inject
up to 1000 interrupts on REG_C read.

Signed-off-by: Gleb Natapov <gleb@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
(cherry picked from commit ba32edab7fdab0e74b54696942b4127d26861cf6)

15 years agovirtio: verify features on load
Michael S. Tsirkin [Tue, 8 Dec 2009 18:07:48 +0000 (20:07 +0200)] 
virtio: verify features on load

migrating between hosts which have different features
might break silently, if the migration destination
does not support some features supported by source.

Prevent this from happening by comparing acked feature
bits with the mask supported by the device.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
(cherry picked from commit 6d74ca5aa83b83fb52332f7735c61ecb7a5328c1)

15 years agovmware_vga: add rom file so that it boots.
Dave Airlie [Fri, 11 Dec 2009 05:47:44 +0000 (15:47 +1000)] 
vmware_vga: add rom file so that it boots.

This just adds the rom file to the vmware SVGA chipset so it boots.

Signed-off-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
(cherry picked from commit b3c3f123f785fb861d930080f083507b51f5ce79)

15 years agoDo not abort on qemu_malloc(0) in production builds
Anthony Liguori [Wed, 9 Dec 2009 18:59:36 +0000 (12:59 -0600)] 
Do not abort on qemu_malloc(0) in production builds

qemu_malloc() does not allow size=0 to be passed in and aborts on this behavior.

Unfortunately, there is good reason to believe that within qemu, there are a
number of, so far, undetected places that assume size=0 can be safely passed.
Since we do not want to abort unnecessarily in production builds, return
qemu_malloc(1) whenever the version file indicates that this is a production
build.

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
(cherry picked from commit 20ff6c8066eb5346b9e066851cf8a1e0564a0f1a)

15 years agoFix ARM userspace strex implementation.
Paul Brook [Fri, 11 Dec 2009 15:38:10 +0000 (15:38 +0000)] 
Fix ARM userspace strex implementation.

Signed-off-by: Paul Brook <paul@codesourcery.com>
15 years agoqemu: delete rule target on error
Michael S. Tsirkin [Mon, 7 Dec 2009 19:04:52 +0000 (21:04 +0200)] 
qemu: delete rule target on error

Instruct make to remove any rule target on error. This prevetns
situation where there was an error during build but generated file still
stays behind.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
(cherry picked from commit 7dbbbb0c9e4313cf2d2f6559b7899259fb09eb63)

15 years agoQMP: add human-readable description to error response
Markus Armbruster [Mon, 7 Dec 2009 20:37:16 +0000 (21:37 +0100)] 
QMP: add human-readable description to error response

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
(cherry picked from commit 77e595e7c613c495714d04ce63fb9bce263c29ae)

15 years agomonitor: convert do_getfd() to QError
Markus Armbruster [Mon, 7 Dec 2009 20:37:15 +0000 (21:37 +0100)] 
monitor: convert do_getfd() to QError

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
(cherry picked from commit 7cdfcfe18f0a9e8603e4a14770a84eb5649521c5)

15 years agoQError: New QERR_TOO_MANY_FILES
Markus Armbruster [Mon, 7 Dec 2009 20:37:14 +0000 (21:37 +0100)] 
QError: New QERR_TOO_MANY_FILES

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
(cherry picked from commit a488be27e5fbfd78e3c7f98706e0c2f6af402061)

15 years agoNew QERR_INVALID_PARAMETER
Markus Armbruster [Mon, 7 Dec 2009 20:37:13 +0000 (21:37 +0100)] 
New QERR_INVALID_PARAMETER

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
(cherry picked from commit 7a046f5f14d3de026197dc08c389cd1f23a3dddf)

15 years agoQError: New QERR_FD_NOT_SUPPLIED
Markus Armbruster [Mon, 7 Dec 2009 20:37:12 +0000 (21:37 +0100)] 
QError: New QERR_FD_NOT_SUPPLIED

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
(cherry picked from commit 41471a2338522d72955c20179e16cff4d546b32a)

15 years agomonitor: convert do_closefd() to QError
Markus Armbruster [Mon, 7 Dec 2009 20:37:11 +0000 (21:37 +0100)] 
monitor: convert do_closefd() to QError

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
(cherry picked from commit 063c1a0918d5a08f7ba89300d022b3421174fbf7)

15 years agoQError: New QERR_FD_NOT_FOUND
Markus Armbruster [Mon, 7 Dec 2009 20:37:10 +0000 (21:37 +0100)] 
QError: New QERR_FD_NOT_FOUND

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
(cherry picked from commit c7c338c49712eceef0ef584249856928de30cb45)

15 years agomonitor: convert do_change() to QObject, QError
Markus Armbruster [Mon, 7 Dec 2009 20:37:09 +0000 (21:37 +0100)] 
monitor: convert do_change() to QObject, QError

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
(cherry picked from commit ec3b82afaa0c4c06689d6a6381d351eefc4ee171)

15 years agoQError: New QERR_VNC_SERVER_FAILED
Markus Armbruster [Mon, 7 Dec 2009 20:37:08 +0000 (21:37 +0100)] 
QError: New QERR_VNC_SERVER_FAILED

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
(cherry picked from commit a6906e31a8d025a0dd626ee3c14dd58e7b9ab445)

15 years agoQError: New QERR_SET_PASSWD_FAILED
Markus Armbruster [Mon, 7 Dec 2009 20:37:07 +0000 (21:37 +0100)] 
QError: New QERR_SET_PASSWD_FAILED

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
(cherry picked from commit 7a84cb23c077488b0e1926b3e909ea128a80dc58)

15 years agoQError: New QERR_INVALID_BLOCK_FORMAT
Markus Armbruster [Mon, 7 Dec 2009 20:37:06 +0000 (21:37 +0100)] 
QError: New QERR_INVALID_BLOCK_FORMAT

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
(cherry picked from commit 17901e75329fff369e26f2464a016e0797789256)

15 years agomonitor: convert do_eject() to QError
Markus Armbruster [Mon, 7 Dec 2009 20:37:05 +0000 (21:37 +0100)] 
monitor: convert do_eject() to QError

Also affects do_change(), because the two share eject_device().

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
(cherry picked from commit 2c2a6bb860c09a80f519cd6297f1c0585a1436ec)

15 years agoQError: New QERR_DEVICE_NOT_REMOVABLE
Markus Armbruster [Mon, 7 Dec 2009 20:37:04 +0000 (21:37 +0100)] 
QError: New QERR_DEVICE_NOT_REMOVABLE

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
(cherry picked from commit 5cfe026475f3233a4c42351001560450886feddb)

15 years agoQError: New QERR_DEVICE_LOCKED
Markus Armbruster [Mon, 7 Dec 2009 20:37:03 +0000 (21:37 +0100)] 
QError: New QERR_DEVICE_LOCKED

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
(cherry picked from commit b086838090e32e05a60b21c2cabca8098c1562c4)

15 years agoQError: Put error definitions in alphabetical order
Markus Armbruster [Mon, 7 Dec 2009 20:37:02 +0000 (21:37 +0100)] 
QError: Put error definitions in alphabetical order

Also fix the odd typoe and clean up whitespace.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
(cherry picked from commit e16a18122212e86b87a0ca1dd79269918c7dc667)

15 years agomonitor: Fix double-prompt after "change vnc passwd BLA"
Markus Armbruster [Mon, 7 Dec 2009 20:37:01 +0000 (21:37 +0100)] 
monitor: Fix double-prompt after "change vnc passwd BLA"

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
(cherry picked from commit 2895e075c6dba0e66c72af781b1eed2bff0c3777)

15 years agomonitor: do_cont(): Don't ask for passwords
Luiz Capitulino [Mon, 7 Dec 2009 20:37:00 +0000 (21:37 +0100)] 
monitor: do_cont(): Don't ask for passwords

The do_cont() function will ask the user to enter a password if a
device is encrypted.

This is invalid under QMP, so we raise a QERR_DEVICE_ENCRYPTED
error.

Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
(cherry picked from commit 94171e119cb6f7bab2578896643b0daff1d9b184)