- Sep 23, 2014
-
-
Fam Zheng authored
This is the "common part" to handle one cmd request. Refactor out for later usage of dataplane iothread code. Signed-off-by:
Fam Zheng <famz@redhat.com> Signed-off-by:
Paolo Bonzini <pbonzini@redhat.com>
-
Paolo Bonzini authored
The command direction according to the guest-passed buffers is already stored in the VirtIOSCSIReq. We can use it instead of computing it again from req->elem. Cc: Laszlo Ersek <lersek@redhat.com> Signed-off-by:
Paolo Bonzini <pbonzini@redhat.com>
-
Paolo Bonzini authored
This helps for cross-endian configurations. Cc: qemu-stable@nongnu.org Signed-off-by:
Paolo Bonzini <pbonzini@redhat.com>
-
Fam Zheng authored
The VirtQueueElement is a very big structure (>48k!), since it will be initialzed by virtqueue_pop, we can save the expensive zeroing here. This saves a few microseconds per request in my test: [fio-test] rw bs iodepth jobs bw iops latency -------------------------------------------------------------------------------------------- Before read 4k 1 1 110 28269 34 After read 4k 1 1 131 33745 28 Whereas, virtio-blk read 4k 1 1 217 55673 16 Signed-off-by:
Fam Zheng <famz@redhat.com> Signed-off-by:
Paolo Bonzini <pbonzini@redhat.com>
-
Fam Zheng authored
Zeroing sense buffer for each scsi request is not efficient, we can just leave it uninitialized because sense_len is set to 0. Move the implicitly zeroed fields to the end of the structure and use a partial memset. The explicitly initialized fields (by scsi_req_alloc or scsi_req_new) are moved to the beginning of the structure, before sense buffer, to skip the memset. Also change g_malloc0 to g_slice_alloc. Signed-off-by:
Fam Zheng <famz@redhat.com> Signed-off-by:
Paolo Bonzini <pbonzini@redhat.com>
-
Peter Maydell authored
# gpg: Signature made Mon 22 Sep 2014 12:41:59 BST using RSA key ID 81AB73C8 # gpg: Good signature from "Stefan Hajnoczi <stefanha@redhat.com>" # gpg: aka "Stefan Hajnoczi <stefanha@gmail.com>" * remotes/stefanha/tags/block-pull-request: (59 commits) block: Always compile virtio-blk dataplane vring: Better error handling if num is too large virtio: Import virtio_vring.h async: aio_context_new(): Handle event_notifier_init failure block: vhdx - fix reading beyond pointer during image creation block: delete cow block driver block/archipelago: Fix typo in qemu_archipelago_truncate() ahci: Add test_identify case to ahci-test. ahci: Add test_hba_enable to ahci-test. ahci: Add test_hba_spec to ahci-test. ahci: properly shadow the TFD register ahci: add test_pci_enable to ahci-test. ahci: Add test_pci_spec to ahci-test. ahci: MSI capability should be at 0x80, not 0x50. ahci: Adding basic functionality qtest. layout: Add generators for refcount table and blocks fuzz: Add fuzzing functions for entries of refcount table and blocks docs: List all image elements currently supported by the fuzzer qapi/block-core: Add "new" qcow2 options qcow2: Add overlap-check.template option ... Signed-off-by:
Peter Maydell <peter.maydell@linaro.org>
-
Peter Maydell authored
trivial patches for 2014-09-22 # gpg: Signature made Mon 22 Sep 2014 09:10:03 BST using RSA key ID A4C3D7DB # gpg: Good signature from "Michael Tokarev <mjt@tls.msk.ru>" # gpg: aka "Michael Tokarev <mjt@corpit.ru>" # gpg: aka "Michael Tokarev <mjt@debian.org>" # gpg: WARNING: This key is not certified with a trusted signature! # gpg: There is no indication that the signature belongs to the owner. # Primary key fingerprint: 6EE1 95D1 886E 8FFB 810D 4324 457C E0A0 8044 65C5 # Subkey fingerprint: 6F67 E18E 7C91 C5B1 5514 66A7 BEE5 9D74 A4C3 D7DB * remotes/mjt/tags/trivial-patches-2014-09-22: arch_init: Setting QEMU_ARCH enum straight pc: Add missing 'static' attribute block: allow creation of fixed vhdx images vl: Print maxmem in hex format for error message configure: trivial fixes xen-hvm.c: Always return -1 when failure occurs in xen_hvm_init() rdma: Fix incorrect description in comments Fix typos and misspellings in comments qemu-char: Permit only a single "stdio" character device Signed-off-by:
Peter Maydell <peter.maydell@linaro.org>
-
- Sep 22, 2014
-
-
Fam Zheng authored
Dataplane doesn't depend on linux-aio any more, so we don't need the compiling condition now. Configure options are kept but just print a message. Signed-off-by:
Fam Zheng <famz@redhat.com> Reviewed-by:
Paolo Bonzini <pbonzini@redhat.com> Message-id: 1410329871-28885-4-git-send-email-famz@redhat.com Signed-off-by:
Stefan Hajnoczi <stefanha@redhat.com>
-
Fam Zheng authored
To be more consistent inside this function. Signed-off-by:
Fam Zheng <famz@redhat.com> Reviewed-by:
Paolo Bonzini <pbonzini@redhat.com> Message-id: 1410329871-28885-3-git-send-email-famz@redhat.com Signed-off-by:
Stefan Hajnoczi <stefanha@redhat.com>
-
Fam Zheng authored
This header has no further dependencies. It only has some stable data types and primitive functions, so we can copy it to include/hw/virtio in order to allow vring code (and its user virtio-blk dataplane) to be built unconditionally, even for cross compiling. Suggested-by:
Paolo Bonzini <pbonzini@redhat.com> Signed-off-by:
Fam Zheng <famz@redhat.com> Reviewed-by:
Paolo Bonzini <pbonzini@redhat.com> Message-id: 1410329871-28885-2-git-send-email-famz@redhat.com Signed-off-by:
Stefan Hajnoczi <stefanha@redhat.com>
-
Chrysostomos Nanakos authored
On a system with a low limit of open files the initialization of the event notifier could fail and QEMU exits without printing any error information to the user. The problem can be easily reproduced by enforcing a low limit of open files and start QEMU with enough I/O threads to hit this limit. The same problem raises, without the creation of I/O threads, while QEMU initializes the main event loop by enforcing an even lower limit of open files. This commit adds an error message on failure: # qemu [...] -object iothread,id=iothread0 -object iothread,id=iothread1 qemu: Failed to initialize event notifier: Too many open files in system Signed-off-by:
Chrysostomos Nanakos <cnanakos@grnet.gr> Signed-off-by:
Stefan Hajnoczi <stefanha@redhat.com>
-
Jeff Cody authored
In vhdx_create_metadata(), we allocate 40 bytes to entry_buffer for the various metadata table entries. However, we write out 64kB from that buffer into the new file. Only write out the correct 40 bytes. Signed-off-by:
Jeff Cody <jcody@redhat.com> Reviewed-by:
Markus Armbruster <armbru@redhat.com> Signed-off-by:
Stefan Hajnoczi <stefanha@redhat.com>
-
Stefan Hajnoczi authored
This patch removes support for the cow file format. Normally we do not break backwards compatibility but in this case there is no impact and it is the most logical option. Extraordinary claims require extraordinary evidence so I will show why removing the cow block driver is the right thing to do. The cow file format is the disk image format for Usermode Linux, a way of running a Linux system in userspace. The performance of UML was never great and it was hacky, but it enjoyed some popularity before hardware virtualization support became mainstream. QEMU's block/cow.c is supposed to read this image file format. Unfortunately the file format was underspecified: 1. Earlier Linux versions used the MAXPATHLEN constant for the backing filename field. The value of MAXPATHLEN can change, so Linux switched to a 4096 literal but QEMU has a 1024 literal. 2. Padding was not used on the header struct (both in the Linux kernel and in QEMU) so the struct layout varied across architectures. In particular, i386 and x86_64 were different due to int64_t alignment differences. Linux now uses __attribute__((packed)), QEMU does not. Therefore: 1. QEMU cow images do not conform to the Linux cow image file format. 2. cow images cannot be shared between different host architectures. This means QEMU cow images are useless and QEMU has not had bug reports from users actually hitting these issues. Let's get rid of this thing, it serves no purpose and no one will be affected. Signed-off-by:
Stefan Hajnoczi <stefanha@redhat.com> Reviewed-by:
Markus Armbruster <armbru@redhat.com> Message-id: 1410877464-20481-1-git-send-email-stefanha@redhat.com Signed-off-by:
Stefan Hajnoczi <stefanha@redhat.com>
-
Chrysostomos Nanakos authored
Fix a typo introduced by 94c80a43 Signed-off-by:
Chrysostomos Nanakos <cnanakos@grnet.gr> Signed-off-by:
Stefan Hajnoczi <stefanha@redhat.com>
-
John Snow authored
Utilizing all of the bring-up code in pci_enable and hba_enable, this test issues a simple IDENTIFY command via the HBA and retrieves the response via the PIO receive mechanisms of the HBA. Bugs: The DPS interrupt (Descriptor Processed Status) does not currently get set. This will need to be adjusted in a future patch series when the AHCI DMA pathways are reworked to allow the feature, which may be utilized by OSX guests. Signed-off-by:
John Snow <jsnow@redhat.com> Message-id: 1408643079-30675-9-git-send-email-jsnow@redhat.com Signed-off-by:
Stefan Hajnoczi <stefanha@redhat.com>
-
John Snow authored
This test engages the HBA functionality and initializes values to sane defaults to allow for minimal HBA functionality. Buffers are allocated and pointers are updated to allow minimal I/O commands to complete as expected. Error registers and responses are sanity checked for specification adherence. Signed-off-by:
John Snow <jsnow@redhat.com> Message-id: 1408643079-30675-8-git-send-email-jsnow@redhat.com Signed-off-by:
Stefan Hajnoczi <stefanha@redhat.com>
-
John Snow authored
Add a test routine that checks the boot-up values of the HBA configuration memory space against the AHCI 1.3 specification and Intel ICH9 data sheet (for Q35 machines) for adherence and sane values. The HBA is not yet engaged or put into the idle state. [Replaced g_assert_false(...) with g_assert(!...) for glib <2.38 compatibility, reported by Peter Maydell <peter.maydell@linaro.org>. --Stefan] Signed-off-by:
John Snow <jsnow@redhat.com> Signed-off-by:
Stefan Hajnoczi <stefanha@redhat.com> Message-id: 1408643079-30675-7-git-send-email-jsnow@redhat.com Signed-off-by:
Stefan Hajnoczi <stefanha@redhat.com>
-
John Snow authored
In a real AHCI device, several S/ATA registers are mirrored or shadowed within the AHCI register set. These registers are not updated synchronously for each read access, but are instead updated after a Device-to-Host Register FIS packet is received. The D2H FIS contains the values from these registers on the device. In QEMU, by reaching directly into the device to grab these bits before they are "sent," we may introduce race conditions where unexpected values are present "before they are sent" which could cause issues for some guests, particularly if an attempt is made to read the PxTFD register prior to enabling the port, where incorrect values will be read. This patch also addresses the boot-time values for the PxTFD and PxSIG registers to bring them in line with the AHCI 1.3 specification. Lastly, several fields (PxTFD, PxSIG and PxSACT) are read-only, and any attempts to write to them should be ignored. Signed-off-by:
John Snow <jsnow@redhat.com> Message-id: 1408643079-30675-6-git-send-email-jsnow@redhat.com Signed-off-by:
Stefan Hajnoczi <stefanha@redhat.com>
-
John Snow authored
This adds a test wherein we engage the PCI AHCI device and ensure that the memory region for the HBA functionality is now accessible. Under Q35 environments, additional PCI configuration is performed to ensure that the HBA functionality will become usable. Signed-off-by:
John Snow <jsnow@redhat.com> Message-id: 1408643079-30675-5-git-send-email-jsnow@redhat.com Signed-off-by:
Stefan Hajnoczi <stefanha@redhat.com>
-
John Snow authored
Adds a specification adherence test for AHCI where the boot-up values for the PCI configuration space are compared against the AHCI 1.3 specification. This test does not itself attempt to engage the device. Signed-off-by:
John Snow <jsnow@redhat.com> Message-id: 1408643079-30675-4-git-send-email-jsnow@redhat.com Signed-off-by:
Stefan Hajnoczi <stefanha@redhat.com>
-
John Snow authored
In the Intel ICH9 data sheet, the MSI capability offset in the PCI configuration space for ICH9 AHCI devices is specified to be 0x80. Further, the PCI capability pointer should always point to 0x80 in ICH9 devices, despite the fact that AHCI 1.3 specifies that it should be pointing to PMCAP (Which in this instance would be 0x70) to maintain adherence to the Intel data sheet specifications and real observed behavior. Signed-off-by:
John Snow <jsnow@redhat.com> Message-id: 1408643079-30675-3-git-send-email-jsnow@redhat.com Signed-off-by:
Stefan Hajnoczi <stefanha@redhat.com>
-
John Snow authored
Currently, there is no qtest to test the functionality of the AHCI functionality present within the Q35 machine type. This patch adds a skeleton for an AHCI test suite, and adds a simple sanity-check test case where we identify that the AHCI device is present, then disengage the virtual machine. Signed-off-by:
John Snow <jsnow@redhat.com> Message-id: 1408643079-30675-2-git-send-email-jsnow@redhat.com Signed-off-by:
Stefan Hajnoczi <stefanha@redhat.com>
-
Maria Kustova authored
Refcount structures are placed in clusters randomly selected from all unallocated host clusters. Reviewed-by:
Stefan Hajnoczi <stefanha@redhat.com> Signed-off-by:
Maria Kustova <maria.k@catit.be> Reviewed-by:
Fam Zheng <famz@redhat.com> Message-id: 7e2f38608db6fba2da53997390b19400d445c45d.1408450493.git.maria.k@catit.be Signed-off-by:
Stefan Hajnoczi <stefanha@redhat.com>
-
Maria Kustova authored
Reviewed-by:
Fam Zheng <famz@redhat.com> Reviewed-by:
Stefan Hajnoczi <stefanha@redhat.com> Signed-off-by:
Maria Kustova <maria.k@catit.be> Message-id: c9f4027b6f401c67e9d18f94aed29be445e81d48.1408450493.git.maria.k@catit.be Signed-off-by:
Stefan Hajnoczi <stefanha@redhat.com>
-
Maria Kustova authored
Reviewed-by:
Fam Zheng <famz@redhat.com> Reviewed-by:
Stefan Hajnoczi <stefanha@redhat.com> Signed-off-by:
Maria Kustova <maria.k@catit.be> Message-id: cb71485d0f55d1d8401eebaead8324eb78673060.1408450493.git.maria.k@catit.be Signed-off-by:
Stefan Hajnoczi <stefanha@redhat.com>
-
Hanna Reitz authored
qcow2 supports more than four options by now, add the new options (overlap check mode and metadata cache size) Signed-off-by:
Max Reitz <mreitz@redhat.com> Reviewed-by:
Eric Blake <eblake@redhat.com> Message-id: 1408557576-14574-5-git-send-email-mreitz@redhat.com Signed-off-by:
Stefan Hajnoczi <stefanha@redhat.com>
-
Hanna Reitz authored
Being able to set the overlap-check option to a string and then refine it via the overlap-check.* options is a nice idea for the command line but does not work so well for non-flattened dicts. In that case, one can only specify either but not both, so add a field to overlap-check.* which does the same as directly specifying overlap-check but can be used in conjunction with the other fields in non-flattened dicts. Signed-off-by:
Max Reitz <mreitz@redhat.com> Reviewed-by:
Eric Blake <eblake@redhat.com> Message-id: 1408557576-14574-4-git-send-email-mreitz@redhat.com Signed-off-by:
Stefan Hajnoczi <stefanha@redhat.com>
-
Hanna Reitz authored
Signed-off-by:
Max Reitz <mreitz@redhat.com> Reviewed-by:
Eric Blake <eblake@redhat.com> Message-id: 1408557576-14574-3-git-send-email-mreitz@redhat.com Signed-off-by:
Stefan Hajnoczi <stefanha@redhat.com>
-
Hanna Reitz authored
Currently, the QemuOpts object opts is leaked if anything fails from its creation up to and including the image repair block. Fix this by freeing that object in the fail path. Signed-off-by:
Max Reitz <mreitz@redhat.com> Reviewed-by:
Eric Blake <eblake@redhat.com> Reviewed-by:
Benoît Canet <benoit.canet@nodalink.com> Message-id: 1408557576-14574-2-git-send-email-mreitz@redhat.com Signed-off-by:
Stefan Hajnoczi <stefanha@redhat.com>
-
Gonglei (Arei) authored
Signed-off-by:
Gonglei <arei.gonglei@huawei.com> Reviewed-by:
Markus Armbruster <armbru@redhat.com> Message-id: 1410874615-14292-1-git-send-email-arei.gonglei@huawei.com Signed-off-by:
Stefan Hajnoczi <stefanha@redhat.com>
-
Maria Kustova authored
Signed-off-by:
Maria Kustova <maria.k@catit.be> Signed-off-by:
Stefan Hajnoczi <stefanha@redhat.com>
-
Hanna Reitz authored
Add tests for unaligned L1/L2/reftable entries and non-fatal corruption reports. Signed-off-by:
Max Reitz <mreitz@redhat.com> Reviewed-by:
Eric Blake <eblake@redhat.com> Message-id: 1409926039-29044-6-git-send-email-mreitz@redhat.com Signed-off-by:
Stefan Hajnoczi <stefanha@redhat.com>
-
Hanna Reitz authored
Offsets taken from the L1, L2 and refcount tables are generally assumed to be correctly aligned. However, this cannot be guaranteed if the image has been written to by something different than qemu, thus check all offsets taken from these tables for correct cluster alignment. Signed-off-by:
Max Reitz <mreitz@redhat.com> Reviewed-by:
Eric Blake <eblake@redhat.com> Message-id: 1409926039-29044-5-git-send-email-mreitz@redhat.com Signed-off-by:
Stefan Hajnoczi <stefanha@redhat.com>
-
Hanna Reitz authored
Use the new function in case of a failed overlap check. This changes output in case of corruption, so adapt iotest 060's reference output accordingly. Signed-off-by:
Max Reitz <mreitz@redhat.com> Reviewed-by:
Eric Blake <eblake@redhat.com> Reviewed-by:
Benoît Canet <benoit.canet@nodalink.com> Message-id: 1409926039-29044-4-git-send-email-mreitz@redhat.com Signed-off-by:
Stefan Hajnoczi <stefanha@redhat.com>
-
Hanna Reitz authored
Add a helper function for easily marking an image corrupt (on fatal corruptions) while outputting an informative message to stderr and via QAPI. Signed-off-by:
Max Reitz <mreitz@redhat.com> Reviewed-by:
Eric Blake <eblake@redhat.com> Reviewed-by:
Benoît Canet <benoit.canet@nodalink.com> Message-id: 1409926039-29044-3-git-send-email-mreitz@redhat.com Signed-off-by:
Stefan Hajnoczi <stefanha@redhat.com>
-
Hanna Reitz authored
Not every BLOCK_IMAGE_CORRUPTED event must be fatal; for example, when reading from an image, they should generally not be. Nonetheless, even an image only read from may of course be corrupted and this can be detected during normal operation. In this case, a non-fatal event should be emitted, but the image should not be marked corrupt (in accordance to "fatal" set to false). Signed-off-by:
Max Reitz <mreitz@redhat.com> Reviewed-by:
Eric Blake <eblake@redhat.com> Message-id: 1409926039-29044-2-git-send-email-mreitz@redhat.com Signed-off-by:
Stefan Hajnoczi <stefanha@redhat.com>
-
Fam Zheng authored
Signed-off-by:
Fam Zheng <famz@redhat.com> Reviewed-by:
Benoît Canet <benoit.canet@nodalink.com> Reviewed-by:
Eric Blake <eblake@redhat.com> Message-id: 1410415798-20673-4-git-send-email-famz@redhat.com Signed-off-by:
Stefan Hajnoczi <stefanha@redhat.com>
-
Fam Zheng authored
Reviewed-by:
Benoît Canet <benoit.canet@nodalink.com> Signed-off-by:
Fam Zheng <famz@redhat.com> Reviewed-by:
Eric Blake <eblake@redhat.com> Message-id: 1410415798-20673-3-git-send-email-famz@redhat.com Signed-off-by:
Stefan Hajnoczi <stefanha@redhat.com>
-
Fam Zheng authored
This is an analogue to Linux null_blk. It can be used for testing or benchmarking block device emulation and general block layer functionalities such as coroutines and throttling, where disk IO is not necessary or wanted. Use null-aio:// for AIO version, and null-co:// for coroutine version. [Resolved conflict with Fam's async bdrv_aio_cancel() series: 1. Drop .bdrv_aio_cancel() since it is now done by block.c 2. Rename qemu_aio_release() to qemu_aio_unref() --Stefan] Signed-off-by:
Fam Zheng <famz@redhat.com> Reviewed-by:
Benoît Canet <benoit.canet@nodalink.com> Reviewed-by:
Eric Blake <eblake@redhat.com> Message-id: 1410415798-20673-2-git-send-email-famz@redhat.com Signed-off-by:
Stefan Hajnoczi <stefanha@redhat.com>
-
Paolo Bonzini authored
If ret is WAIT_TIMEOUT and there was an event returned by select(), we can write to a location after the end of the array. But in that case we can retry the WaitForMultipleObjects call with the same set of events, so just move the event[ret - WAIT_OBJECT_0] assignment inside the existin conditional. Reported-by:
TeLeMan <geleman@gmail.com> Signed-off-by:
Paolo Bonzini <pbonzini@redhat.com> Reviewed-by:
TeLeMan <geleman@gmail.com> Signed-off-by:
Stefan Hajnoczi <stefanha@redhat.com>
-