aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2012-05-07scsi-disk: add dpofua propertyPaolo Bonzini1-1/+6
Linux expects REQ_FUA to be advertised only if WRITE+FUA is faster than WRITE+SYNCHRONIZE CACHE, so we should not set the DPOFUA bit. However, it is useful to have it for testing purposes, so add a qdev property to set it. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2012-05-07scsi: change "removable" field to host many featuresPaolo Bonzini1-8/+15
It is pointless to add a uint32_t field for every new feature. Since we will need a new feature soon, convert accesses to "removable" to look at bit 0 only. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2012-05-04scsi: Specify the xfer direction for UNMAP and ATA_PASSTHROUGH commandsRonnie Sahlberg1-0/+2
scsi_cmd_xfer_mode() is used to specify the xfer direction for SCSI commands that come in from the guest. If the direction is set incorrectly this will eventually cause QEMU to kernel-panic the guest. Add UNMAP and ATAPASSTHROUGH as commands that send data to the device. Without this change, recent kernels will send both UNMAP as well as ATAPASSTHROUGH commands to any /dev/sg* device, which due to the incorrect xfer direction very quickly causes the guest kernel to crash. Example causing a crash without the patch applied: ./x86_64-softmmu/qemu-system-x86_64 -m 1024 -enable-kvm -cdrom linuxmint-12-gnome-dvd-64bit.iso -drive file=/dev/sg4,if=scsi,bus=0,unit=6 Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2012-05-04scsi: fix WRITE SAME transfer length and directionPaolo Bonzini2-7/+12
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2012-05-04scsi: fix refcounting for readsPaolo Bonzini1-0/+7
Recently introduced FUA support also gave us a use-after-free of the BlockAcctCookie within a SCSIDiskReq, due to unbalanced reference counting. The patch fixes this by making scsi_do_read look like a combination of scsi_*_complete + scsi_*_data. It does both a ref (like scsi_read_data) and an unref (like scsi_flush_complete). Reported-by: David Gibson <david@gibson.dropbear.id.au> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2012-05-04scsi: prevent data transfer overflowPaolo Bonzini1-12/+26
Avoid sending more than 2GB of data, as that can cause overflows in int32_t variables. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2012-05-04ISCSI: Add support for thin-provisioning via discard/UNMAP and bigger LUNsRonnie Sahlberg2-14/+77
Update the configure test for libiscsi support to detect version 1.3 or later. Version 1.3 of libiscsi provides both READCAPACITY16 as well as UNMAP commands. Update the iscsi block layer to use READCAPACITY16 to detect the size of the LUN instead of READCAPACITY10. This allows support for LUNs larger than 2TB. Update to implement bdrv_aio_discard() using the UNMAP command. This allows us to use thin-provisioned LUNs from TGTD and other iSCSI targets that support thin-provisioning. Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com> [squashed in subsequent patch from Ronnie to fix off-by-one in LBA count] Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2012-05-03Bail out if CONFIG_TCG_PASS_AREG0 is definedmalc1-21/+1
Signed-off-by: malc <av1474@comtv.ru>
2012-05-03Restore consistent formattingmalc1-18/+18
Signed-off-by: malc <av1474@comtv.ru>
2012-05-02Merge remote-tracking branch 'kwolf/for-anthony' into stagingAnthony Liguori10-30/+564
* kwolf/for-anthony: ATA: Allow WIN_SECURITY_FREEZE_LOCK as nop rbd: add discard support qcow2: fix the return value -ENOENT -> -EEXIST qcow2: Don't hold cache references across yield qcow2: Remove unused parameter in do_alloc_cluster_offset qemu-iotests: Many parallel allocating I/O requests docs: fix one issue in qcow2 specs block/qcow2: Add missing GCC_FMT_ATTR to function report_unsupported() qemu-iotests: ignore fragmentation information for qed
2012-05-02ATA: Allow WIN_SECURITY_FREEZE_LOCK as nopAlexander Graf1-1/+6
When using Windows 8 with an AHCI disk drive, it issues a blue screen. The reason is that WIN_SECURITY_FREEZE_LOCK / CFA_WEAR_LEVEL is not supported by our ATA implementation, but Windows expects it to be there. Since without security stuff implemented, the lock would be a nop anyway and CFA_WEAR_LEVEL already is treated as a nop, let's just allow the cmd for HD drives as well. That way Windows is happy. Signed-off-by: Alexander Graf <agraf@suse.de> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2012-05-02rbd: add discard supportJosh Durgin1-16/+73
Change the write flag to an operation type in RBDAIOCB, and make the buffer optional since discard doesn't use it. Discard is first included in librbd 0.1.2 (which is in Ceph 0.46). If librbd is too old, leave out qemu_rbd_aio_discard entirely, so the old behavior is preserved. Signed-off-by: Josh Durgin <josh.durgin@dreamhost.com> Reviewed-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2012-05-02qcow2: fix the return value -ENOENT -> -EEXISTZhi Yong Wu1-1/+1
Signed-off-by: Zhi Yong Wu <wuzhy@linux.vnet.ibm.com> Reviewed-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2012-05-02qcow2: Don't hold cache references across yieldKevin Wolf1-8/+13
If cache references are held while the coroutine has yielded, the cache may get used up and abort() when it can't find a free entry. Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2012-05-02qcow2: Remove unused parameter in do_alloc_cluster_offsetKevin Wolf1-2/+2
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2012-05-02qemu-iotests: Many parallel allocating I/O requestsKevin Wolf3-0/+465
This test case manages to let qcow2 abort because its cache is used up and it can't find free cache entries for new requests any more. Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2012-05-02docs: fix one issue in qcow2 specsZhi Yong Wu1-1/+1
Signed-off-by: Zhi Yong Wu <wuzhy@linux.vnet.ibm.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2012-05-02block/qcow2: Add missing GCC_FMT_ATTR to function report_unsupported()Stefan Weil1-1/+2
Cc: Kevin Wolf <kwolf@redhat.com> Signed-off-by: Stefan Weil <sw@weilnetz.de> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2012-05-02qemu-iotests: ignore fragmentation information for qedDong Xu Wang1-0/+1
We added image fragmentation statistics functions to qemu-img several days ago, those patches will cause "./check -qed" failed. This patch will ignore fragmentation statistics information of qed format, and then "./check -qed" will work. Signed-off-by: Dong Xu Wang <wdongxu@linux.vnet.ibm.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2012-05-02Update version for 1.1-rc0 releasev1.1-rc0Anthony Liguori1-1/+1
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2012-05-01Merge remote-tracking branch 'kiszka/queues/slirp' into stagingAnthony Liguori1-1/+2
* kiszka/queues/slirp: Declare state directory in smb.conf slirp: don't use "smb ports = 0" option
2012-05-01Merge remote-tracking branch 'stefanha/tracing' into stagingAnthony Liguori5-17/+29
* stefanha/tracing: configure: check for supported Python 2.x versions tracetool: avoid pkgutil.iter_modules() Python 2.7 function tracetool: avoid str.rpartition() Python 2.5 function tracetool: use Python 2.4-compatible __import__() arguments tracetool: use Python 2.4-compatible exception handling syntax
2012-05-01Merge remote-tracking branch 'agraf/s390-for-upstream' into stagingAnthony Liguori4-4/+58
* agraf/s390-for-upstream: s390: reset avail and used index on reboot S390: dont call system_shutdown on disabled wait S390: remove default cdrom, sd-card and floppy support S390: support reboot for kvm on s390 S390: reboot: reset device pages on reboot S390: fix error handling on kernel and initrd failures S390: fix kernel_commandline handling
2012-05-01Merge remote-tracking branch 'stefanha/trivial-patches' into stagingAnthony Liguori3-16/+15
* stefanha/trivial-patches: iohandler: Use bool for boolean struct member and remove holes async: Use bool for boolean struct members and remove a hole configure: Fix creation of symbolic links for MinGW toolchain
2012-05-01Merge remote-tracking branch 'agraf/ppc-for-upstream' into stagingAnthony Liguori12-78/+146
* agraf/ppc-for-upstream: linux-user: Fix invalid TARGET_ABI_BITS usage on ppc hosts target-ppc: Some support for dumping TLB_EMB TLBs ppce500_spin: Replace assert by hw_error (fixes compiler warning) pseries: Fix use of global CPU state pseries: Use the same interrupt swizzling for host bridges as p2p bridges pseries: Implement automatic PAPR VIO address allocation PPC: Fix up e500 cache size setting booke:Use MMU API for creating initial mapping for secondary cpus
2012-05-01Merge remote-tracking branch 'mdroth/qga-pull-4-27-12' into stagingAnthony Liguori6-138/+409
* mdroth/qga-pull-4-27-12: qemu-ga: persist tracking of fsfreeze state via filesystem qemu-ga: add a whitelist for fsfreeze-safe commands qemu-ga: improve recovery options for fsfreeze
2012-05-01Declare state directory in smb.confNikolaus Rath1-0/+2
The smb.conf generated by the userspace networking does not include a state directory directive. Samba therefore falls back to the default value. Since the user generally does not have write access to this path, smbd immediately crashes. The "state directory" option was added in Samba 3.4.0 (commit http://gitweb.samba.org/?p=samba.git;a=commit;h=7b02e05eb64f3ffd7aa1cf027d10a7343c0da757). This patch adds the missing option. Signed-off-by: Nikolaus Rath <Nikolaus@rath.org> Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
2012-05-01slirp: don't use "smb ports = 0" optionNikolaus Rath1-1/+0
The "smb ports = 0" option causes recent samba versions to crash. It was introduced in commit 157777ef3e with log message "Samba 3 support". However, a value of 0 has never been officially supported by smb and is also not necessary: if stdin is a socket, smb does not try to listen on any ports and uses just stdin. This is necessary to support inetd based operation (otherwise smbd would always fail when called from inetd, because inetd already listens on the SMB port). Since samba has supported inetd operation since pre-3.x, it should be safe to rely on this feature. I have tested it with Samba 3.6.4 -- communication works fine, and smbd is not listening on any ports. I suspect the "smb ports = 0" hack may have been introduced when someone tested the qemu generated samba config from the command line with "smbd -i" and found it to fail (because then stdin isn't a socket). Signed-off-by: Nikolaus Rath <Nikolaus@rath.org> Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
2012-05-01linux-user: Fix invalid TARGET_ABI_BITS usage on ppc hostsAlexander Graf1-1/+1
When trying to evaluate the size of the _host_ type size for olddev_t, we need to expose the host's pointer size, not the guest pointer size. This usage got introduced accidently in commit b754e4fc1. Fix things by not using TARGET_.*, but rather use host sizeof() information, which gives us the correct size. Reported-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Alexander Graf <agraf@suse.de>
2012-05-01target-ppc: Some support for dumping TLB_EMB TLBsFrançois Revol1-0/+50
Add mmubooke_dump_mmu(). TODO: Add printing of individual flags. Signed-off-by: François Revol <revol@free.fr> [agraf: fix coding style] Signed-off-by: Alexander Graf <agraf@suse.de>
2012-05-01ppce500_spin: Replace assert by hw_error (fixes compiler warning)Stefan Weil1-1/+1
The default case in function spin_read should never be reached, therefore the old code used assert(0) to abort QEMU. This does not work when QEMU is compiled with macro NDEBUG defined. In this case (and also when the compiler does not know that assert never returns), there is a compiler warning because of the missing return value. Using hw_error allows an improved error message and aborts always. Signed-off-by: Stefan Weil <sw@weilnetz.de> [agraf: use __func__] Signed-off-by: Alexander Graf <agraf@suse.de>
2012-05-01pseries: Fix use of global CPU statePeter Portante1-1/+1
Commit ed120055c7f9b26b5707d3ceabbe5a3f06aaf937 (Implement PAPR VPA functions for pSeries shared processor partitions) introduced the deregister_dtl() function and typo "emv" as name of its argument. This went unnoticed because the code in that function can access the global variable "env" so that no build failure resulted. Fix the argument to read "env". Resolves LP#986241. Signed-off-by: Peter Portante <peter.portante@redhat.com> Acked-by: Andreas Färber <afaerber@suse.de> [agraf: fixed typo in commit message] Signed-off-by: Alexander Graf <agraf@suse.de>
2012-05-01pseries: Use the same interrupt swizzling for host bridges as p2p bridgesDavid Gibson2-24/+30
Currently the pseries PCI code uses a somewhat strange scheme of PCI irq allocation - one per slot up to a maximum that's greater than the usual 4. This scheme more or less worked, because we were able to tell the guest the irq mapping in the device tree, however it's a bit odd and may break assumptions in the future. Worse, the array used to construct the dev tree interrupt map was mis-sized, we got away with it only because it happened that our SPAPR_PCI_NUM_LSI value was greater than 7. This patch changes the pseries PCI code to use the same interrupt swizzling scheme as is standardized for PCI to PCI bridges. This makes for better consistency, deals better with any devices which use multiple interrupt pins and will make life easier in the future when we add passthrough of what may be either a host bridge or a PCI to PCI bridge. This won't break existing guests, because they don't assume a particular mapping scheme for host bridges, but just follow what we tell them in the device tree (also updated to match, of course). This patch also fixes the allocation of the irq map. Signed-off-by: David Gibson <david@gibson.dropbear.id.au> Signed-off-by: Alexander Graf <agraf@suse.de>
2012-05-01pseries: Implement automatic PAPR VIO address allocationDavid Gibson6-40/+49
PAPR virtual IO (VIO) devices require a unique, but otherwise arbitrary, "address" used as a token to the hypercalls which manipulate them. Currently the pseries machine code does an ok job of allocating these addresses when the legacy -net nic / -serial and so forth options are used but will fail to allocate them properly when using -device. Specifically, you can use -device if all addresses are explicitly assigned. Without explicit assignment, only one VIO device of each type (network, console, SCSI) will be assigned properly, any further ones will attempt to take the same address leading to a fatal error. This patch fixes the situation by adding a proper address allocator to the VIO "bus" code. This is used both by -device and the legacy options and default devices. Addresses can still be explicitly assigned with -device options if desired. This patch changes the (guest visible) numbering of VIO devices, but since their addresses are discovered using the device tree and already differ from the numbering found on existing PowerVM systems, this does not break compatibility. Signed-off-by: David Gibson <david@gibson.dropbear.id.au> Signed-off-by: Alexander Graf <agraf@suse.de>
2012-05-01PPC: Fix up e500 cache size settingAlexander Graf1-12/+14
When initializing the e500 code, we need to expose its cache line size for user and system mode, while the mmu details are only interesting for system emulation. Split the 2 switch statements apart, allowing us to #ifdef out the mmu parts for user mode emulation while keeping all cache information consistent. Signed-off-by: Alexander Graf <agraf@suse.de>
2012-05-01booke:Use MMU API for creating initial mapping for secondary cpusBharat Bhushan1-0/+1
Initial Mapping creation for secondary CPU in SMP was missing new MMU API. Signed-off-by: Bharat Bhushan <bharat.bhushan@freescale.com> Signed-off-by: Alexander Graf <agraf@suse.de>
2012-05-01linux-user: Fix undefined HOST_LONG_SIZE on PPC hostsAlexander Graf1-1/+1
On my PPC host, HOST_LONG_SIZE is not defined even after running configure. Use the normal C way of determining the long size instead. Signed-off-by: Alexander Graf <agraf@suse.de> Signed-off-by: malc <av1474@comtv.ru>
2012-05-01Revert "Remove stray HOST_LONG_SIZE"malc1-1/+1
This reverts commit b754e4fc1e8e68af975c545c38ebc3b001ebc98f.
2012-05-01configure: check for supported Python 2.x versionsStefan Hajnoczi1-3/+4
The tracetool code requires Python 2.4, which was released in 2004. Check for a supported Python version so we can give a clear error message. Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com> Reviewed-by: Lluís Vilanova <vilanova@ac.upc.edu>
2012-05-01tracetool: avoid pkgutil.iter_modules() Python 2.7 functionStefan Hajnoczi2-4/+12
The pkgutil.iter_modules() function provides a way to enumerate child modules. Unfortunately it's missing in Python <2.7 so we must implement similar behavior ourselves. Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com> Reviewed-by: Lluís Vilanova <vilanova@ac.upc.edu>
2012-05-01tracetool: avoid str.rpartition() Python 2.5 functionStefan Hajnoczi1-7/+10
The str.rpartition() function is related to str.split() and is used for splitting strings. It was introduced in Python 2.5 and therefore cannot be used in tracetool as Python 2.4 compatibility is required. Replace the code using str.rsplit(). Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com> Reviewed-by: Lluís Vilanova <vilanova@ac.upc.edu>
2012-05-01tracetool: use Python 2.4-compatible __import__() argumentsStefan Hajnoczi1-1/+1
In Python 2.5 keyword arguments were added to __import__(). Avoid using them to achieve Python 2.4 compatibility. Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com> Reviewed-by: Lluís Vilanova <vilanova@ac.upc.edu>
2012-05-01tracetool: use Python 2.4-compatible exception handling syntaxStefan Hajnoczi1-2/+2
The newer "except <exception-type> as <exception>:" syntax is not supported by Python 2.4, we need to use "except <exception-type>, <exception>:". Tested all trace backends with Python 2.4. Reported-by: Andreas Färber <afaerber@suse.de> Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com> Reviewed-by: Lluís Vilanova <vilanova@ac.upc.edu>
2012-05-01s390: reset avail and used index on rebootJens Freimann3-1/+23
reset the guest vring avail/used idx fields, otherwise it's possible that old values remain in memory which would cause a reboot to fail with a "Guest moved used index" message Signed-off-by: Jens Freimann <jfrei@linux.vnet.ibm.com> Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com> Signed-off-by: Alexander Graf <agraf@suse.de>
2012-05-01S390: dont call system_shutdown on disabled waitChristian Borntraeger1-0/+12
A disabled wait usually indicates a guest problem. Dont shutdown the guest to allow guest dumping. Have some special cases, e.g. a quiesce disabled wait. In that case we want to shutdown. Long term solution might be a crashed/panic indication. Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com> Signed-off-by: Alexander Graf <agraf@suse.de>
2012-05-01S390: remove default cdrom, sd-card and floppy supportEinar Lueck1-0/+3
This patch simply disables CDROM, SD card and floppy support for the s390 virtio machine. Without this patch, a default CDROM drive would get added which has currently no backing on s390. Signed-off-by: Einar Lueck <elelueck@de.ibm.com> Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com> Signed-off-by: Alexander Graf <agraf@suse.de>
2012-05-01S390: support reboot for kvm on s390Jens Freimann1-2/+1
This patch adds reboot support for s390x-softmmu by calling the generic reboot support in kvm. Signed-off-by: Jens Freimann <jfrei@linux.vnet.ibm.com> Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com> Signed-off-by: Alexander Graf <agraf@suse.de>
2012-05-01S390: reboot: reset device pages on rebootJens Freimann1-0/+7
This patch fixes reboot on s390 by resetting the device page on reboot. Signed-off-by: Jens Freimann <jfrei@linux.vnet.ibm.com> Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com> Signed-off-by: Alexander Graf <agraf@suse.de>
2012-05-01S390: fix error handling on kernel and initrd failuresChristian Borntraeger1-0/+11
If the user specifies a non-existing or non-accessable kernel or initrd qemu does not fail, instead it ipls into the system, which then falls into a program check loop due to the zeroed memory with no kernel. Lets add some sanity checks. Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com> Signed-off-by: Alexander Graf <agraf@suse.de>
2012-05-01S390: fix kernel_commandline handlingChristian Borntraeger1-1/+1
The current handling of kernel parameters is broken. The pointer is always valid, even if no -kernel or -append is specified. We must check if the kernel rom address is valid instead, otherwise qemu might segfault. Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com> Signed-off-by: Alexander Graf <agraf@suse.de>