]> git.proxmox.com Git - qemu.git/log
qemu.git
14 years agoFix qtypes' licenses
Luiz Capitulino [Wed, 12 May 2010 19:34:42 +0000 (16:34 -0300)]
Fix qtypes' licenses

- Change from GPL to LGPL
- Add license text when missing
- Minor cosmetic changes to make all headers look the same

Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
14 years agoMonitor: Return before exiting with 'quit'
Luiz Capitulino [Tue, 11 May 2010 21:08:20 +0000 (18:08 -0300)]
Monitor: Return before exiting with 'quit'

This is a new version of the (now reverted) following commit:

0e8d2b5575938b8876a3c4bb66ee13c5d306fb6d

The 'quit' Monitor command (implemented by do_quit()) calls
exit() directly, this is problematic under QMP because QEMU
exits before having a chance to send the ok response.

Clients don't know if QEMU exited because of a problem or
because the 'quit' command has been executed.

This commit fixes that by making do_quit() use
qemu_system_shutdown_request(), so that we exit gracefully.

Thanks to Paolo Bonzini <pbonzini@redhat.com> for suggesting
this solution.

Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
14 years agosysemu: Export 'no_shutdown'
Luiz Capitulino [Tue, 11 May 2010 21:07:04 +0000 (18:07 -0300)]
sysemu: Export 'no_shutdown'

It's a global variable already, do_quit() will use it.

Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
14 years agoRevert "Monitor: Return before exiting with 'quit'"
Luiz Capitulino [Tue, 11 May 2010 20:50:50 +0000 (17:50 -0300)]
Revert "Monitor: Return before exiting with 'quit'"

This reverts commit 0e8d2b5575938b8876a3c4bb66ee13c5d306fb6d.

Next commits will do the same thing in a better way.

Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
14 years agoRevert "monitor: Convert do_pci_device_hot_remove() to QObject"
Markus Armbruster [Wed, 12 May 2010 08:53:01 +0000 (10:53 +0200)]
Revert "monitor: Convert do_pci_device_hot_remove() to QObject"

We don't want pci_del in QMP.  Use device_del instead.

This reverts commit 6848d827162fea039f2658414a4adb6164a4f9b0.

Conflicts:

hw/pci-hotplug.c
sysemu.h

Signed-off-by: Markus Armbruster <armbru@redhat.com>
14 years agoRevert "PCI: Convert pci_device_hot_add() to QObject"
Markus Armbruster [Wed, 12 May 2010 08:53:00 +0000 (10:53 +0200)]
Revert "PCI: Convert pci_device_hot_add() to QObject"

Short story: We don't want pci_add in QMP.  Long story follows.

pci_add can do two things:

* Hot plug a PCI NIC.  device_add is more general.

* Hot plug a PCI disk controller, and a drive connected to it.

  The controller is either virtio-blk-pci (if=virtio) or lsi53c895a
  (if=scsi).  With the latter, the drive is optional.  Use drive_add to
  hotplug additional SCSI drives.  Except drive_add is not available in
  QMP.

  device_add is more general for controllers and the guest part of
  drives.  I'm working on a more general alternative for the host part
  of drives.

Why am I proposing to remove pci_add from QMP before its replacement is
ready?  I want it out sooner rather than later, because it isn't fully
functional (errors and drive_add are missing), and we do not plan to
complete the job.  In other words, it's not really usable over QMP now,
and it's not what we want for QMP anyway.  Since we don't want it to be
used over QMP, we should take it out, not leave it around as a trap for
the uninitiated.

Dan Berrange confirmed that libvirt has no need for pci_add & friends
over QMP.

This reverts commit 7a344f7ac7bb651d0556a933ed8060d3a9e5d949.

Conflicts:

hw/pci-hotplug.c
sysemu.h

Signed-off-by: Markus Armbruster <armbru@redhat.com>
14 years agoQMP: Add "Downstream extension of QMP" to spec
Markus Armbruster [Mon, 10 May 2010 07:16:05 +0000 (09:16 +0200)]
QMP: Add "Downstream extension of QMP" to spec

Signed-off-by: Markus Armbruster <armbru@redhat.com>
14 years agomicroblaze: Update elf machine nums.
Edgar E. Iglesias [Wed, 19 May 2010 13:24:17 +0000 (15:24 +0200)]
microblaze: Update elf machine nums.

189 was allocated in upstream binutils.

0xbaab was the old temporary value. Still used by some tools and the
linux kernel.

I've seen 115 in older gdb versions, but lets ignore that one.

Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
14 years agomicroblaze: Add linux-user core dumping support.
Edgar E. Iglesias [Wed, 19 May 2010 13:09:28 +0000 (15:09 +0200)]
microblaze: Add linux-user core dumping support.

Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
14 years agotcg-i386: Tidy initialization of tcg_target_call_clobber_regs.
Richard Henderson [Tue, 13 Apr 2010 22:26:17 +0000 (15:26 -0700)]
tcg-i386: Tidy initialization of tcg_target_call_clobber_regs.

Setting the registers one by one is easier to read, and gets
optimized by the compiler just the same.

Signed-off-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
14 years agotcg-i386: Allocate call-saved registers first.
Richard Henderson [Tue, 13 Apr 2010 22:23:53 +0000 (15:23 -0700)]
tcg-i386: Allocate call-saved registers first.

