]> git.proxmox.com Git - qemu.git/log
qemu.git
14 years agoUpdate for 0.12.0 release v0.12.0
Anthony Liguori [Sat, 19 Dec 2009 14:23:00 +0000 (08:23 -0600)]
Update for 0.12.0 release

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
14 years agoUpdate to SeaBIOS 0.5.0
Anthony Liguori [Sat, 19 Dec 2009 03:26:15 +0000 (21:26 -0600)]
Update to SeaBIOS 0.5.0

The only change is updating the makefile but that way we're carrying an official
release.

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

14 years agoRevert "monitor: Convert do_migrate_set_speed() to QObject"
Anthony Liguori [Fri, 18 Dec 2009 20:51:49 +0000 (14:51 -0600)]
Revert "monitor: Convert do_migrate_set_speed() to QObject"

This reverts commit 3a4921047d514c336531c304bec362c4d138ebcc.

From Luiz:

  do_migrate_set_speed() accepts a suffix for the 'value' argument and this is
  not good for QMP.  We will have to add a new argument type to handle that and
  this will have to wait for 0.13.

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

14 years agoe1000: Don't muck with PCI commmand register
Anthony Liguori [Fri, 18 Dec 2009 19:58:56 +0000 (13:58 -0600)]
e1000: Don't muck with PCI commmand register

Otherwise, the driver does not work in Linux after the INT_DISABLE changes in
PCI.

Michael Tsirkin had a patch to do this, I'm not sure what happened to it.

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

14 years agomonitor: do_balloon(): Use 'M' argument type
Luiz Capitulino [Fri, 18 Dec 2009 15:25:05 +0000 (13:25 -0200)]
monitor: do_balloon(): Use 'M' argument type

This makes do_balloon() accept megabyte values from the user
Monitor while accepting byte values for QMP.

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

14 years agomonitor: Introduce 'M' argument type
Luiz Capitulino [Fri, 18 Dec 2009 15:25:04 +0000 (13:25 -0200)]
monitor: Introduce 'M' argument type

This is a target long value in megabytes which should be
converted to bytes.

It will be used by handlers which accept a megabyte value
when in "user mode".

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

14 years agoQMP: Update spec file
Luiz Capitulino [Fri, 18 Dec 2009 15:25:03 +0000 (13:25 -0200)]
QMP: Update spec file

- Remove "draft" status
- Change default success response to be json-object
- Change error and event data member to be a json-object
- Update examples
- Add new section "Compatibility Considerations"
- Other fixes and clarifications

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

14 years agoQMP: Update README file
Luiz Capitulino [Fri, 18 Dec 2009 15:25:02 +0000 (13:25 -0200)]
QMP: Update README file

- Fix output description
- Fix command-line usage notes
- Minor improvements

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

14 years agoQMP: Assure that returned data is a QDict
Luiz Capitulino [Fri, 18 Dec 2009 15:25:01 +0000 (13:25 -0200)]
QMP: Assure that returned data is a QDict

This is for debug purposes only.

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

14 years agoQMP: Return an empty dict by default
Luiz Capitulino [Fri, 18 Dec 2009 15:25:00 +0000 (13:25 -0200)]
QMP: Return an empty dict by default

Currently, when a regular command doesn't have any data to output,
QMP will emit:

{ "return": "OK" }

Returning an empty dict is better though, because dicts can support
some protocol changes in a compatible way.

So, with this commit we will return:

{ "return": {} }

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

14 years agoQMP: Only handle converted commands
Luiz Capitulino [Fri, 18 Dec 2009 15:24:59 +0000 (13:24 -0200)]
QMP: Only handle converted commands

Looks like I dropped this check when addressing the 'query-'
commands request.

QMP should only handle converted commands, obviously.

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

14 years agoUpdate SeaBIOS to include PCI based option rom loading
Anthony Liguori [Fri, 18 Dec 2009 15:42:56 +0000 (09:42 -0600)]
Update SeaBIOS to include PCI based option rom loading

Also remove pcbios from the tree.  It will no longer work.

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

14 years agoroms: remove option rom packing logic
Gerd Hoffmann [Fri, 18 Dec 2009 11:01:12 +0000 (12:01 +0100)]
roms: remove option rom packing logic

