summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Fix cross compilation (nm command)Stefan Weil2014-09-192-1/+3
| | | | | | | | | | Commit c261d774fb9093d00e0938a19f502fb220f62718 added one more binutils tool: nm also needs a cross prefix. Signed-off-by: Stefan Weil <sw@weilnetz.de> Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Message-id: 1411070108-8954-1-git-send-email-sw@weilnetz.de Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
* Merge remote-tracking branch 'remotes/mst/tags/for_upstream' into stagingPeter Maydell2014-09-1815-75/+236
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | pci, pc, virtio, misc bugfixes A bunch of bugfixes - some of these will make sense for 2.1.2 I put Cc: qemu-stable included where appropriate. Signed-off-by: Michael S. Tsirkin <mst@redhat.com> # gpg: Signature made Thu 18 Sep 2014 19:52:18 BST using RSA key ID D28D5469 # gpg: Good signature from "Michael S. Tsirkin <mst@kernel.org>" # gpg: aka "Michael S. Tsirkin <mst@redhat.com>" * remotes/mst/tags/for_upstream: pc: leave more space for BIOS allocations virtio-pci: fix migration for pci bus master vhost-user: fix VIRTIO_NET_F_MRG_RXBUF negotiation virtio-pci: enable bus master for old guests Revert "virtio: don't call device on !vm_running" virtio-net: drop assert on vm stop Revert "rng-egd: remove redundant free" qdev: Move global validation to a single function qdev: Rename qdev_prop_check_global() to qdev_prop_check_globals() test-qdev-global-props: Test handling of hotpluggable and non-device types test-qdev-global-props: Initialize not_used=true for all props test-qdev-global-props: Run tests on subprocess tests: disable global props test for old glib test-qdev-global-props: Trivial comment fix hw/machine: Free old values of string properties Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
| * pc: leave more space for BIOS allocationsMichael S. Tsirkin2014-09-181-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since QEMU 2.1, we are allocating more space for ACPI tables, so no space is left after initrd for the BIOS to allocate memory. Besides ACPI tables, there are a few other uses of high memory in SeaBIOS: SMBIOS tables and USB drivers use it in particular. These uses allocate a very small amount of memory. Malloc metadata also lives there. So we need _some_ extra padding there to avoid initrd breakage, but not much. John Snow found a case where RHEL5 was broken by the recent change to ACPI_TABLE_SIZE; in his case 4KB of extra padding are fine, but just to be safe I am adding 32KB, which is roughly the same amount of padding that was left by QEMU 2.0 and earlier. Move initrd to leave some space for the BIOS. Cc: qemu-stable@nongnu.org Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Reported-by: John Snow <jsnow@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
| * virtio-pci: fix migration for pci bus masterMichael S. Tsirkin2014-09-181-19/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Current support for bus master (clearing OK bit) together with the need to support guests which do not enable PCI bus mastering, leads to extra state in VIRTIO_PCI_FLAG_BUS_MASTER_BUG bit, which isn't robust in case of cross-version migration for the case when guests use the device before setting DRIVER_OK. Rip out VIRTIO_PCI_FLAG_BUS_MASTER_BUG and implement a simpler work-around: treat clearing of PCI_COMMAND as a virtio reset. Old guests never touch this bit so they will work. As reset clears device status, DRIVER and MASTER bits are now in sync, so we can fix up cross-version migration simply by synchronising them, without need to detect a buggy guest explicitly. Drop tracking VIRTIO_PCI_FLAG_BUS_MASTER_BUG completely. As reset makes the device quiescent, in the future we'll be able to drop checking OK bit in a bunch of places. Cc: Jason Wang <jasowang@redhat.com> Cc: Greg Kurz <gkurz@linux.vnet.ibm.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
| * vhost-user: fix VIRTIO_NET_F_MRG_RXBUF negotiationDamjan Marion2014-09-181-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | Header length check should happen only if backend is kernel. For user backend there is no reason to reset this bit. vhost-user code does not define .has_vnet_hdr_len so VIRTIO_NET_F_MRG_RXBUF cannot be negotiated even if both sides support it. Signed-off-by: Damjan Marion <damarion@cisco.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
| * virtio-pci: enable bus master for old guestsMichael S. Tsirkin2014-09-181-0/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | commit cc943c36faa192cd4b32af8fe5edb31894017d35 pci: Use bus master address space for delivering MSI/MSI-X messages breaks virtio-net for rhel6.[56] x86 guests because they don't enable bus mastering for virtio PCI devices. For the same reason, rhel6.[56] ppc64 guests cannot boot on a virtio-blk disk anymore. Old guests forgot to enable bus mastering, enable it automatically on DRIVER (guests use some devices before DRIVER_OK). Reported-by: Greg Kurz <gkurz@linux.vnet.ibm.com> Reviewed-by: Greg Kurz <gkurz@linux.vnet.ibm.com> Tested-by: Greg Kurz <gkurz@linux.vnet.ibm.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
| * Revert "virtio: don't call device on !vm_running"Michael S. Tsirkin2014-09-181-8/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit a1bc7b827e422e1ff065640d8ec5347c4aadfcd8. virtio: don't call device on !vm_running It turns out that virtio net assumes that vm_running is updated before device status callback in many places, so this change leads to asserts. Previous commit fixes the root issue that motivated a1bc7b827e422e1ff065640d8ec5347c4aadfcd8 differently, so there's no longer a need for this change. In the future, we might be able to drop checking vm_running completely, and check vm state directly. Reported-by: Dietmar Maurer <dietmar@proxmox.com> Cc: qemu-stable@nongnu.org Acked-by: Jason Wang <jasowang@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
| * virtio-net: drop assert on vm stopMichael S. Tsirkin2014-09-181-2/+0
| | | | | | | | | | | | | | | | | | | | On vm stop, vm_running state set to stopped before device is notified, so callbacks can get envoked with vm_running = false; and this is not an error. Cc: qemu-stable@nongnu.org Acked-by: Jason Wang <jasowang@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
| * Revert "rng-egd: remove redundant free"Eduardo Habkost2014-09-181-0/+1
| | | | | | | | | | | | | | | | | | This reverts commit 5e490b6a504912225dff0e520e1c6af68295d238. Cc: qemu-stable@nongnu.org Reviewed-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
| * qdev: Move global validation to a single functionEduardo Habkost2014-09-184-39/+83
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently GlobalProperty.not_used=false has multiple meanings: * It may be a property for a hotpluggable device, which may or may not have been used by a device; * It may be a machine-type-provided property, which may or may not have been used by a device. * It may be a user-provided property that was actually not used by any device. Simplify the logic by having two separate fields: 'user_provided' and 'used'. This allows the entire global property validation logic to be contained in a single function, and allows more specific error messages. Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> Acked-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
| * qdev: Rename qdev_prop_check_global() to qdev_prop_check_globals()Eduardo Habkost2014-09-184-4/+4
| | | | | | | | | | | | Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> Acked-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
| * test-qdev-global-props: Test handling of hotpluggable and non-device typesEduardo Habkost2014-09-181-0/+55
| | | | | | | | | | | | | | | | | | Ensure no warning will be printed for hotpluggable types, and warnings will be printed for non-device types. Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> Acked-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
| * test-qdev-global-props: Initialize not_used=true for all propsEduardo Habkost2014-09-181-2/+5
| | | | | | | | | | | | | | | | | | This will ensure we are actually testing the code which sets not_used=false when the property is used. Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> Acked-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
| * test-qdev-global-props: Run tests on subprocessEduardo Habkost2014-09-181-6/+43
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There are multiple reasons for running the global property tests on a subprocess: * We need the global_props lists to be empty for each test case, so global properties from the previous test won't affect the next one; * We don't want the qdev_prop_check_global() warnings to pollute test output; * With a subprocess, we can ensure qdev_prop_check_global() is printing the warning messages it should. Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> Acked-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
| * tests: disable global props test for old glibMichael S. Tsirkin2014-09-182-1/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | follow-up patch moves global property tests to subprocesses. Unfortunately with old glib this causes: tests/test-qdev-global-props.c: In function ‘test_static_prop’: tests/test-qdev-global-props.c:80:5: error: implicit declaration of function ‘g_test_trap_subprocess’ [-Werror=implicit-function-declaration] tests/test-qdev-global-props.c:80:5: error: nested extern declaration of ‘g_test_trap_subprocess’ [-Werror=nested-externs] This function was only added in glib 2.38, and our minimum version is 2.12. To fix, disable the test for glib < 2.38. Apply before that patch to avoid breaking bisect. Reported-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
| * test-qdev-global-props: Trivial comment fixEduardo Habkost2014-09-141-1/+1
| | | | | | | | | | | | Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> Acked-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
| * hw/machine: Free old values of string propertiesEduardo Habkost2014-09-141-0/+8
| | | | | | | | | | | | | | | | | | | | Reviewed-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Marcel Apfelbaum <marcel.a@redhat.com> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> Acked-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Reviewed-by: Amos Kong <akong@redhat.com> Cc: qemu-stable@nongnu.org
* | Merge remote-tracking branch 'remotes/kraxel/tags/pull-vnc-20140918-1' into ↵Peter Maydell2014-09-182-2/+1
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | staging vnc: set TCP_NODELAY, cleanup in tlc code # gpg: Signature made Thu 18 Sep 2014 07:02:37 BST using RSA key ID D3E87138 # gpg: Good signature from "Gerd Hoffmann (work) <kraxel@redhat.com>" # gpg: aka "Gerd Hoffmann <gerd@kraxel.org>" # gpg: aka "Gerd Hoffmann (private) <kraxel@gmail.com>" * remotes/kraxel/tags/pull-vnc-20140918-1: vnc-tls: Clean up dead store in vnc_set_x509_credential() ui/vnc: set TCP_NODELAY Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
| * | vnc-tls: Clean up dead store in vnc_set_x509_credential()Markus Armbruster2014-09-181-2/+0
| | | | | | | | | | | | | | | Signed-off-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
| * | ui/vnc: set TCP_NODELAYPeter Lieven2014-09-171-0/+1
|/ / | | | | | | | | | | | | | | | | | | | | | | | | we currently have the Nagle algorithm enabled for all outgoing VNC updates. This may delay sensitive updates as mouse movements or typing in the console. As we currently prepare all data in a buffer and then send as much as we can disabling the Nagle algorithm should not cause big trouble. Well established VNC servers like TightVNC set TCP_NODELAY as well. A regular framebuffer update request generates exactly one framebuffer update which should be pushed out as fast as possible. Signed-off-by: Peter Lieven <pl@kamp.de> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* | qemu-char: Rename register_char_driver_qapi() to register_char_driver()Peter Maydell2014-09-167-38/+35
| | | | | | | | | | | | | | | | | | Now we have removed the legacy register_char_driver() we can rename register_char_driver_qapi() to the more obvious and shorter name. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Message-id: 1409653457-27863-6-git-send-email-peter.maydell@linaro.org
* | qemu-char: Remove register_char_driver() machineryPeter Maydell2014-09-162-89/+38
| | | | | | | | | | | | | | | | | | Now that all the char backends have been converted to the QAPI framework we can remove the machinery for handling old style backends. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Message-id: 1409653457-27863-5-git-send-email-peter.maydell@linaro.org
* | qemu-char: Convert udp backend to QAPIPeter Maydell2014-09-161-15/+54
| | | | | | | | | | | | | | Convert the udp char backend to the new style QAPI framework. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Message-id: 1409653457-27863-4-git-send-email-peter.maydell@linaro.org
* | util/qemu-sockets.c: Support specifying IPv4 or IPv6 in socket_dgram()Peter Maydell2014-09-161-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently you can specify whether you want a UDP chardev backend to be IPv4 or IPv6 using the ipv4 or ipv6 options if you use the QemuOpts parsing code in inet_dgram_opts(). However the QMP struct parsing code in socket_dgram() doesn't provide this flexibility (which in turn prevents us from converting the UDP backend handling to the new style QAPI framework). Use the existing inet_addr_to_opts() function to convert the remote->inet address to option strings; this handles ipv4 and ipv6 flags as well as host and port. (It will also convert any 'to' specification, which is harmless as it is ignored in this context.) Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Message-id: 1409653457-27863-3-git-send-email-peter.maydell@linaro.org
* | qemu-char: Convert socket backend to QAPIPeter Maydell2014-09-161-56/+56
| | | | | | | | | | | | | | | | | | Convert the socket char backend to the new style QAPI framework; this allows it to return an Error ** to callers who might not want it to print directly about socket failures. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Message-id: 1409653457-27863-2-git-send-email-peter.maydell@linaro.org
* | Merge remote-tracking branch 'remotes/kraxel/tags/pull-sdl-20140916-1' into ↵Peter Maydell2014-09-162-4/+4
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | staging Two minor sdl2 fixes. # gpg: Signature made Tue 16 Sep 2014 07:20:37 BST using RSA key ID D3E87138 # gpg: Good signature from "Gerd Hoffmann (work) <kraxel@redhat.com>" # gpg: aka "Gerd Hoffmann <gerd@kraxel.org>" # gpg: aka "Gerd Hoffmann (private) <kraxel@gmail.com>" * remotes/kraxel/tags/pull-sdl-20140916-1: sdl2: keymap fixups sdl2: drop sdl_zoom.h Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
| * | sdl2: keymap fixupsGerd Hoffmann2014-09-161-3/+4
| | | | | | | | | | | | | | | | | | Make a few keys works correctly in SDL2. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
| * | sdl2: drop sdl_zoom.hGerd Hoffmann2014-09-161-1/+0
| | | | | | | | | | | | | | | | | | It isn't used. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* | | Merge remote-tracking branch 'remotes/spice/tags/pull-spice-20140916-2' into ↵Peter Maydell2014-09-161-1/+1
|\ \ \ | |/ / |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | staging spice: call qemu_spice_set_passwd() during init # gpg: Signature made Tue 16 Sep 2014 07:11:22 BST using RSA key ID D3E87138 # gpg: Good signature from "Gerd Hoffmann (work) <kraxel@redhat.com>" # gpg: aka "Gerd Hoffmann <gerd@kraxel.org>" # gpg: aka "Gerd Hoffmann (private) <kraxel@gmail.com>" * remotes/spice/tags/pull-spice-20140916-2: spice: call qemu_spice_set_passwd() during init Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
| * | spice: call qemu_spice_set_passwd() during initMarc-André Lureau2014-09-161-1/+1
|/ / | | | | | | | | | | | | | | | | | | | | Don't call SPICE API directly to set password given in command line, but use the internal API, saving password for later calls. This solves losing password when changing expiration in qemu monitor. https://bugzilla.redhat.com/show_bug.cgi?id=1138639 Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* | Merge remote-tracking branch 'remotes/qmp-unstable/queue/qmp' into stagingPeter Maydell2014-09-152-2/+6
|\ \ | | | | | | | | | | | | | | | | | | | | | * remotes/qmp-unstable/queue/qmp: exec: file_ram_alloc(): print error when prealloc fails monitor: fix debug print compiling error Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
| * | exec: file_ram_alloc(): print error when prealloc failsLuiz Capitulino2014-09-121-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If memory allocation fails when using the -mem-prealloc command-line option, QEMU exits without printing any error information to the user: # qemu [...] -m 1G -mem-prealloc -mem-path /dev/hugepages # echo $? 1 This commit adds an error message, so that we print instead: # qemu [...] -m 1G -mem-prealloc -mem-path /dev/hugepages qemu: unable to map backing store for hugepages: Cannot allocate memory Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com>
| * | monitor: fix debug print compiling errorGonglei2014-09-121-2/+5
| | | | | | | | | | | | | | | | | | | | | error: 'i' undeclared (first use in this function) Signed-off-by: Gonglei <arei.gonglei@huawei.com> Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
* | | Merge remote-tracking branch 'remotes/kevin/tags/for-upstream' into stagingPeter Maydell2014-09-1553-279/+704
|\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Block patches # gpg: Signature made Fri 12 Sep 2014 16:09:43 BST using RSA key ID C88F2FD6 # gpg: Good signature from "Kevin Wolf <kwolf@redhat.com>" * remotes/kevin/tags/for-upstream: (22 commits) qcow2: Add falloc and full preallocation option raw-posix: Add falloc and full preallocation option qapi: introduce PreallocMode and new PreallocModes full and falloc. block: don't convert file size to sector size block: round up file size to nearest sector iotests: Send the correct fd in socket_scm_helper blockdev: Refuse to drive_del something added with blockdev-add block: extend BLOCK_IO_ERROR with reason string dataplane: fix virtio_blk_data_plane_create() op blocker error path qemu-iotests: Run 025 for Archipelago block driver block/archipelago: Implement bdrv_truncate() block: Make the block accounting functions operate on BlockAcctStats block: rename BlockAcctType members to start with BLOCK_ instead of BDRV_ block: Extract the block accounting code block: Extract the BlockAcctStats structure IDE: MMIO IDE device control should be little endian thread-pool: Drop unnecessary includes xen: Drop redundant bdrv_close() from pci_piix3_xen_ide_unplug() xen_disk: Plug memory leak on error path qemu-io: Clean up openfile() after commit 2e40134 ... Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
| * | | qcow2: Add falloc and full preallocation optionHu Tao2014-09-124-43/+90
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | preallocation=falloc allocates disk space by posix_fallocate(), preallocation=full allocates disk space by writing zeros to disk. Both modes imply preallocation=metadata. Signed-off-by: Hu Tao <hutao@cn.fujitsu.com> Reviewed-by: Max Reitz <mreitz@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
| * | | raw-posix: Add falloc and full preallocation optionHu Tao2014-09-123-19/+91
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds a new option preallocation for raw format, and implements falloc and full preallocation. Signed-off-by: Hu Tao <hutao@cn.fujitsu.com> Reviewed-by: Max Reitz <mreitz@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
| * | | qapi: introduce PreallocMode and new PreallocModes full and falloc.Hu Tao2014-09-123-11/+36
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch prepares for the subsequent patches. Signed-off-by: Hu Tao <hutao@cn.fujitsu.com> Reviewed-by: Max Reitz <mreitz@redhat.com> Reviewed-by: Kevin Wolf <kwolf@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
| * | | block: don't convert file size to sector sizeHu Tao2014-09-125-23/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | and avoid converting it back later. Signed-off-by: Hu Tao <hutao@cn.fujitsu.com> Reviewed-by: Max Reitz <mreitz@redhat.com> Reviewed-by: Benoît Canet <benoit.canet@nodalink.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
| * | | block: round up file size to nearest sectorHu Tao2014-09-1221-23/+127
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently the file size requested by user is rounded down to nearest sector, causing the actual file size could be a bit less than the size user requested. Since some formats (like qcow2) record virtual disk size in bytes, this can make the last few bytes cannot be accessed. This patch fixes it by rounding up file size to nearest sector so that the actual file size is no less than the requested file size. Signed-off-by: Hu Tao <hutao@cn.fujitsu.com> Reviewed-by: Kevin Wolf <kwolf@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Reviewed-by: Max Reitz <mreitz@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
| * | | iotests: Send the correct fd in socket_scm_helperStratos Psomadakis2014-09-121-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Make sure to pass the correct fd via SCM_RIGHTS in socket_scm_helper.c (i.e. fd_to_send, not socket-fd). Signed-off-by: Stratos Psomadakis <psomas@grnet.gr> Signed-off-by: Dimitris Aragiorgis <dimara@grnet.gr> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
| * | | blockdev: Refuse to drive_del something added with blockdev-addMarkus Armbruster2014-09-111-1/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For some device models, the guest can prevent unplug. Some users need a way to forcibly revoke device model access to the block backend then, so the underlying images can be safely used for something else. drive_del lets you do that. Unfortunately, it conflates revoking access with destroying the backend. Commit 9063f81 made drive_del immediately destroy the root BDS. Nice: the device name becomes available for reuse immediately. Not so nice: the device model's pointer to the root BDS dangles, and we're prone to crash when the memory gets reused. Commit d22b2f4 fixed that by hiding the root BDS instead of destroying it. Destruction only happens on unplug. "Hiding" means removing it from bdrv_states and graph_bdrv_states; see bdrv_make_anon(). This "destroy on revoke" is a misfeature we don't want to carry forward to blockdev-add, just like "destroy on unplug" (commit 2d246f0). So make drive_del fail on anything added with blockdev-add. We'll add separate QMP commands to revoke device model access and to destroy backends. Signed-off-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
| * | | block: extend BLOCK_IO_ERROR with reason stringLuiz Capitulino2014-09-112-2/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | BLOCK_IO_ERROR events are logged by libvirt, which helps with post mortem analysis of guests. However, one information that we miss today is a human readable string describing the cause of the I/O error. This commit adds that string it to BLOCK_IO_ERROR. Note that this string is a debugging aid for humans, meaning that it should not parsed by applications. Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
| * | | dataplane: fix virtio_blk_data_plane_create() op blocker error pathStefan Hajnoczi2014-09-111-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Commit 3718d8ab65f68de2acccbe6a315907805f54e3cc ("block: Replace in_use with operation blocker") broke the error path because it consumed local_err instead of propagating it. The caller has no way to know that the function failed. This caused virtio-blk to start "successfully" even though there was a fatal dataplane error. Steps to reproduce: $ qemu-system-x86_64 -enable-kvm -object iothread,id=iothread0 \ -drive if=none,id=drive0,file=a.img \ (qemu) drive_mirror drive0 /tmp/foo.img (qemu) device_add virtio-blk-pci,iothread=iothread0,drive=drive0 Expected result: Since the mirror block job is using drive0 it is not possible to start virtio-blk data-plane. device_add fails and the PCI adapter is not added. Actual result: device_add completes and the PCI adapter is added. Cc: Fam Zheng <famz@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
| * | | qemu-iotests: Run 025 for Archipelago block driverChrysostomos Nanakos2014-09-101-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Run resize grow test to ensure that existing data is not lost during grow and new space is zeroed. Signed-off-by: Chrysostomos Nanakos <cnanakos@grnet.gr> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
| * | | block/archipelago: Implement bdrv_truncate()Chrysostomos Nanakos2014-09-101-2/+61
| | | | | | | | | | | | | | | | | | | | Signed-off-by: Chrysostomos Nanakos <cnanakos@grnet.gr> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
| * | | block: Make the block accounting functions operate on BlockAcctStatsBenoît Canet2014-09-1013-79/+108
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is the next step for decoupling block accounting functions from BlockDriverState. In a future commit the BlockAcctStats structure will be moved from BlockDriverState to the device models structures. Note that bdrv_get_stats was introduced so device models can retrieve the BlockAcctStats structure of a BlockDriverState without being aware of it's layout. This function should go away when BlockAcctStats will be embedded in the device models structures. CC: Kevin Wolf <kwolf@redhat.com> CC: Stefan Hajnoczi <stefanha@redhat.com> CC: Keith Busch <keith.busch@intel.com> CC: Anthony Liguori <aliguori@amazon.com> CC: "Michael S. Tsirkin" <mst@redhat.com> CC: Paolo Bonzini <pbonzini@redhat.com> CC: Eric Blake <eblake@redhat.com> CC: Peter Maydell <peter.maydell@linaro.org> CC: Michael Tokarev <mjt@tls.msk.ru> CC: John Snow <jsnow@redhat.com> CC: Markus Armbruster <armbru@redhat.com> CC: Alexander Graf <agraf@suse.de> CC: Max Reitz <mreitz@redhat.com> Signed-off-by: Benoît Canet <benoit.canet@nodalink.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
| * | | block: rename BlockAcctType members to start with BLOCK_ instead of BDRV_Benoît Canet2014-09-1011-50/+56
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The middle term goal is to move the BlockAcctStats structure in the device models. (Capturing I/O accounting statistics in the device models is good for billing) This patch make a small step in this direction by removing a reference to BDRV. CC: Kevin Wolf <kwolf@redhat.com> CC: Stefan Hajnoczi <stefanha@redhat.com> CC: Keith Busch <keith.busch@intel.com> CC: Anthony Liguori <aliguori@amazon.com> CC: "Michael S. Tsirkin" <mst@redhat.com> CC: Paolo Bonzini <pbonzini@redhat.com> CC: John Snow <jsnow@redhat.com> CC: Richard Henderson <rth@twiddle.net> CC: Markus Armbruster <armbru@redhat.com> CC: Alexander Graf <agraf@suse.de>i Signed-off-by: Benoît Canet <benoit.canet@nodalink.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
| * | | block: Extract the block accounting codeBenoît Canet2014-09-108-49/+120
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The plan is to add new accounting metrics (latency, invalid requests, failed requests, queue depth) and block.c is overpopulated so it will be better to work in a separate module. Moreover the long term plan is to have statistics in each of the BDS of the graph for metrology purpose; this means that the device model statistics must move from the topmost BDS to the device model. So we need to decouple the statistic code from BlockDriverState. This is another argument for the extraction of the code in a separate module. CC: Kevin Wolf <kwolf@redhat.com> CC: Stefan Hajnoczi <stefanha@redhat.com> CC: Max Reitz <mreitz@redhat.com> CC: Eric Blake <eblake@redhat.com> CC: Benoit Canet <benoit@irqsave.net> CC: Fam Zheng <famz@redhat.com> CC: Peter Crosthwaite <peter.crosthwaite@xilinx.com> CC: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Benoît Canet <benoit.canet@nodalink.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
| * | | block: Extract the BlockAcctStats structureBenoît Canet2014-09-104-18/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Extract the block accounting statistics into a structure so the block device models can hold them in the future. CC: Kevin Wolf <kwolf@redhat.com> CC: Stefan Hajnoczi <stefanha@redhat.com> CC: Max Reitz <mreitz@redhat.com> CC: Eric Blake <eblake@redhat.com> Signed-off-by: Benoît Canet <benoit.canet@nodalink.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
| * | | IDE: MMIO IDE device control should be little endianValentin Manea2014-09-101-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Set the IDE MMIO memory type to little endian. The ATA specs identify words part of the control commands encoded as little endian. While this has no impact on little endian systems, it's required for big endian systems(eg OpenRisc). Signed-off-by: Valentin Manea <valentin.manea@gmail.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
OpenPOWER on IntegriCloud