Signed-off-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
14 years agoFix cross compilation
Stefan Weil [Sun, 11 Apr 2010 16:44:18 +0000 (18:44 +0200)]
Fix cross compilation

This patch enhances the algorithm which finds the correct settings for SDL.
For cross compilations (when cross_prefix is set), it looks for sdl-config
with cross prefix. Here is the complete search order:

$(cross_prefix}pkg-config              (old, only used for cross compilation)
${cross_prefix}sdl_config              (new, only used for cross compilation)
pkg-config                             (old, needs PATH)
sdl-config                             (old, needs PATH)

Cross SDL packages (or the user) now can simply set a link (for example
/usr/bin/i586-mingw32msvc-sdl-config -> /usr/i586-mingw32msvc/bin/sdl-config)
which allows cross compilations without PATH modifications.

Without the patch, configure and make (which calls configure) typically
need a non-standard PATH. Failing to set this special PATH results in
broken builds.

Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
14 years agotarget-s390: enable SIGP Initial Reset
Alexander Graf [Fri, 14 May 2010 14:14:31 +0000 (16:14 +0200)]
target-s390: enable SIGP Initial Reset

For SMP to work with KVM, we need to properly emulate the SIGP Initial Reset
Command. Recent (2.6.32) kernels issue that before the SIGP Reset command that
actually wakes up the vcpu.

This patch makes -smp work on S390x.

Signed-off-by: Alexander Graf <agraf@suse.de>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
14 years agotarget-ppc: remove dead code
Thomas Monjalon [Wed, 21 Apr 2010 09:48:11 +0000 (11:48 +0200)]
target-ppc: remove dead code

This function had been disabled from the beginning:
see 9fddaa0c0cabb610947146a79b4a9a38b0a216e5

cpu_reset() function is in target-ppc/helper.c

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: Alexander Graf <agraf@suse.de>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
14 years agotarget-s390: add firmware code
Alexander Graf [Tue, 20 Apr 2010 17:37:13 +0000 (19:37 +0200)]
target-s390: add firmware code

This patch adds a firmware blob to the S390 target. The blob is a simple
implementation of a virtio client that tries to read the second stage
bootloader from sectors described as of offset 0x20 in the MBR.

In combination with an updated zipl this allows for booting from virtio
block devices. This firmware is built from the same sources as the second
stage bootloader. You can find a virtio capable s390-tools in this repo:

git://repo.or.cz/s390-tools.git

Signed-off-by: Alexander Graf <agraf@suse.de>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
14 years agoPPC/KVM: make iothread work
Alexander Graf [Sun, 18 Apr 2010 21:10:17 +0000 (23:10 +0200)]
PPC/KVM: make iothread work

When running with --enable-io-thread the timer we have doesn't help,
because it doesn't wake up the CPU thread. So instead we need to
actually kick it.

While at it I refined the logic a bit to not dumbly trigger a timer
every 500ms, but rather do it more often after an interrupt got injected.
If there's no level based interrupt to be expected, we don't need the
timer anyways.

This makes qemu-system-ppc with --enable-io-thread work when using KVM.

Signed-off-by: Alexander Graf <agraf@suse.de>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
14 years agofix chardev_init for win32
TeLeMan [Thu, 15 Apr 2010 04:37:55 +0000 (12:37 +0800)]
fix chardev_init for win32

chardev_init functions use socket,so socket_init() shoud be placed at
the front of chardev_init on win32.

Signed-off-by: TeLeMan <geleman@gmail.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
14 years agoqemu-sockets: avoid strlen of NULL pointer
Jens Osterkamp [Mon, 12 Apr 2010 08:51:01 +0000 (10:51 +0200)]
qemu-sockets: avoid strlen of NULL pointer

If the user wants to create a chardev of type socket but forgets to give a
host= option, qemu_opt_get returns NULL. This NULL pointer is then fed into
strlen a few lines below without a check which results in a segfault.
This fixes it.

Signed-off-by: Jens Osterkamp <jens@linux.vnet.ibm.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
14 years agolinux-user: rlimit conversion between host and target.
takasi-y@ops.dti.ne.jp [Sun, 11 Apr 2010 19:07:35 +0000 (04:07 +0900)]
linux-user: rlimit conversion between host and target.

rlim_t conversion between host and target added.
Otherwise there are some incorrect case like
- RLIM_INFINITY on 32bit target -> 64bit host.
- RLIM_INFINITY on 64bit host -> mips and sparc target ?
- Big value(for 32bit target) on 64bit host -> 32bit target.

One is added into getrlimit, setrlimit, and ugetrlimit. It converts both
RLIM_INFINITY and value bigger than target can hold(>31bit) to RLIM_INFINITY.

Another one is added to guest_stack_size calculation introduced by
703e0e89. The rule is mostly same except the result on the case is keeping
the value of guest_stack_size.

Slightly tested for SH4, and x86_64 -linux-user on x86_64-pc-linux host.

Signed-off-by: Takashi YOSHII <takasi-y@ops.dti.ne.jp>
Acked-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
14 years agoCompile acpi_piix4, apm and pm_smbus only once
Blue Swirl [Mon, 17 May 2010 19:32:37 +0000 (19:32 +0000)]
Compile acpi_piix4, apm and pm_smbus only once