Now that we load the option roms via fw_cfg, we can stop copying
them to the 0xc000 -> 0xe000.  The patch does just that.

Also the rom loader gets simplified as all remaining users of the
rom loader load the bits at a fixed address so the packing and
aligning logic can go away.

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

14 years agoroms: use new fw_cfg file xfer support.
Gerd Hoffmann [Fri, 18 Dec 2009 11:01:11 +0000 (12:01 +0100)]
roms: use new fw_cfg file xfer support.

roms: use fw_cfg for vgabios and option rom loading, additionally to
deploying them the traditional way (copy to 0xc0000 -> 0xe0000 range).

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

14 years agofw_cfg: add API for file transfer.
Gerd Hoffmann [Fri, 18 Dec 2009 11:01:10 +0000 (12:01 +0100)]
fw_cfg: add API for file transfer.

This patch adds a file transfer interface to fw_cfg.  Intended to be
used for passing non-pci option roms and vgabios to seabios.  Namespace
is modeled after the existing cbfs filesystem support in seabios.

Reading the new FW_CFG_FILE_DIR entry returns a file list.
Fields there are in network byte order (aka bigendian).

aliguori: fix fw_cfg.h for multiboot.bin, add proper fw_cfg.h declarations,
          quiet fprintf() in fw_cfg.c

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

14 years agofw_cfg: make calls typesafe
Gerd Hoffmann [Fri, 18 Dec 2009 11:01:09 +0000 (12:01 +0100)]
fw_cfg: make calls typesafe

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

14 years agopci romfiles: add property, add default to PCIDeviceInfo
Gerd Hoffmann [Fri, 18 Dec 2009 11:01:08 +0000 (12:01 +0100)]
pci romfiles: add property, add default to PCIDeviceInfo

This patch adds a romfile property to the pci bus.  It allows to specify
a romfile to load into the rom bar of the pci device.  The default value
comes from a new field in PCIDeviceInfo.  The property allows to change
the file and also to disable the rom loading using an empty string.

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

14 years agoSupport PCI based option rom loading
Anthony Liguori [Fri, 18 Dec 2009 11:01:07 +0000 (12:01 +0100)]
Support PCI based option rom loading

Currently, we preload option roms into the option rom space in memory.  This
prevents DDIM from functioning correctly which severely limits the number
of roms we can support.

This patch introduces a pci_add_option_rom() which registers the
PCI_ROM_ADDRESS bar which points to our option rom.  It also converts over
the cirrus vga adapter, the rtl8139, virtio, and the e1000 to use this
new mechanism.

The result is that PXE boot functions even with three unique types of cards.

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

14 years agoFix backcompat for hotplug of SCSI controllers
Daniel P. Berrange [Mon, 7 Dec 2009 20:51:49 +0000 (20:51 +0000)]
Fix backcompat for hotplug of SCSI controllers

SCSI controllers have no trouble existing without any attached
disks. This could be achieved with the (legacy) monitor syntax

  pci_add pci_addr=auto storage if=scsi

This is now denied with

  scsi requires a backing file/device.
  failed to add if=scsi

There is no need for this denial and it breaks compatability
with existing QEMU usage, so remove the check for presence
of a drive.

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

14 years agofdc: fix migration from 0.11
Juan Quintela [Tue, 15 Dec 2009 13:34:35 +0000 (14:34 +0100)]
fdc: fix migration from 0.11

0.11 uses as instance ide io_base, get it back

Signed-off-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
(cherry picked from commit 47f5ba724871622c7db7a73fd05d6b3646478dd6)

14 years agoRevert "fdc: fix vmstate variable passed"
Juan Quintela [Tue, 15 Dec 2009 13:34:34 +0000 (14:34 +0100)]
Revert "fdc: fix vmstate variable passed"

Floppy used the io_base address to register savevm region.

This reverts commit 2966b390d0f7cd5e5b971290fcc20685de374228.

Signed-off-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
(cherry picked from commit aef30c3c6a3165178584eb125f64defd8173eebd)

14 years agomonitor: Accept input only byte-wise
Jan Kiszka [Fri, 4 Dec 2009 13:05:29 +0000 (14:05 +0100)]
monitor: Accept input only byte-wise

