summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Fix qtypes' licensesLuiz Capitulino2010-05-1919-44/+73
| | | | | | | | - 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>
* Monitor: Return before exiting with 'quit'Luiz Capitulino2010-05-191-1/+4
| | | | | | | | | | | | | | | | | | | | | 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>
* sysemu: Export 'no_shutdown'Luiz Capitulino2010-05-191-0/+1
| | | | | | It's a global variable already, do_quit() will use it. Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
* Revert "Monitor: Return before exiting with 'quit'"Luiz Capitulino2010-05-193-22/+1
| | | | | | | | This reverts commit 0e8d2b5575938b8876a3c4bb66ee13c5d306fb6d. Next commits will do the same thing in a better way. Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
* Revert "monitor: Convert do_pci_device_hot_remove() to QObject"Markus Armbruster2010-05-193-7/+4
| | | | | | | | | | | | | 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>
* Revert "PCI: Convert pci_device_hot_add() to QObject"Markus Armbruster2010-05-193-45/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* QMP: Add "Downstream extension of QMP" to specMarkus Armbruster2010-05-191-0/+55
| | | | Signed-off-by: Markus Armbruster <armbru@redhat.com>
* microblaze: Update elf machine nums.Edgar E. Iglesias2010-05-193-4/+5
| | | | | | | | | | | 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>
* microblaze: Add linux-user core dumping support.Edgar E. Iglesias2010-05-191-0/+18
| | | | Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
* tcg-i386: Tidy initialization of tcg_target_call_clobber_regs.Richard Henderson2010-05-191-5/+6
| | | | | | | | 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>
* tcg-i386: Allocate call-saved registers first.Richard Henderson2010-05-191-3/+3
| | | | | Signed-off-by: Richard Henderson <rth@twiddle.net> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
* Fix cross compilationStefan Weil2010-05-191-1/+11
| | | | | | | | | | | | | | | | | | | | | | 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>
* target-s390: enable SIGP Initial ResetAlexander Graf2010-05-181-3/+14
| | | | | | | | | | | 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>
* target-ppc: remove dead codeThomas Monjalon2010-05-181-10/+0
| | | | | | | | | | | 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>
* target-s390: add firmware codeAlexander Graf2010-05-184-1/+32
| | | | | | | | | | | | | | | 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>
* PPC/KVM: make iothread workAlexander Graf2010-05-181-15/+15
| | | | | | | | | | | | | | | | 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>
* fix chardev_init for win32TeLeMan2010-05-181-2/+2
| | | | | | | | 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>
* qemu-sockets: avoid strlen of NULL pointerJens Osterkamp2010-05-181-1/+2
| | | | | | | | | | 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>
* linux-user: rlimit conversion between host and target.takasi-y@ops.dti.ne.jp2010-05-183-9/+32
| | | | | | | | | | | | | | | | | | | | | 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>
* Compile acpi_piix4, apm and pm_smbus only onceBlue Swirl2010-05-178-3/+9
| | | | | | 12 compilations less for the full build. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* Merge remote branch 'kwolf/for-anthony' into stagingAnthony Liguori2010-05-1713-232/+213
|\
| * block: Remove special case for vvfatKevin Wolf2010-05-171-5/+0
| | | | | | | | | | | | | | | | 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>
| * Fix docs for block stats monitor commandDaniel P. Berrange2010-05-171-12/+11
| | | | | | | | | | | | | | | | | | | | | | | | 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>
| * use qemu_free() instead of free()Bruce Rogers2010-05-171-1/+1
| | | | | | | | | | | | | | 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>
| * block/vdi: Fix image opening and creation for odd disk sizesStefan Weil2010-05-171-7/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * dmg: use qemu block APIChristoph Hellwig2010-05-171-30/+26
| | | | | | | | | | | | | | | | | | | | | | | | 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>
| * dmg: use preadChristoph Hellwig2010-05-171-37/+51
| | | | | | | | | | | | | | | | | | 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>
| * dmg: fix reading of uncompressed chunksChristoph Hellwig2010-05-171-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | 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>
| * block/vpc: Fix conversion from size to disk geometryStefan Weil2010-05-171-9/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * parallels: use qemu block APIChristoph Hellwig2010-05-171-18/+6
| | | | | | | | | | | | | | | | | | 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>
| * parallels: use preadChristoph Hellwig2010-05-171-22/+11
| | | | | | | | | | | | | | | | 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>
| * block/vdi: Allow disk images of size 0Stefan Weil2010-05-171-2/+7
| | | | | | | | | | | | | | | | | | | | | | | | 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>
| * block: Fix bdrv_commitKevin Wolf2010-05-171-3/+3
| | | | | | | | | | | | | | | | 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>
| * block: Fix protocol detection for Windows devicesKevin Wolf2010-05-171-4/+6
| | | | | | | | | | | | | | 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>
| * block: Avoid unchecked casts for AIOCBsKevin Wolf2010-05-175-6/+7
| | | | | | | | | | | | Use container_of for one direction and &acb->common for the other one. Signed-off-by: Kevin Wolf <kwolf@redhat.com>
| * bochs: use qemu block APIChristoph Hellwig2010-05-171-21/+9
| | | | | | | | | | | | | | | | | | 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>
| * bochs: use preadChristoph Hellwig2010-05-171-43/+20
| | | | | | | | | | | | | | | | 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>
| * ide: Fix ide_dma_cancelKevin Wolf2010-05-171-4/+4
| | | | | | | | | | | | | | | | | | 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>
| * cloop: use qemu block APIChristoph Hellwig2010-05-171-14/+12
| | | | | | | | | | | | | | | | | | 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>
| * cloop: use preadChristoph Hellwig2010-05-171-15/+17
| | | | | | | | | | | | | | | | 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>
| * qemu-nbd: Improve error reportingRyota Ozaki2010-05-171-10/+24
| | | | | | | | | | | | | | | | | | | | | | | | - 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>
| * block: Remove semicolon in BDRV_SECTOR_MASK macroStefan Hajnoczi2010-05-171-1/+1
| | | | | | | | | | Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
* | Merge remote branch 'mst/for_anthony' into stagingAnthony Liguori2010-05-173-8/+16
|\ \ | |/ |/|
| * virtio-net: return with value in void functionMichael S. Tsirkin2010-05-121-1/+1
| | | | | | | | | | | | | | | | 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>
| * virtio: invoke set_features on loadMichael S. Tsirkin2010-05-121-0/+2
| | | | | | | | | | | | | | | | | | | | 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>
| * pci: irq_state vmstate breakageMichael S. Tsirkin2010-05-121-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * pci: cleanly backout of pci_qdev_init()Alex Williamson2010-05-121-5/+11
| | | | | | | | | | | | | | | | | | | | | | 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>
* | sparc: move DT and QT defines to op_helper.cBlue Swirl2010-05-162-5/+5
| | | | | | | | Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* | sparc64: fix TT_WOTHER valueIgor V. Kovalenko2010-05-161-1/+1
| | | | | | | | | | | | | | | | - 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>
* | sparc64: fix mmu demap operand typoIgor V. Kovalenko2010-05-161-2/+2
| | | | | | | | | | | | | | - 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>
OpenPOWER on IntegriCloud