12 compilations less for the full build.

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
14 years agoMerge remote branch 'kwolf/for-anthony' into staging
Anthony Liguori [Mon, 17 May 2010 18:17:34 +0000 (13:17 -0500)]
Merge remote branch 'kwolf/for-anthony' into staging

14 years agoMerge remote branch 'mst/for_anthony' into staging
Anthony Liguori [Mon, 17 May 2010 17:41:39 +0000 (12:41 -0500)]
Merge remote branch 'mst/for_anthony' into staging

14 years agoblock: Remove special case for vvfat
Kevin Wolf [Wed, 12 May 2010 12:03:02 +0000 (14:03 +0200)]
block: Remove special case for vvfat

The special case doesn't really us buy anything. Without it vvfat works more
consistently as a protocol. We get raw on top of vvfat now, which works just
as well as using vvfat directly.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
14 years agoFix docs for block stats monitor command
Daniel P. Berrange [Thu, 13 May 2010 10:30:50 +0000 (06:30 -0400)]
Fix docs for block stats monitor command

The 'parent' field in the 'query-blockstats' monitor command is
part of the top level block device QDict, not part of the 2nd
level 'stats' QDict.

* block.c: Fix docs for 'parent' field in block stats monitor
  command output

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
14 years agouse qemu_free() instead of free()
Bruce Rogers [Thu, 13 May 2010 21:14:33 +0000 (15:14 -0600)]
use qemu_free() instead of free()

There is a call to free() where qemu_free() should instead be used.

Signed-off-by: Bruce Rogers <brogers@novell.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
14 years agoblock/vdi: Fix image opening and creation for odd disk sizes
Stefan Weil [Wed, 12 May 2010 18:25:45 +0000 (20:25 +0200)]
block/vdi: Fix image opening and creation for odd disk sizes

The fix is based on a patch from Kevin Wolf. Here his comment:

"The number of blocks needs to be rounded up to cover all of the virtual hard
disk. Without this fix, we can't even open our own images if their size is not
a multiple of the block size."

While Kevin's patch addressed vdi_create, my modification also fixes
vdi_open which now accepts images with odd disk sizes.

v3:
Don't allow reading of disk images with too large disk sizes.
Neither VBoxManage nor old versions of qemu-img read such images.
This change requires rounding of odd disk sizes before we do the checks.

Cc: Kevin Wolf <kwolf@redhat.com>
Cc: François Revol <revol@free.fr>
Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
14 years agodmg: use qemu block API
Christoph Hellwig [Wed, 12 May 2010 14:31:49 +0000 (16:31 +0200)]
dmg: use qemu block API

Use bdrv_pwrite to access the backing device instead of pread, and
convert the driver to implementing the bdrv_open method which gives
it an already opened BlockDriverState for the underlying device.

Dmg actually does an lseek to a negative offset in the open routine,
which we replace with offset arithmetics after doing a bdrv_getlength.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
14 years agodmg: use pread
Christoph Hellwig [Wed, 12 May 2010 14:31:35 +0000 (16:31 +0200)]
dmg: use pread

Use pread instead of lseek + read in preparation of using the qemu
block API.  Note that dmg actually uses the implicit file offset
a lot in dmg_open, and we had to replace it with an offset variable.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
14 years agodmg: fix reading of uncompressed chunks
Christoph Hellwig [Fri, 7 May 2010 14:55:33 +0000 (16:55 +0200)]
dmg: fix reading of uncompressed chunks

When dmg_read_chunk encounters an uncompressed chunk it currently
calls read without any previous adjustment of the file postion.

This seems very wrong, and the "reference" implementation in
dmg2img does a search to the same offset as done in the various
compression cases, so do the same here.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
14 years agoblock/vpc: Fix conversion from size to disk geometry
Stefan Weil [Mon, 10 May 2010 19:46:26 +0000 (21:46 +0200)]
block/vpc: Fix conversion from size to disk geometry

The VHD algorithm calculates a disk geometry
which is usually smaller than the requested size.

QEMU tried to round up but failed for certain sizes:

qemu-img create -f vpc disk.vpc 9437184
would create an image with 9435136 bytes
(which is too small for qemu-img convert).

Instead of hacking the geometry algorithm, the patch
increases the number of sectors until we get enough
sectors.

Cc: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
14 years agoparallels: use qemu block API
Christoph Hellwig [Thu, 6 May 2010 20:04:50 +0000 (22:04 +0200)]
parallels: use qemu block API

Use bdrv_pwrite to access the backing device instead of pread, and
convert the driver to implementing the bdrv_open method which gives
it an already opened BlockDriverState for the underlying device.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
14 years agoparallels: use pread
Christoph Hellwig [Thu, 6 May 2010 20:04:34 +0000 (22:04 +0200)]
parallels: use pread

Use pread instead of lseek + read in preparation of using the qemu
block API.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
14 years agoblock/vdi: Allow disk images of size 0
Stefan Weil [Thu, 6 May 2010 18:53:47 +0000 (20:53 +0200)]
block/vdi: Allow disk images of size 0

Even it is not very useful, users may create images of size 0.

Without the special option CONFIG_ZERO_MALLOC, qemu_mallocz
aborts execution when it is told to allocate 0 bytes,
so avoid this kind of call.

Cc: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
14 years agoblock: Fix bdrv_commit
Kevin Wolf [Thu, 6 May 2010 14:34:56 +0000 (16:34 +0200)]
block: Fix bdrv_commit