This allows to suspend command interpretation and execution
synchronously, e.g. during migration.

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

14 years agoRevert "kvm: x86: Save/restore exception_index"
Anthony Liguori [Fri, 18 Dec 2009 14:16:30 +0000 (08:16 -0600)]
Revert "kvm: x86: Save/restore exception_index"

This reverts commit ebbc8a3d8e76d0402f8a08c10c0f32e24715d41d.

As suggested by Jan Kiszka,

  "It was obsoleted by d1793b836f8f123b961c613de1bb1c0c185c84cc and now
   saves/restores a useless field."

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

14 years agovmware: increase cursor buffer size.
Dave Airlie [Thu, 17 Dec 2009 22:08:11 +0000 (08:08 +1000)]
vmware: increase cursor buffer size.

The cursor pixmap size we calculate later ends up being 4096 dwords
long by the looks of it. This boots an F12 LiveCD now.

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

14 years agoVMware VGA: Only enable dirty log tracking when fifo is disabled
Anthony Liguori [Thu, 17 Dec 2009 22:08:10 +0000 (08:08 +1000)]
VMware VGA: Only enable dirty log tracking when fifo is disabled

This patch enables dirty log tracking whenever it's needed and disables it
when it is not.

We unconditionally enable dirty log tracking on reset, restart dirty log
tracking when PCI IO regions are remapped, and disable/enable it based on
commands from the guest.

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

14 years agoFix VMware VGA depth computation
Anthony Liguori [Thu, 17 Dec 2009 22:08:09 +0000 (08:08 +1000)]
Fix VMware VGA depth computation

VMware VGA requires that the depth presented to the guest is the same as the
DisplaySurface that it renders to.  This is because it performs a very simple
memcpy() to blit from one surface to another.

We currently hardcode a 24-bit depth.  The surface allocator for SDL may, and
usually will, allocate a surface with a different depth causing screen
corruption.

This changes the code to allocate the DisplaySurface before initializing the
device which allows the depth of the DisplaySurface to be used instead of
hardcoding something.

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

14 years agoMake sure to enable dirty log tracking for VMware VGA
Anthony Liguori [Thu, 17 Dec 2009 22:08:08 +0000 (08:08 +1000)]
Make sure to enable dirty log tracking for VMware VGA

This is needed for VMware VGA to work properly under KVM.

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

14 years agoMake sure to enable dirty tracking of VBE vram mapping
Anthony Liguori [Thu, 17 Dec 2009 22:08:07 +0000 (08:08 +1000)]
Make sure to enable dirty tracking of VBE vram mapping

Apparently, VBE maps the VGA vram to a fixed physical location.  KVM requires
that all mappings of the VGA vram have dirty tracking enabled on them.  Any
access to the VGA vram through the VBE mapping currently fails to result in
dirty page tracking updates causing a black screen.

This is the true root cause of VMware VGA not working correctly under KVM and
likely also an issue with some of the std-vga black screen issues too.

Cirrus does not enable VBE so it would not be a problem when using Cirrus.

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

14 years agovmware: setup PCI BAR 2 for FIFO as per vmware spec
Dave Airlie [Thu, 17 Dec 2009 22:08:06 +0000 (08:08 +1000)]
vmware: setup PCI BAR 2 for FIFO as per vmware spec

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

14 years agoqdev: improve property error reporting.
Gerd Hoffmann [Wed, 16 Dec 2009 13:22:11 +0000 (14:22 +0100)]
qdev: improve property error reporting.

Add a error message in case we fail to parse a qdev property.

Also make qemu not abort() in case setting a global property can't be
set.  This used to be a clear programming error.  The introduction of
the -global switch changed that though, so better exit instead (after
printing the new error message).

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

14 years agofix vga names in default_list
Gerd Hoffmann [Wed, 16 Dec 2009 12:35:19 +0000 (13:35 +0100)]
fix vga names in default_list

Fix mismerge between 64465297 and 556cd098.

Cc: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
(cherry picked from commit 69fd02eea61e6d9e7cd7831ef26522a5ac9e146c)

