summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2009-11-09Pass the drive's readonly attribute to the guest OSNaphtali Sprei2-1/+5
Implemented for virtio-blk and for scsi Signed-off-by: Naphtali Sprei <nsprei@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-11-09Added readonly flag to -drive commandNaphtali Sprei4-4/+29
This is a slightly revised patch for adding readonly flag to the -drive command. Even though this patch is "stand-alone", it assumes a previous related patch (in Anthony staging tree), that passes the readonly attribute of the drive to the guest OS, applied first. This enables sharing same image between guests, with readonly access. Implementaion mark the drive as read_only and changes the flags when actually opening the file. The readonly attribute of a qcow also passed to it's base file. For ide that cannot pass the readonly attribute to the guest OS, disallow the readonly flag. Also, return error code from bdrv_truncate for readonly drive. Signed-off-by: Naphtali Sprei <nsprei@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-11-09qcow2: Allow qcow2 disk images with size zeroStefan Weil2-9/+13
Images with disk size 0 may be used for VM snapshots, but not to save normal block data. It is possible to create such images using qemu-img, but opening them later fails. So even "qemu-img info image.qcow2" is not possible for an image created with "qemu-img create -f qcow2 image.qcow2 0". This is fixed here. Signed-off-by: Stefan Weil <weil@mail.berlios.de> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-11-07(x86/Sparc/PPC)-user: fix cpu_copyBlue Swirl1-0/+3
b55a37c981914aa8ecd21b9a2a2fb37f39b917c5 moved the call to cpu_reset to user emulators. But cpu_copy also initializes a CPU structure, so add the call also there. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2009-11-07IDE: Fix reset handlingBlue Swirl8-12/+88
Problem: x86 systems could not survive a few system_resets. Clear most of IDE state when reset. Implement the missing reset handlers. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2009-11-07user: move CPU reset call to main.c for x86/PPC/SparcBlue Swirl6-9/+8
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2009-11-07PPC: rename cpu_ppc_reset to cpu_reset for consistencyBlue Swirl9-14/+11
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2009-11-07Sparc64/x86: remove unneeded calls to device resetBlue Swirl5-14/+9
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2009-11-07PPC: remove unneeded calls to device resetBlue Swirl13-26/+2
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2009-11-07sparc32 (mostly): remove unneeded calls to device resetBlue Swirl17-24/+2
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2009-11-07v3: don't call reset functions on cpu initializationGlauber Costa14-13/+4
There is absolutely no need to call reset functions when initializing devices. Since we are already registering them, calling qemu_system_reset() should suffice. Actually, it is what happens when we reboot the machine, and using the same process instead of a special case semantics will even allow us to find bugs easier. Furthermore, the fact that we initialize things like the cpu quite early, leads to the need to introduce synchronization stuff like qemu_system_cond. This patch removes it entirely. All we need to do is call qemu_system_reset() only when we're already sure the system is up and running I tested it with qemu (with and without io-thread) and qemu-kvm, and it seems to be doing okay - although qemu-kvm uses a slightly different patch. [ v2: user mode still needs cpu_reset, so put it in ifdef. ] [ v3: leave qemu_system_cond for now. ] Signed-off-by: Glauber Costa <glommer@redhat.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2009-11-06vga: fix line comparisonmalc1-7/+5
Line counter doesn't wrap. Signed-off-by: malc <av1474@comtv.ru>
2009-11-06vga: Respect Line Compare Register in text modesmalc1-5/+13
Unbreaks setup screen of Act1/PL Signed-off-by: malc <av1474@comtv.ru>
2009-11-04Sparc: fix carry flag handling (Solaris bootblk fix)Artyom Tarasenko1-61/+30
The page 108 of the SPARC Version 8 Architecture Manual describes that addcc and addxcc shall compute carry flag the same way. The page 110 claims the same about subcc and subxcc instructions. This patch fixes carry computation in corner cases and removes redundant code. The most visible effect of the patch is enabling Solaris boot when using OBP. Signed-off-by: Artyom Tarasenko <atar4qemu@gmail.com> [blauwirbel@gmail.com: cleaned up formatting] Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2009-11-03hw/sd: Support SDHC size cardsAndrzej Zaborowski1-60/+84
This patch adds SHDC support (-sd sd.img, where sd.img is larger than 1GB) to qemu. Signed-off-by: Jason S. McMullan <jason.mcmullan@gmail.com> Signed-off-by: Andrzej Zaborowski <andrew.zaborowski@intel.com>
2009-11-02Fix the build when srcdir == objdirAnthony Liguori1-3/+3
You would only see this error on a fresh clone when srcdir == objdir. configure will fail because roms/pcbios doesn't exist. git submodule integration doesn't cleanup very well when switching between branches so you'll get an roms/pcbios directory from normal operations if you switch between old branches. Thanks to a mistake in configure, if you build outside of srcdir, you'll also get a valid roms/pcbios. Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-10-30Unbreak Linux buildAnthony Liguori1-1/+1
commit 71f4effce79ec0485586963ea764f2c212c72f26 Author: Alexander Graf <agraf@suse.de> Date: Fri Oct 30 22:27:00 2009 +0100 Unbreak tap compilation on OS X Broke the build on Linux due to a bad #if guard Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-10-30Update gpxe roms to have BANNER_TIMEOUT=0Anthony Liguori7-1/+1
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-10-30Unbreak tap compilation on OS XAlexander Graf3-2/+9
Currently compiling the tap sources breaks on Mac OS X. This is because of: 1) tap-linux.h requiring Linux includes 2) typos 3) missing #includes This patch adds what's necessary to compile tap happily on Mac OS X. I haven't tested if using tap actually works, but I don't think that's a major issue as that code was probably seriously untested before already. I didn't split the patch, because it's only a few lines of code and splitting is probably not worth the effort here. Signed-off-by: Alexander Graf <agraf@suse.de> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-10-30Revert "Fall back to network boot as the last possible boot option"Anthony Liguori1-1/+1
This reverts commit 94ca5a985919cca312c505bbb0c824d175cc6bb8.
2009-10-30Fall back to network boot as the last possible boot optionAnthony Liguori1-1/+1
This is similiar to the default with most bare metal systems. Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-10-30Remove e1000 rom loading hackAnthony Liguori2-23/+0
The gPXE rom supports BEV properly. Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-10-30Switch from etherboot to gPXEAnthony Liguori8-4/+10
etherboot is deprecated and not under active development anymore. Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-10-30Switch pc bios from pc-bios to seabiosAnthony Liguori4-3/+0
SeaBIOS is a port of pc-bios to GCC. Besides using a more modern tool chain, SeaBIOS introduces a number of new features including PMM support, better BEV and BCV support, and better PnP support. Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-10-30Update SeaBIOS to latest upstreamAnthony Liguori1-0/+0
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-10-30virtio-net: fix macaddr config regressionMark McLoughlin1-0/+1
This commit: commit 97b15621 virtio: use qdev properties for configuration. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> makes a guest using virtio-net see an empty macaddr because we never copy the macaddr into the location that virtio_net_get_config() uses. Signed-off-by: Mark McLoughlin <markmc@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-10-30qemu/msix: fix table access issuesMichael S. Tsirkin1-7/+4
Fixes a couple of issues with msix table access: - With misbehaving guests, misaligned 4 byte access could overflow msix table and cause qemu to segfault. Since PCI spec requires host to only issue dword-aligned accesses, as a fix, it's enough to mask the address low bits. - Tables use pci format, not native format, and so we must use pci_[sg]et_long on read/write. Reported-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-10-30qemu/virtio: make wmb compiler barrier + commentsMichael S. Tsirkin1-1/+4
wmb must be at least a compiler barrier, even without SMP. Further, we likely need some rmb()/mb() as well: I have not audited the code but lguest has mb(), add a comment for now. Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-10-30Remove aio_ctx from paio_* interfaceKevin Wolf3-14/+11
The context parameter in paio_submit isn't used anyway, so there is no reason why block drivers should need to remember it. This also avoids passing a Linux AIO context to paio_submit (which doesn't do any harm as long as the parameter is unused, but it is highly confusing). Signed-off-by: Kevin Wolf <kwolf@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-10-30Add *CFLAGS to LINK in rules.makPeter Hjalmarsson1-1/+1
Sometimes when linking with gcc to get a predictable result you are suggested to also apply the compiler flags to the linker command. For reference, please read: http://gcc.gnu.org/onlinedocs/gcc-4.4.2/gcc/Link-Options.html Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-10-30serial: Add missing bitStefan Weil1-3/+5
Serial frames always start with a start bit. This bit was missing in frame size calculation. Signed-off-by: Stefan Weil <weil@mail.berlios.de> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-10-30serial: Support additional serial speed valuesStefan Weil1-26/+61
* Allow any speed value which is defined for Linux (and possibly other systems). * Compare int values instead of double values. Signed-off-by: Stefan Weil <weil@mail.berlios.de> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-10-30usb: print attached status in info qtreeGerd Hoffmann1-3/+4
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-10-30usb-host: use qdev for -usbdevice + rework.Gerd Hoffmann1-266/+144
Changes: * We don't create/delete devices, we attach/detach them instead. * The separate autofilter list is gone, we simply walk the list of devices directly instead. * Autofiltering is done unconditionally now. Non-auto device scan code got dropped. * Autofiltering turns off the timer if there is nothing to do, it runs only in case there are unattached host devices. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-10-30usb-storage: use qdev for -usbdeviceGerd Hoffmann3-37/+25
Hook up usb_msd_init. Also rework handling of encrypted block devices, move the code out vl.c. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-10-30usb: make attach optional.Gerd Hoffmann2-1/+3
Add a auto_attach field to USBDevice, which is enabled by default. USB drivers can clear this field in case they do *not* want the device being attached (i.e. plugged into a usb port) automatically after successfull init(). Use cases (see next patches): * attaching encrypted mass storage devices. * -usbdevice host:... Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-10-30usb-serial and braille: use qdev for -usbdeviceGerd Hoffmann5-38/+65
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-10-30usb-hid: use qdev for -usbdeviceGerd Hoffmann3-29/+4
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-10-30usb core: use qdev for -usbdeviceGerd Hoffmann5-1/+59
This patchs adds infrastructure to handle -usbdevice via qdev callbacks. USBDeviceInfo gets a name field (for the -usbdevice driver name) and a callback for -usbdevice parameter parsing. The new usbdevice_create() function walks the qdev driver list and looks for a usb driver with a matching name. When a parameter parsing callback is present it is called, otherwise the device is created via usb_create_simple(). Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-10-30use rom loader for pc bios.Gerd Hoffmann1-2/+2
The pc bios shows up in 'info roms' now. Note that the BIOS is mapped to two places: The complete rom at the top of the memory, and the first 128k at 0xe0000. Only the first place is listed in 'info roms'. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-10-30vga roms: move loading from pc.c to vga drivers.Gerd Hoffmann5-13/+14
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-10-30rom loader: make vga+rom loading configurable.Gerd Hoffmann3-4/+19
The rom_add_vga() and rom_add_option() macros are transformed into functions. They look at the new rom_enable_driver_roms variable and only do something if it is set to non-zero, making vga+option rom loading runtime option. pc_init() sets rom_enable_driver_roms to 1. With this in place we can move the rom loading calls from pc.c to the individual drivers. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-10-30rom loader: use qemu_strdup.Gerd Hoffmann1-1/+1
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-10-30net: move UFO support detection to tap-linux.cMark McLoughlin6-6/+29
Only supported on Linux Signed-off-by: Mark McLoughlin <markmc@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-10-30net: move tap_set_offload() code into tap-linux.cMark McLoughlin6-20/+43
TUNSETOFFLOAD is only available on Linux Signed-off-by: Mark McLoughlin <markmc@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-10-30net: move tap_probe_vnet_hdr() to tap-linux.cMark McLoughlin6-12/+27
Only Linux has support for IFF_VNET_HDR Signed-off-by: Mark McLoughlin <markmc@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-10-30net: move tap_set_sndbuf() to tap-linux.cMark McLoughlin6-24/+42
TUNSETSNDBUF is only available on linux Signed-off-by: Mark McLoughlin <markmc@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-10-30net: move linux code into net/tap-linux.cMark McLoughlin3-47/+79
Signed-off-by: Mark McLoughlin <markmc@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-10-30build: add CONFIG_LINUXMark McLoughlin1-0/+4
So I can add a tap-linux.c and use CONFIG_LINUX to pull it in in Makefile Signed-off-by: Mark McLoughlin <markmc@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-10-30net: move AIX code into net/tap-aix.cMark McLoughlin4-14/+33
Okay, this makes the tap options available on AIX even though there's no support, but if we want to do it right we should have not compile the tap code at all on AIX using e.g. CONFIG_TAP. Signed-off-by: Mark McLoughlin <markmc@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>