When reopening the image, don't guess the driver, but use the same driver as
was used before. This is important if the format=... option was used for that
image.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
14 years agoblock: Fix protocol detection for Windows devices
Kevin Wolf [Thu, 6 May 2010 11:04:58 +0000 (13:04 +0200)]
block: Fix protocol detection for Windows devices

We can't assume the file protocol for Windows devices, they need the same
detection as other files for which an explicit protocol is not specified.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
14 years agoblock: Avoid unchecked casts for AIOCBs
Kevin Wolf [Wed, 5 May 2010 09:44:39 +0000 (11:44 +0200)]
block: Avoid unchecked casts for AIOCBs

Use container_of for one direction and &acb->common for the other one.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
14 years agobochs: use qemu block API
Christoph Hellwig [Tue, 4 May 2010 10:44:21 +0000 (12:44 +0200)]
bochs: use qemu block API

Use bdrv_pwrite to access the backing device instead of pread, and
convert the driver to implementing the bdrv_open method which gives
it an already opened BlockDriverState for the underlying device.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
14 years agobochs: use pread
Christoph Hellwig [Tue, 4 May 2010 10:44:08 +0000 (12:44 +0200)]
bochs: use pread

Use pread instead of lseek + read in preparation of using the qemu
block API.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
14 years agoide: Fix ide_dma_cancel
Kevin Wolf [Tue, 4 May 2010 14:35:24 +0000 (16:35 +0200)]
ide: Fix ide_dma_cancel

When cancelling a request, bdrv_aio_cancel may decide that it waits for
completion of a request rather than for cancellation. IDE therefore can't
abandon its DMA status before calling bdrv_aio_cancel; otherwise the callback
of a completed request would use invalid data.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
14 years agocloop: use qemu block API
Christoph Hellwig [Tue, 4 May 2010 10:44:52 +0000 (12:44 +0200)]
cloop: use qemu block API

Use bdrv_pwrite to access the backing device instead of pread, and
convert the driver to implementing the bdrv_open method which gives
it an already opened BlockDriverState for the underlying device.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
14 years agocloop: use pread
Christoph Hellwig [Tue, 4 May 2010 10:44:38 +0000 (12:44 +0200)]
cloop: use pread

Use pread instead of lseek + read in preparation of using the qemu
block API.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
14 years agoqemu-nbd: Improve error reporting
Ryota Ozaki [Sun, 2 May 2010 21:50:25 +0000 (06:50 +0900)]
qemu-nbd: Improve error reporting

- use err(3) instead of errx(3) if errno is available
  to report why failed
- let fail prior to daemon(3) if opening a nbd file
  is likely to fail after daemonizing to avoid silent
  failure exit
- add missing 'ret = 1' when unix_socket_outgoing failed

Signed-off-by: Ryota Ozaki <ozaki.ryota@gmail.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
14 years agoblock: Remove semicolon in BDRV_SECTOR_MASK macro
Stefan Hajnoczi [Sat, 1 May 2010 06:23:32 +0000 (07:23 +0100)]
block: Remove semicolon in BDRV_SECTOR_MASK macro

Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
14 years agosparc: move DT and QT defines to op_helper.c
Blue Swirl [Sun, 16 May 2010 08:33:02 +0000 (08:33 +0000)]
sparc: move DT and QT defines to op_helper.c

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
14 years agosparc64: fix TT_WOTHER value
Igor V. Kovalenko [Sun, 16 May 2010 00:11:29 +0000 (04:11 +0400)]
sparc64: fix TT_WOTHER value

- fix off by one error in spill trap number bit for other window (must be bit 5)
- fixes invalid instruction issue with HelenOS

Signed-off-by: Igor V. Kovalenko <igor.v.kovalenko@gmail.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
14 years agosparc64: fix mmu demap operand typo
Igor V. Kovalenko [Sun, 16 May 2010 00:11:24 +0000 (04:11 +0400)]
sparc64: fix mmu demap operand typo

- must use store address operand to demap, not store value

Signed-off-by: Igor V. Kovalenko <igor.v.kovalenko@gmail.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
14 years agoUpdate to a hopefully more future proof FSF address
Blue Swirl [Sat, 15 May 2010 17:52:49 +0000 (17:52 +0000)]
Update to a hopefully more future proof FSF address

See also 70539e1850ddd3a7ee6f9a8db7bd8e81b85225a4,
8167ee883931cb20c6264fc19d040ce2dc6ceaaa,
530e7615ce3c01882e582c84dc6304ab98a3d5c5 and
fad6cb1a565bb73f83fc0e2654489457b489e436.

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
14 years agoTrim unnecessary includes
Blue Swirl [Sat, 15 May 2010 17:36:13 +0000 (17:36 +0000)]
Trim unnecessary includes

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
14 years agomc146818rtc: remove #ifdef DEBUG_CMOS.
Isaku Yamahata [Fri, 14 May 2010 07:29:24 +0000 (16:29 +0900)]
mc146818rtc: remove #ifdef DEBUG_CMOS.

remove #ifdef DEBUG_CMOS by using macro.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Acked-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
14 years agoapm: remove #ifdef DEBUG.
Isaku Yamahata [Fri, 14 May 2010 07:29:23 +0000 (16:29 +0900)]
apm: remove #ifdef DEBUG.