14 years agousb-host: check mon before using it.
Gerd Hoffmann [Tue, 15 Dec 2009 10:43:02 +0000 (11:43 +0100)]
usb-host: check mon before using it.

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

14 years agousb-net: use qdev for -usbdevice
Gerd Hoffmann [Tue, 15 Dec 2009 09:20:57 +0000 (10:20 +0100)]
usb-net: use qdev for -usbdevice

Rebased to master, adapted to device renaming by armbru,
no other changes.

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

14 years agoCheck rom_load_all() return value.
Gerd Hoffmann [Mon, 14 Dec 2009 15:07:35 +0000 (16:07 +0100)]
Check rom_load_all() return value.

Check rom_load_all() return value.
Also don't make option rom loading failure fatal.

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

14 years agodefaults: update device_list[]
Gerd Hoffmann [Wed, 16 Dec 2009 13:25:40 +0000 (14:25 +0100)]
defaults: update device_list[]

Add isa-fdc (disables default_floppy).
Add ide-drive (disables default_cdrom).

Also walk the -global QemuOpts, so we'll catch
-global isa-fdc.drive{A,B}=<name> too.

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

14 years agodefaults: split default_drive
Gerd Hoffmann [Wed, 16 Dec 2009 13:25:39 +0000 (14:25 +0100)]
defaults: split default_drive

Split default_drive into default_{floppy,cdrom,sdcard}.
Also add QEMUMachine flags to disable them per machine.

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

14 years agomonitor: Catch printing to non-existent monitor
Luiz Capitulino [Mon, 14 Dec 2009 20:53:24 +0000 (18:53 -0200)]
monitor: Catch printing to non-existent monitor

The monitor_vprintf() function now touches the 'mon' pointer
before calling monitor_puts(), this causes block migration
to segfault as its functions call monitor_printf() with a
NULL 'mon'.

To fix the problem this commit moves the 'mon' NULL check
from monitor_puts() to monitor_vprintf().

This can potentially hide bugs, but for some reason this has
been the behavior for a long time.

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

14 years agomonitor: Avoid readline functions in QMP
Luiz Capitulino [Mon, 14 Dec 2009 20:53:23 +0000 (18:53 -0200)]
monitor: Avoid readline functions in QMP

The monitor_read_command() function is readline specific
and should only be used when readline is available.

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

14 years agomonitor: do_balloon(): Check for errors
Luiz Capitulino [Mon, 14 Dec 2009 20:53:22 +0000 (18:53 -0200)]
monitor: do_balloon(): Check for errors

do_balloon() should check for ballooning availability as
do_info_balloon() does.

Noted by Daniel P. Berrange <berrange@redhat.com>.

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

14 years agomonitor: Use 'device' in eject
Luiz Capitulino [Mon, 14 Dec 2009 20:53:21 +0000 (18:53 -0200)]
monitor: Use 'device' in eject

Monitor's eject command uses 'filename' for the device name
argument, but 'device' is a better name.

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

14 years agoQDict: Fix size update
Luiz Capitulino [Mon, 14 Dec 2009 20:53:20 +0000 (18:53 -0200)]
QDict: Fix size update

Key replacement should not update the dictionary's size.

This commit also adds a test for the bug.

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

14 years agoqdev: Improve uni-north device names
Markus Armbruster [Mon, 14 Dec 2009 09:41:21 +0000 (10:41 +0100)]
qdev: Improve uni-north device names

Switch to the names suggested by Blue Swirl.

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

14 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)

14 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)

14 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)

14 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)

14 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)

14 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)

14 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)

14 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)

14 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)

14 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)

14 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)

14 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)

14 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)

14 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)

14 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)

14 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>
14 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)

14 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)

14 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)

14 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)

14 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)

14 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>
14 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>
14 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>
14 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)

14 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)

14 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)

14 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)

14 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)

14 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)

14 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)

14 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)

14 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)

14 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)

14 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)

14 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)

14 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)

14 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)

14 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)

14 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)

14 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)

14 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)

14 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)

14 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)

14 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)

14 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)

14 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)

14 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)

14 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)

14 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)

14 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)

14 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)

14 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)

14 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)

14 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)

14 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)

14 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)

14 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)