summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2010-01-26block: Return original error codes in bdrv_pread/writeKevin Wolf1-16/+18
Don't assume -EIO but return the real error. Signed-off-by: Kevin Wolf <kwolf@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-01-26qcow2: Return 0/-errno in qcow2_alloc_cluster_offsetKevin Wolf3-29/+39
Returning 0/-errno allows it to distingush different errors classes. The cluster offset of newly allocated clusters is now returned in the QCowL2Meta struct. Signed-off-by: Kevin Wolf <kwolf@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-01-26qcow2: Return 0/-errno in get_cluster_tableKevin Wolf1-12/+18
Switching to 0/-errno allows it to distinguish different error cases. Signed-off-by: Kevin Wolf <kwolf@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-01-26qcow2: Fix error handling in qcow_save_vmstateKevin Wolf1-2/+3
Don't assume success but pass the bdrv_pwrite return value on. Signed-off-by: Kevin Wolf <kwolf@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-01-26qcow2: Fix error handling in qcow2_grow_l1_tableKevin Wolf1-4/+6
Return the appropriate error value instead of always using EIO. Don't free the L1 table on errors, we still need it. Signed-off-by: Kevin Wolf <kwolf@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-01-26monitor: convert do_cpu_set() to QObject, QErrorMarkus Armbruster2-3/+4
Signed-off-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-01-26QError: New QERR_INVALID_CPU_INDEXMarkus Armbruster2-0/+7
Signed-off-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-01-26monitor: convert do_physical_memory_save() to QErrorMarkus Armbruster1-1/+1
Signed-off-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-01-26monitor: convert do_memory_save() to QErrorMarkus Armbruster1-1/+1
Signed-off-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-01-26QError: New QERR_OPEN_FILE_FAILEDMarkus Armbruster2-0/+7
Signed-off-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-01-26monitor: Don't check for mon_get_cpu() failureMarkus Armbruster1-36/+3
mon_get_cpu() can't return null pointer, because it passes its return value to cpu_synchronize_state() first, which crashes if its argument is null. Remove the (pretty cheesy) handling of this non-existing error. Signed-off-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-01-26json: escape u0000 .. u001F when outputting jsonAnthony Liguori1-2/+8
Markus Armbruster pointed out: JSON requires control characters in strings to be escaped. RFC 4627 section 2.5: A string begins and ends with quotation marks. All Unicode characters may be placed within the quotation marks except for the characters that must be escaped: quotation mark, reverse solidus, and the control characters (U+0000 through U+001F). We've been quoting the special escape sequences that JSON defines but we haven't been encoding the full control character range. This patch fixes that. Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-01-24Sparc64: fix initrdBlue Swirl1-3/+5
Fix HdrS offsets for Sparc64. The initrd address must be offset by KERNBASE. Use rom_ptr mechanism to actually write to the kernel image. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-01-24pflash: Dont open memarea for full IO if already done.Edgar E. Iglesias1-2/+4
When wcycle is non zero the area is already opened for readable IO. Avoiding the re-registration of the memarea significantly speeds up the flash emulation. In particular for flashes connected through 8 or 16-bit buses. Signed-off-by: Edgar E. Iglesias <edgar.iglesias@petalogix.com>
2010-01-24pflash: Reduce writebuf len for 8-bit flashes.Edgar E. Iglesias1-1/+5
Flashes connected through an 8 bit bus cannot handle write buffers larger than 256 bytes. Signed-off-by: Edgar E. Iglesias <edgar.iglesias@petalogix.com>
2010-01-24pflash: Remove dead code, no functional changes.Edgar E. Iglesias1-7/+0
Signed-off-by: Edgar E. Iglesias <edgar.iglesias@petalogix.com>
2010-01-24microblaze: The petalogix s3adsp board uses intel flashesEdgar E. Iglesias2-4/+3
Signed-off-by: Edgar E. Iglesias <edgar.iglesias@petalogix.com>
2010-01-24Load global config files by defaultAnthony Liguori2-0/+48
A new option, -nodefconfig is introduced to prevent loading from the default config location. Otherwise, two configuration files will be searched for, qemu.conf and target-<TARGET_NAME>.conf. To ensure that the default configuration is overridden by a user specified config, we introduce a two stage option parsing mechanism. Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-01-24Move out option lookup into a separate functionAnthony Liguori1-29/+43
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-01-24Support --sysconfdir in configure to specify path to configuration filesAnthony Liguori1-0/+17
The default value is ${prefix}/etc/qemu. --sysconfdir can be used to override the default to an absolute path. The expectation is that when installed to /usr, --sysconfdir=/etc/qemu will be used. Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-01-24Sparc32: fix free-run timerBlue Swirl1-1/+2
According to Sun4M System Architecture Manual chapter 5.3.2, a limit of 0 will not generate interrupts. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-01-24Musicpal: Fix descriptor walk in eth_sendJan Kiszka1-4/+3
Commit 930c86820e introduced a regression to eth_send: eth_tx_desc_put manipulates the host's tx descriptor copy before writing it back, but two lines down the descriptor is evaluated again, leaving us with an invalid next address if host and guest endianness differ. So this was the actual issue commit 2e87c5b937 tried to paper over. Signed-off-by: Jan Kiszka <jan.kiszka@web.de> Signed-off-by: malc <av1474@comtv.ru>
2010-01-23Musicpal: Fix wm8750 I2C addressJan Kiszka1-1/+1
Commit b3a219883e uncovered that we attached the Wolfson with an I2C address shifted left by one. Fixing this makes sound work again for the Musicpal. Signed-off-by: Jan Kiszka <jan.kiszka@web.de> Signed-off-by: malc <av1474@comtv.ru>
2010-01-23sparc32 fix np dereference in do_unassigned_accessArtyom Tarasenko1-1/+2
fix a potential null pointer dereference introduced in commit 576c2cdc767ab9e2dc038fa4c99f22e53287a3de Signed-off-by: Artyom Tarasenko <atar4qemu@gmail.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-01-22Sparc64: fix PCI probe problemsBlue Swirl1-12/+7
Byte swap PCI config values. Remove old bogus PCI config mechanism so that device 0:0.0 can be probed. This requires OpenBIOS r667. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-01-20Revert "block: prevent multiwrite_merge from creating too large iovecs"Anthony Liguori1-4/+0
This reverts commit 0076bc0c1d93adcbc7f1af184e04902cf37e9ab8. Kevin Wolf pointed out that this breaks the mingw32 build. Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-01-20make: qemu-img depends on config-host.hAnthony Liguori1-1/+1
Fixes mingw32 build out of tree. Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-01-20reduce number of reinjects on ACKGleb Natapov1-1/+1
Windows 7 BSODs under load with HAL_RTC_IRQF_WILL_NOT_CLEAR error. It happens here: hal!HalpRtcUnmaskClock: 8281b93a 8bff mov edi,edi 8281b93c 56 push esi 8281b93d 33f6 xor esi,esi 8281b93f 6a0c push 0Ch 8281b941 e8b2ffffff call hal!CMOS_READ (8281b8f8) 8281b946 84c0 test al,al 8281b948 7920 jns hal!HalpRtcUnmaskClock+0x30 (8281b96a) 8281b94a 6a0a push 0Ah 8281b94c 46 inc esi 8281b94d e854c8ffff call hal!KeStallExecutionProcessor (828181a6) 8281b952 83fe64 cmp esi,64h 8281b955 72e8 jb hal!HalpRtcUnmaskClock+0x5 (8281b93f) 8281b957 6a00 push 0 8281b959 6a00 push 0 8281b95b 6a00 push 0 8281b95d 680a010000 push 10Ah 8281b962 6a5c push 5Ch 8281b964 ff1500c38082 call dword ptr [hal!_imp__KeBugCheckEx (8280c300)] 8281b96a 5e pop esi 8281b96b c3 ret So it loops for 100(64h) times reading register C before BSOD. Lets reduce number of immediate reinjection well under this limit. Signed-off-by: Gleb Natapov <gleb@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-01-20block: prevent multiwrite_merge from creating too large iovecsChristoph Hellwig1-0/+4
If we go over the maximum number of iovecs support by syscall we get back EINVAL from the kernel which translate to I/O errors for the guest. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-01-20block: fix cache flushing in bdrv_commitChristoph Hellwig1-3/+6
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-01-20QMP: Fix asynchronous events deliveryLuiz Capitulino1-4/+3
Commit f039a563f200beee80cc10fd70b21ea396979dab introduces a regression as monitor_protocol_event() will return in the first user Monitor it finds in the QLIST_FOREACH() loop. The right thing to do is to only delivery an asynchronous event if the 'mon' is a QMP Monitor. The aforementioned commit was an early version, if it was applied to stable (it should) this one has to be applied there too. Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-01-20vnc: Use inet_strfamily()Luiz Capitulino1-21/+1
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-01-20net: inet_strfamily(): Better unknown family reportLuiz Capitulino1-1/+1
Returning "????" is a bit meaningless, let's call it "unknown". Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-01-20net: Make inet_strfamily() publicLuiz Capitulino2-1/+2
So that it can be used by other subsystems. Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-01-20virtio-serial: Use MSI vectors for port virtqueuesAmit Shah1-0/+4
This commit enables the use of MSI interrupts for virtqueue notifications for ports. We use nr_ports + 1 (for control channel) msi entries for the ports, as only the in_vq operations need an interrupt on the guest. Signed-off-by: Amit Shah <amit.shah@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-01-20Move virtio-serial to Makefile.objsAmit Shah2-2/+2
There's nothing target-dependent in the virtio-serial code so allow it to be compiled just once for all the targets. Signed-off-by: Amit Shah <amit.shah@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-01-20virtio-serial: Add a 'virtserialport' device for generic serial port supportAmit Shah1-0/+34
This commit adds a simple chardev-based serial port. Any data the guest sends is forwarded to the chardev and vice-versa. Sample uses for such a device can be obtaining info from the guest like the file systems used, apps installed, etc. for offline usage and logged-in users, clipboard copy-paste, etc. for online usage. Signed-off-by: Amit Shah <amit.shah@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-01-20virtio-serial-bus: Add ability to hot-unplug portsAmit Shah2-0/+3
Signed-off-by: Amit Shah <amit.shah@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-01-20virtio-serial-bus: Add a port 'name' property for port discovery in guestsAmit Shah3-0/+26
The port 'id' or number is internal state between the guest kernel and our bus implementation. This is invocation-dependent and isn't part of the guest-host ABI. To correcly enumerate and map ports between the host and the guest, the 'name' property is used. Example: -device virtserialport,name=org.qemu.port.0 This invocation will get us a char device in the guest at: /dev/virtio-ports/org.qemu.port.0 which can be a symlink to /dev/vport0p3 This 'name' property is exposed by the guest kernel in a sysfs attribute: /sys/kernel/virtio-ports/vport0p3/name A simple udev script can pick up this name and create the symlink mentioned above. Signed-off-by: Amit Shah <amit.shah@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-01-20virtio-serial-bus: Maintain guest and host port open/close stateAmit Shah2-0/+100
Via control channel messages, the guest can tell us whether a port got opened or closed. Similarly, we can also indicate to the guest of host port open/close events. Signed-off-by: Amit Shah <amit.shah@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-01-20virtio-console: qdev conversion, new virtio-serial-busAmit Shah17-213/+809
This commit converts the virtio-console device to create a new virtio-serial bus that can host console and generic serial ports. The file hosting this code is now called virtio-serial-bus.c. The virtio console is now a very simple qdev device that sits on the virtio-serial-bus and communicates between the bus and qemu's chardevs. This commit also includes a few changes to the virtio backing code for pci and s390 to spawn the virtio-serial bus. As a result of the qdev conversion, we get rid of a lot of legacy code. The old-style way of instantiating a virtio console using -virtioconsole ... is maintained, but the new, preferred way is to use -device virtio-serial -device virtconsole,chardev=... With this commit, multiple devices as well as multiple ports with a single device can be supported. For multiple ports support, each port gets an IO vq pair. Since the guest needs to know in advance how many vqs a particular device will need, we have to set this number as a property of the virtio-serial device and also as a config option. In addition, we also spawn a pair of control IO vqs. This is an internal channel meant for guest-host communication for things like port open/close, sending port properties over to the guest, etc. This commit is a part of a series of other commits to get the full implementation of multiport support. Future commits will add other support as well as ride on the savevm version that we bump up here. Signed-off-by: Amit Shah <amit.shah@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-01-20virtio: Remove duplicate macro definition for max. virtqueues, bump up the maxAmit Shah2-3/+1
VIRTIO_PCI_QUEUE_MAX is redefined in hw/virtio.c. Let's just keep it in hw/virtio.h. Also, bump up the value of the maximum allowed virtqueues to 64. This is in preparation to allow multiple ports per virtio-console device. Signed-off-by: Amit Shah <amit.shah@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-01-20Disable fall-back to read-only when cannot open drive's file for read-writeNaphtali Sprei1-6/+0
Signed-off-by: Naphtali Sprei <nsprei@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-01-20Added drives' readonly optionNaphtali Sprei1-1/+1
Signed-off-by: Naphtali Sprei <nsprei@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-01-20Clean-up a little bit the RW related bits of BDRV_O_FLAGS. BDRV_O_RDONLY ↵Naphtali Sprei11-42/+44
gone (and so is BDRV_O_ACCESS). Default value for bdrv_flags (0/zero) is READ-ONLY. Need to explicitly request READ-WRITE. Instead of using the field 'readonly' of the BlockDriverState struct for passing the request, pass the request in the flags parameter to the function. Signed-off-by: Naphtali Sprei <nsprei@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-01-20Make CDROM a read-only driveNaphtali Sprei1-0/+7
Signed-off-by: Naphtali Sprei <nsprei@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-01-20Documentation: Add missing documentation for qdev related command line optionsStefan Weil1-4/+21
The command line options -device, -nodefaults, -readconfig, -writeconfig had entries for command line help, but documentation for texi and derived formats (man, html, info) was missing. This also required moving "@end table" to the end of qemu-options.hx again. Signed-off-by: Stefan Weil <weil@mail.berlios.de> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-01-19pc: add driver version compat propertiesGerd Hoffmann1-0/+16
This patch adds compat property entries for ide-disk.ver and scsi-disk.ver to pc-0.10 and pc-0.11. With this patch applied the scsi and ide disks report "0.10" and "0.11" as version when you start qemu with "-M pc-0.10" or "-M pc-0.11". Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-01-19scsi: device version propertyGerd Hoffmann1-1/+4
This patch adds a new property named 'ver' to scsi-disk which allows to specify the version which the virtual disk/cdrom should report to the guest. By default this is the qemu version (i.e. 0.12). usage: -drive if=none,id=disk,file=... -device lsi -device scsi-disk,drive=disk,bus=scsi.0,unit=0,ver=42 You can also switch the version for all scsi drives using: -global scsi-disk.ver=42 Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-01-19ide: device version propertyGerd Hoffmann3-9/+17
This patch adds a new property named 'ver' to ide-drive which allows to specify the version which the virtual disk/cdrom should report to the guest. By default this is the qemu version (i.e. 0.12). usage: -drive if=none,id=disk,file=... -device ide-drive,bus=ide.0,unit=0,drive=disk,ver=42 You can also switch the version for all ide drives using: -global ide-drive.ver=42 Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>