remove #ifdef DEBUG by using macro.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Acked-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
14 years agoacpi_piix4: remove #ifdef DEBUG.
Isaku Yamahata [Fri, 14 May 2010 07:29:22 +0000 (16:29 +0900)]
acpi_piix4: remove #ifdef DEBUG.

removed #ifdef DEBUG by using macro.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Acked-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
14 years agopm_smbus: remove #ifdef DEBUG.
Isaku Yamahata [Fri, 14 May 2010 07:29:21 +0000 (16:29 +0900)]
pm_smbus: remove #ifdef DEBUG.

remove #ifdef DEBUG by using macro.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Acked-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
14 years agopci hotadd, acpi_piix4: remove global variables
Isaku Yamahata [Fri, 14 May 2010 07:29:20 +0000 (16:29 +0900)]
pci hotadd, acpi_piix4: remove global variables

remove global variables, gpe and pci0_status by moving them
into PIIX4PMState.

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Acked-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
14 years agopci hotplug: add argument to pci hot plug callback.
Isaku Yamahata [Fri, 14 May 2010 07:29:19 +0000 (16:29 +0900)]
pci hotplug: add argument to pci hot plug callback.

Add argument, DeviceState*, to pci hot plug callback.
The argument will be used later to remove global variable.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Acked-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
14 years agoacpi_piix4: qdevfy.
Isaku Yamahata [Fri, 14 May 2010 07:29:18 +0000 (16:29 +0900)]
acpi_piix4: qdevfy.

qdevfy acpi_piix4.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Acked-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
14 years agortc: make rtc_xxx accept/return ISADevice instead of RTCState.
Isaku Yamahata [Fri, 14 May 2010 07:29:17 +0000 (16:29 +0900)]
rtc: make rtc_xxx accept/return ISADevice instead of RTCState.

To match rtc_xxx with qdev, make rtc_xxx accept and return ISADevice
instead of RTCState.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Acked-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
14 years agopc: move rtc declarations from pc.h into a dedicated header file.
Isaku Yamahata [Fri, 14 May 2010 07:29:16 +0000 (16:29 +0900)]
pc: move rtc declarations from pc.h into a dedicated header file.

Move rtc_xxx declarations from pc.h into mc146818rtc.h.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Acked-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
14 years agopc: split out piix specific part from pc.c into pc_piix.c
Isaku Yamahata [Fri, 14 May 2010 07:29:15 +0000 (16:29 +0900)]
pc: split out piix specific part from pc.c into pc_piix.c

Finally, we can safely split out the piix specific part from pc.c
into pc_piix.c.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Acked-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
14 years agopc: split out pci device init from pc_init1() into pc_pci_device_init()
Isaku Yamahata [Fri, 14 May 2010 07:29:14 +0000 (16:29 +0900)]
pc: split out pci device init from pc_init1() into pc_pci_device_init()

Split out pci device initialization from pc_init1() into pc_pci_device_init().
and removed unnecessary braces.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Acked-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
14 years agopc: split out basic device init from pc_init1() into pc_basic_device_init()
Isaku Yamahata [Fri, 14 May 2010 07:29:13 +0000 (16:29 +0900)]
pc: split out basic device init from pc_init1() into pc_basic_device_init()

Split out basic device, i.e. legacy devices like floppy, initialization
from pc_init1() into pc_basic_device_init().
Later it will be used.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Acked-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
14 years agopc: split out vga initialization from pc_init1() into pc_vga_init().
Isaku Yamahata [Fri, 14 May 2010 07:29:12 +0000 (16:29 +0900)]
pc: split out vga initialization from pc_init1() into pc_vga_init().

Split out vga initialization which is independent of piix
from pc_init1() as pc_vga_init().
Later it will be used.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Acked-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
14 years agopc: split out memory allocation from pc_init1() into pc_memory_init()
Isaku Yamahata [Fri, 14 May 2010 07:29:11 +0000 (16:29 +0900)]
pc: split out memory allocation from pc_init1() into pc_memory_init()

Split out memory allocation and rom/bios loading which doesn't depend
on piix from pc_init1() into pc_memory_init().
Later it will be used.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Acked-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
14 years agopc: split out cpu initialization from pc_init1() into pc_cpus_init().
Isaku Yamahata [Fri, 14 May 2010 07:29:10 +0000 (16:29 +0900)]
pc: split out cpu initialization from pc_init1() into pc_cpus_init().

split out cpu initialization which is piix independent from pc_init1()
into pc_cpus_init(). Later it will be used.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Acked-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
14 years agopc: make pc_init1() not refer ferr_irq directly.
Isaku Yamahata [Fri, 14 May 2010 07:29:09 +0000 (16:29 +0900)]
pc: make pc_init1() not refer ferr_irq directly.

By introducing a registering function, make pc_init1() not refer to
ferr_irq directly in order to make ferr_irq piix independent.
Later pc_init1() will be split out into another file keeping ferr_irq
static.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Acked-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
14 years agopc: introduce a function to allocate cpu irq.
Isaku Yamahata [Fri, 14 May 2010 07:29:08 +0000 (16:29 +0900)]
pc: introduce a function to allocate cpu irq.

Introduce a function, pc_allocate_cpu_irq(), to allocate cpu irq
in order to make pic_irq_request() piix independent.
Later piix code will be split out to another file keeping pic_irq_request()
static.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Acked-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
14 years agopc: remove global variable rtc_state by using qemu_irq.
Isaku Yamahata [Fri, 14 May 2010 07:29:07 +0000 (16:29 +0900)]
pc: remove global variable rtc_state by using qemu_irq.

Remove the reference to the global variable, rtc_state, by passing
function argument to cmos_init_hd(), cmos_init().

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Cc: Paolo Bonzini <bonzini@gnu.org>
Acked-by: Gerd Hoffmann <kraxel@redhat.com>
Cc: Blue Swirl <blauwirbel@gmail.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
14 years agopc: remove a global variable, floppy_controller.
Isaku Yamahata [Fri, 14 May 2010 07:29:06 +0000 (16:29 +0900)]
pc: remove a global variable, floppy_controller.

Remove a global variable, floppy_controller.
Since it is unnecessarily global, make it local and pass it as
a function argument.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Acked-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
14 years agopc: make an unnecessary global variable, pit, local.
Isaku Yamahata [Fri, 14 May 2010 07:29:05 +0000 (16:29 +0900)]
pc: make an unnecessary global variable, pit, local.

remove unnecessary global static variables, pit.
Make it local.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Acked-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
14 years agopc, i440fx: Make smm enable/disable function i440fx independent.
Isaku Yamahata [Fri, 14 May 2010 07:29:04 +0000 (16:29 +0900)]
pc, i440fx: Make smm enable/disable function i440fx independent.

make cpu_smm_update() generic to be independent on i440fx by
registering a callback.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Acked-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
14 years agopc: initialize ioapic before use.
Isaku Yamahata [Fri, 14 May 2010 07:29:03 +0000 (16:29 +0900)]
pc: initialize ioapic before use.

The changeset of 2c8d9340203c7f19265fd4cb2341f568217a3af6
prevents isa_irq_handler() from NULL refering of IsaIrqState::ioapic.
However it would be better to initialize the member before reference.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Acked-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
14 years agoacpi: split acpi.c into the common part and the piix4 part.
Isaku Yamahata [Fri, 14 May 2010 07:29:02 +0000 (16:29 +0900)]
acpi: split acpi.c into the common part and the piix4 part.

Split acpi.c into the common part and the piix4 specific part.
The common part will be used later.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Acked-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
14 years agoacpi: add acpi constants from linux header files and use them.
Isaku Yamahata [Fri, 14 May 2010 07:29:01 +0000 (16:29 +0900)]
acpi: add acpi constants from linux header files and use them.

add acpi constants from linux header files and
replace the old constants with them.
The acpi constants will be used by other file.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Acked-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
14 years agoacpi: split out apm register emulation from acpi.c
Isaku Yamahata [Fri, 14 May 2010 07:29:00 +0000 (16:29 +0900)]
acpi: split out apm register emulation from acpi.c

Split out apm register emulation for acpi.c into apm.c.
The apm emulation will be used later.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Acked-by: Gerd Hoffmann <kraxel@redhat.com>
Cc: Aurelien Jarno <aurelien@aurel32.net>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
14 years agoacpi: split out piix4 smbus routines from acpi.c into pm_smbus.c
Isaku Yamahata [Fri, 14 May 2010 07:28:59 +0000 (16:28 +0900)]
acpi: split out piix4 smbus routines from acpi.c into pm_smbus.c

Split out piix4 smbus routines from acpi.c into pm_smbus.c and
use it.
The split out smbus emulation will be used later.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Acked-by: Gerd Hoffmann <kraxel@redhat.com>
Cc: Aurelien Jarno <aurelien@aurel32.net>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
14 years agomc146818rtc: Register vmstate via qdev
Jan Kiszka [Sat, 15 May 2010 11:32:43 +0000 (13:32 +0200)]
mc146818rtc: Register vmstate via qdev

After defining the required alias ID, we can push vmstate registration
of mc146818rtc to qdev.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
14 years agofdc: Register vmstate via qdev
Jan Kiszka [Sat, 15 May 2010 11:32:42 +0000 (13:32 +0200)]
fdc: Register vmstate via qdev

Establish vmstate containers for ISA and sysbus variant, define the
iobase as instance ID alias, and let qdev do the vmstate registration
work.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
14 years agoserial: Register vmstate via qdev
Jan Kiszka [Sat, 15 May 2010 11:32:41 +0000 (13:32 +0200)]
serial: Register vmstate via qdev

At least for isa-serial, we can already let qdev do the vmstate
registration for us. It just takes wrapping vmstate for the
encapsulating ISASerialState and defining the proper instance ID
aliases.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
14 years agovmstate: Add support for alias ID
Jan Kiszka [Sat, 15 May 2010 11:32:40 +0000 (13:32 +0200)]
vmstate: Add support for alias ID

Some legacy users (mostly PC devices) of vmstate_register manage
instance IDs on their own, and that unfortunately in a way that is
incompatible with automatically generated ones. This so far prevents
switching those users to vmstates that are registered by qdev.

To establish a migration path, this patch introduces the concept of
alias IDs. They can be passed to an extended vmstate registration
service, and qdev provides a set service to be used during device init.
find_se will consider the alias in addition to the default ID. We can
then start generating the default ID automatically and writing it on
vmsave, thus converting that format without breaking support for upward
migration.

The user is required specify the highest vmstate version for which the
alias is required. Once this version falls behind the minimum required
for a specific vmstate, an assertion triggers to motivate cleaning up
the obsolete alias.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
14 years agovmstate: Drop unused post_save handler
Jan Kiszka [Sat, 15 May 2010 11:32:39 +0000 (13:32 +0200)]
vmstate: Drop unused post_save handler

No device makes use of it anymore.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
14 years agosh: sm501: add 2D engine support
Shin-ichiro KAWASAKI [Sat, 15 May 2010 12:25:39 +0000 (21:25 +0900)]
sh: sm501: add 2D engine support

In linux kernel v2.6.33, sm501 frame buffer driver modified to support
2D graphics engine on sm501 chip.  One example is "fill rectangle" operation.
But current qemu's sm501 emulation doesn't support it.  This results in
graphics console disturbance.

This patch introduces sm501 2D graphics engine emulation and solve this problem.

    Add SM501 2D hardware engine support.

     - Add 2D engine register set read/write handlers.
     - Support 'fill rectangle'. Other operations are left for future work.
     - Update SM501 support status comment.

Signed-off-by: Shin-ichiro KAWASAKI <kawasaki@juno.dti.ne.jp>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
14 years agotmp105: update the register in post_load where it needs updating.
Andrzej Zaborowski [Sat, 15 May 2010 12:31:27 +0000 (14:31 +0200)]
tmp105: update the register in post_load where it needs updating.

This was the only user of .post_save as noticed by Jan Kiszka and
seems to have been added there wrongly during conversion to
VMStateDescription.

Signed-off-by: Andrzej Zaborowski <balrogg@gmail.com>
14 years agocpus: add one 'const'
Blue Swirl [Fri, 14 May 2010 19:32:21 +0000 (19:32 +0000)]
cpus: add one 'const'

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
14 years agoe1000: make some tables 'const'
Blue Swirl [Fri, 14 May 2010 19:32:18 +0000 (19:32 +0000)]
e1000: make some tables 'const'

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
14 years agoide: make a table 'const'
Blue Swirl [Fri, 14 May 2010 19:32:14 +0000 (19:32 +0000)]
ide: make a table 'const'

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
14 years agovga: make some tables 'const'
Blue Swirl [Fri, 14 May 2010 19:32:11 +0000 (19:32 +0000)]
vga: make some tables 'const'

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
14 years agoCompile virtio-9p-debug and virtio-9p-local once
Blue Swirl [Fri, 14 May 2010 19:31:53 +0000 (19:31 +0000)]
Compile virtio-9p-debug and virtio-9p-local once

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
14 years agoMerge remote branch 'qemu-kvm/uq/master' into staging
Anthony Liguori [Fri, 14 May 2010 15:56:56 +0000 (10:56 -0500)]
Merge remote branch 'qemu-kvm/uq/master' into staging

14 years agoUpdate SeaBIOS
Anthony Liguori [Tue, 11 May 2010 12:56:30 +0000 (07:56 -0500)]
Update SeaBIOS

 - 7d09d0e Fix virtio compile errors on various gcc versions.
 - 89acfa3 Support for booting from virtio disks
 - 6d66316 smbios: avoid counting io hole as ram
 - e5cd945 Fix error causing USB HID "boot" protocol to not be enabled.
 - 0e88576 Add support for USB mice.
 - dd5a8a6 When USB keyboard active, don't send keyboard commands to ps2 port.
 - 5718d56 Document usb-hid.c functions.
 - e438b0c Further parallelize init when using CONFIG_THREAD_OPTIONROMS.
 - f59b5ac Handle unknown function addresses in tools/checkstack.py.
 - 9ba1dea Simplify build by manually resolving external symbols in layoutrom.py.
 - 698d3f9 USB EHCI should yield() whil waiting for controller to ack reset.
 - f9a774c Add __attribute__((__malloc__)) declaration to internal malloc funcs.
 - b7045ce Minor - remove redundant check from ata_try_dma.
 - 67f6d37 Fix possible unitialized variable issue in usb msc.
 - a7eb8fc Some improvements to optionrom preemption support.
 - d28b0fe Refactor USB hub code.
 - ba28541 Prep version for next release.
 - 12bffd5 Update version to 0.6.0.
 - 87ab2fb Improve USB EHCI timing.
 - d705e5a Disable inlining on old compilers.
 - bca0736 Force use of indirect function calls in inline assembler.
 - d7eb27e Don't move EBDA while an optionrom is running (CONFIG_THREAD_OPTIONROMS).
 - 7415270 Call to int1552 (from int1346) should set regs->dl.
 - 9dc243e Adjust debug levels of device discovery.
 - d9c9361 Default CONFIG_COREBOOT_FLASH on; make depend on CONFIG_COREBOOT.
 - c35e1e5 Restore segment limits in handle_1589 code.
 - 11cc662 Extend time for rtc to be ready.
 - 4ed378a Backup and restore registers when calling out to user funcs.
 - 68c5139 Enable irqs in kbd/clock calls that caller might "spin" on.
 - f628244 Process event on ps2 keyboard irq even if event already read.
 - a5d8458 Revert "Unify ps2 port data processing."
 - b9ed5e2 Handle variable length return of ps2 port GETID command.
 - 67a9eec Prevent ps2 irqs from messing up ps2 init.
 - 6704cf9 Revert "Rework disabling of ps2 port irqs."
 - 808939c Fix smp cpu detect on gcc 4.5.
 - a979c1c Improvements to tools/checkstack.py.
 - 190cc62 Add USB EHCI controller support.
 - 0770d67 Some USB UHCI and OHCI fixes and cleanups.
 - bfe7ca7 Minor - USB OHCI interrupt queue should be one larger.
 - 09e2f7c Reduce size of USB 'struct uhci_td'.
 - 406fad6 Dynamically allocate USB controller structures.
 - 4547eb9 Replace USB encoded 'u32 endp' scheme with explicit struct fields.
 - 8ebcac0 Further parallelize USB init by launching a thread per usb port.
 - e908665 Introduce simple "mutex" locking code.
 - 3b79f8b Only compile usb-hub.c and paravirt.c with 32bit code.
 - 357bdfa Prefer passing a USB "pipe" structure over a USB endp encoding.
 - 7fb8ba8 Add a generic "internal error" warning function.

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
14 years agopckbd: don't use any static state
Blue Swirl [Wed, 12 May 2010 19:27:23 +0000 (19:27 +0000)]
pckbd: don't use any static state

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
14 years agoapb: don't use any static state
Blue Swirl [Wed, 12 May 2010 19:27:23 +0000 (19:27 +0000)]
apb: don't use any static state

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
14 years agotarget-sparc: Fix wrong printf argument
Stefan Weil [Wed, 12 May 2010 18:34:39 +0000 (20:34 +0200)]
target-sparc: Fix wrong printf argument

cpu_get_ccr() returns a target_ulong, so a type cast is needed to avoid
wrong output on big endian hosts. We could also use TARGET_FMT_lx,
but that would print 8 instead of 2 digits.

Cc: Blue Swirl <blauwirbel@gmail.com>
Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
14 years agoUpdate OpenBIOS images to r771
Blue Swirl [Wed, 12 May 2010 18:57:14 +0000 (18:57 +0000)]
Update OpenBIOS images to r771

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
14 years agovirtio-net: return with value in void function
Michael S. Tsirkin [Sun, 9 May 2010 11:35:43 +0000 (14:35 +0300)]
virtio-net: return with value in void function

virtio-net has return with value in a void function.
No idea why does it compile with gcc,
but this isn't standard C.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
14 years agovirtio: invoke set_features on load
Michael S. Tsirkin [Sun, 9 May 2010 16:42:09 +0000 (19:42 +0300)]
virtio: invoke set_features on load

After migration, vhost was not getting features
acked because set_features callback was never invoked.
The fix is just to invoke that callback.

Reported-by: David L Stevens <dlstevens@us.ibm.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Tested-by: David L Stevens <dlstevens@us.ibm.com>
14 years agopci: irq_state vmstate breakage
Michael S. Tsirkin [Sun, 9 May 2010 16:15:16 +0000 (19:15 +0300)]
pci: irq_state vmstate breakage

Code for saving irq_state got vm_state
macros wrong, passing in the wrong parameter.
As a result, we both saved a wrong value
and restored it to a wrong offset.

This leads to device and bus irq counts getting
out of sync, which in turn leads to interrupts getting lost or
never cleared, such as
https://bugzilla.redhat.com/show_bug.cgi?id=588133

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Acked-by: Juan Quintela <quintela@redhat.com>
14 years agopci: cleanly backout of pci_qdev_init()
Alex Williamson [Tue, 11 May 2010 10:44:21 +0000 (06:44 -0400)]
pci: cleanly backout of pci_qdev_init()

If the init function of a device fails, as might happen with device
assignment, we never undo the work done by do_pci_register_device().
This not only causes a bit of a memory leak, but also leaves a bogus
pointer in the bus devices array that can cause a segfault or
garbage data from 'info pci'.

Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
14 years agokvm: fix 80000001.EDX supported bit filtering
Gleb Natapov [Tue, 11 May 2010 06:41:25 +0000 (09:41 +0300)]
kvm: fix 80000001.EDX supported bit filtering

On AMD some bits from 1.EDX are reported in 80000001.EDX. The mask used
to copy bits from 1.EDX to 80000001.EDX is incorrect resulting in
unsupported features passed into a guest.

Signed-off-by: Gleb Natapov <gleb@redhat.com>
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
14 years agoDo not stop VM if emulation failed in userspace.
Gleb Natapov [Mon, 10 May 2010 08:21:34 +0000 (11:21 +0300)]
Do not stop VM if emulation failed in userspace.

Continue vcpu execution in case emulation failure happened while vcpu
was in userspace. In this case #UD will be injected into the guest
allowing guest OS to kill offending process and continue.

Signed-off-by: Gleb Natapov <gleb@redhat.com>
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
14 years agokvm: enable smp > 1
Marcelo Tosatti [Tue, 4 May 2010 12:45:27 +0000 (09:45 -0300)]
kvm: enable smp > 1

Process INIT/SIPI requests and enable -smp > 1.

Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Signed-off-by: Avi Kivity <avi@redhat.com>
14 years agokvm: validate context for kvm cpu get/put operations
Jan Kiszka [Tue, 4 May 2010 12:45:26 +0000 (09:45 -0300)]
kvm: validate context for kvm cpu get/put operations

Validate that KVM vcpu state is only read/written from cpu thread itself
or that cpu is stopped.

Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Signed-off-by: Avi Kivity <avi@redhat.com>