summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
* qemu-iotests: 140: make description slightly more verboseSascha Silbe2019-11-291-1/+5
| | | | | | | | Describe in a little more detail what the test is supposed to achieve. Signed-off-by: Sascha Silbe <silbe@linux.vnet.ibm.com> Message-id: 1455827853-33477-3-git-send-email-silbe@linux.vnet.ibm.com Signed-off-by: Max Reitz <mreitz@redhat.com>
* qemu-iotests: 140: don't use IDE deviceSascha Silbe2019-11-292-2/+1
| | | | | | | | | | | | IDE is only implemented by very few architectures (mostly PC). The test doesn't actually need a block device attached to the BlockBackend, so just drop it and adjust the reference output accordingly. Fixes: 16dee418 ("iotests: Add test for eject under NBD server") Signed-off-by: Sascha Silbe <silbe@linux.vnet.ibm.com> Message-id: 1455827853-33477-2-git-send-email-silbe@linux.vnet.ibm.com Signed-off-by: Max Reitz <mreitz@redhat.com>
* qemu-iotests: 067: ignore QMP eventsSascha Silbe2019-11-292-145/+10
| | | | | | | | | | | | | | | | | | | | | | | | The relative ordering of "device_del" return value and the "DEVICE_DELETED" QMP event depends on the architecture being tested. On x86 unplugging virtio disks is asynchronous (=qdev_unplug()= → =hotplug_handler_unplug_request()=) while on s390x it is synchronous (=qdev_unplug()= → =hotplug_handler_unplug()=). This leads to the actual output on s390x consistently differing from the reference output (that was probably produced on x86). The easiest way to address this is to filter out QMP events in 067. The DEVICE_DELETED event is already getting explicitly tested by the Python-based test case 139, so the test coverage should be unaffected. Make use of the recently introduced _filter_qmp_events() to remove QMP events from the test case output and adjust the reference output accordingly. The tr / sed / tr trick used for filtering was suggested by Max Reitz <mreitz@redhat.com>. Signed-off-by: Sascha Silbe <silbe@linux.vnet.ibm.com> Message-id: 1455886869-139916-2-git-send-email-silbe@linux.vnet.ibm.com Signed-off-by: Max Reitz <mreitz@redhat.com>
* blockdev: unset inappropriate flags when changing mediumAlyssa Milburn2019-11-291-0/+2
| | | | | | | | | Most importantly, this removes BDRV_O_TEMPORARY, to avoid unlink()ing an image which replaces a snapshotted one. Signed-off-by: Alyssa Milburn <fuzzie@fuzzie.org> Message-id: 20160206133618.GA16635@li141-249.members.linode.com Signed-off-by: Max Reitz <mreitz@redhat.com>
* MAINTAINERS: Add myself as maintainer of the throttling codeAlberto Garcia2019-11-291-0/+9
| | | | | Signed-off-by: Alberto Garcia <berto@igalia.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
* docs: Document the throttling infrastructureAlberto Garcia2019-11-291-0/+252
| | | | | Signed-off-by: Alberto Garcia <berto@igalia.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
* qapi: Correct the name of the iops_rd parameterAlberto Garcia2019-11-291-1/+1
| | | | | Signed-off-by: Alberto Garcia <berto@igalia.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
* qemu-iotests: Extend iotest 093 to test burstsAlberto Garcia2019-11-292-16/+53
| | | | | | | | | This patch adds a new test that checks that the burst settings ('iops_max', 'iops_max_length', etc.) of the throttling code work as expected. Signed-off-by: Alberto Garcia <berto@igalia.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
* throttle: Test throttle_compute_wait() during burstsAlberto Garcia2019-11-291-0/+22
| | | | | | | | | This test simulates an I/O burst for more than two seconds and checks that it works as expected. Signed-off-by: Alberto Garcia <berto@igalia.com> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
* throttle: Check that burst_level leaks correctlyAlberto Garcia2019-11-291-0/+16
| | | | | | | | | This patch expands test_leak_bucket() to check that burst_level leaks correctly. Signed-off-by: Alberto Garcia <berto@igalia.com> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
* qapi: Add burst length fields to BlockDeviceInfoAlberto Garcia2019-11-292-6/+53
| | | | | | | | | This patch adds the new bps_*_max_length and iops_*_max_length parameters to the BlockDeviceInfo struct. Signed-off-by: Alberto Garcia <berto@igalia.com> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
* qapi: Add burst length parameters to block_set_io_throttleAlberto Garcia2019-11-294-15/+104
| | | | | | | | This patch adds the new bps_*_max_length and iops_*_max_length parameters to the block_set_io_throttle command. Signed-off-by: Alberto Garcia <berto@igalia.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
* throttle: Add command-line settings to define the burst periodsAlberto Garcia2019-11-291-0/+37
| | | | | | | | | This patch adds all the throttling.*-max-length command-line parameters to define the length of the burst periods. Signed-off-by: Alberto Garcia <berto@igalia.com> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
* throttle: Add support for burst periodsAlberto Garcia2019-11-292-18/+96
| | | | | | | | | | This patch adds support for burst periods to the throttling code. With this feature the user can keep performing bursts as defined by the LeakyBucket.max rate for a configurable period of time. Signed-off-by: Alberto Garcia <berto@igalia.com> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
* throttle: Use throttle_config_init() to initialize ThrottleConfigAlberto Garcia2019-11-294-13/+31
| | | | | | | | | | | | | | We can currently initialize ThrottleConfig by zeroing all its fields, but this will change with the new fields to define the length of the burst periods. This patch introduces a new throttle_config_init() function and uses it to replace all memset() calls that initialize ThrottleConfig directly. Signed-off-by: Alberto Garcia <berto@igalia.com> Reviewed-by: Kevin Wolf <kwolf@redhat.com> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
* throttle: Merge all functions that check the configuration into oneAlberto Garcia2019-11-294-64/+19
| | | | | | | | | | | | | | There's no need to keep throttle_conflicting(), throttle_is_valid() and throttle_max_is_missing_limit() as separate functions, so this patch merges all three into one. As a consequence, check_throttle_config() becomes redundant and can be replaced with throttle_is_valid(). Signed-off-by: Alberto Garcia <berto@igalia.com> Reviewed-by: Kevin Wolf <kwolf@redhat.com> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
* throttle: Set always an average value when setting a maximum valueAlberto Garcia2019-11-291-0/+2
| | | | | | | | | | | | | | | | | | When testing the ranges of valid values, set_cfg_value() creates sometimes invalid throttling configurations by setting bucket.max while leaving bucket.avg uninitialized. While this doesn't break the current tests, it will as soon as we unify all functions that check the validity of the throttling configuration. This patch ensures that the value of bucket.avg is valid when setting bucket.max. Signed-off-by: Alberto Garcia <berto@igalia.com> Reviewed-by: Kevin Wolf <kwolf@redhat.com> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
* throttle: Make throttle_is_valid() set errpAlberto Garcia2019-11-294-6/+7
| | | | | | | | | | The caller does not need to set it, and this will allow us to refactor this function later. Signed-off-by: Alberto Garcia <berto@igalia.com> Reviewed-by: Kevin Wolf <kwolf@redhat.com> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
* throttle: Make throttle_max_is_missing_limit() set errpAlberto Garcia2019-11-294-8/+9
| | | | | | | | | | The caller does not need to set it, and this will allow us to refactor this function later. Signed-off-by: Alberto Garcia <berto@igalia.com> Reviewed-by: Kevin Wolf <kwolf@redhat.com> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
* throttle: Make throttle_conflicting() set errpAlberto Garcia2019-11-294-12/+17
| | | | | | | | | | The caller does not need to set it, and this will allow us to refactor this function later. Signed-off-by: Alberto Garcia <berto@igalia.com> Reviewed-by: Kevin Wolf <kwolf@redhat.com> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
* throttle: Make throttle_compute_timer() staticAlberto Garcia2019-11-292-10/+4
| | | | | | | | | This function is only used internally in throttle.c Signed-off-by: Alberto Garcia <berto@igalia.com> Reviewed-by: Kevin Wolf <kwolf@redhat.com> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
* block migration: Activate image on destination before writing to itKevin Wolf2019-11-291-0/+7
| | | | | | | | | | When using 'migrate -b', we must make sure to take ownership of the image before writing to it. Otherwise metadata would be thrown away on migration completion; this was caught by the assertions introduced in commit 09e0c771. Reported-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
* qemu-io: use no_argument/required_argument constantsDaniel P. Berrange2019-11-291-15/+15
| | | | | | | | | | When declaring the 'struct option' array, use the standard constants no_argument/required_argument, instead of magic values 0 and 1. Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Daniel P. Berrange <berrange@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
* qemu-nbd: use no_argument/required_argument constantsDaniel P. Berrange2019-11-291-25/+26
| | | | | | | | | | When declaring the 'struct option' array, use the standard constants no_argument/required_argument, instead of magic values 0 and 1. Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Daniel P. Berrange <berrange@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
* qemu-nbd: don't overlap long option values with short optionsDaniel P. Berrange2019-11-291-7/+7
| | | | | | | | | | When defining values for long options, the normal practice is to start numbering from 256, to avoid overlap with the range of valid values for short options. Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Daniel P. Berrange <berrange@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
* qemu-img: allow specifying image as a set of options argsDaniel P. Berrange2019-11-293-60/+195
| | | | | | | | | | | | | | | | | | | Currently qemu-img allows an image filename to be passed on the command line, but unless using the JSON format, it does not have a way to set any options except the format eg qemu-img info https://127.0.0.1/images/centos7.iso This adds a --image-opts arg that indicates that the positional filename should be interpreted as a full option string, not just a filename. qemu-img info --image-opts driver=https,url=https://127.0.0.1/images,sslverify=off This flag is mutually exclusive with the '-f' / '-F' flags. Signed-off-by: Daniel P. Berrange <berrange@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
* qemu-nbd: allow specifying image as a set of options argsDaniel P. Berrange2019-11-292-6/+44
| | | | | | | | | | | | | | | | | | | | | Currently qemu-nbd allows an image filename to be passed on the command line, but unless using the JSON format, it does not have a way to set any options except the format eg qemu-nbd https://127.0.0.1/images/centos7.iso qemu-nbd /home/berrange/demo.qcow2 This adds a --image-opts arg that indicates that the positional filename should be interpreted as a full option string, not just a filename. qemu-nbd --image-opts driver=https,url=https://127.0.0.1/images,sslverify=off qemu-nbd --image-opts driver=file,filename=/home/berrange/demo.qcow2 This flag is mutually exclusive with the '-f' flag. Signed-off-by: Daniel P. Berrange <berrange@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
* qemu-io: allow specifying image as a set of options argsDaniel P. Berrange2019-11-291-6/+51
| | | | | | | | | | | | | | | | | | | | | | | | | Currently qemu-io allows an image filename to be passed on the command line, but unless using the JSON format, it does not have a way to set any options except the format eg qemu-io https://127.0.0.1/images/centos7.iso qemu-io /home/berrange/demo.qcow2 By contrast when using the interactive shell, it is possible to use --option with the 'open' command, or to omit the filename. This adds a --image-opts arg that indicates that the positional filename should be interpreted as a full option string, not just a filename. qemu-io --image-opts driver=https,url=https://127.0.0.1/images,sslverify=off qemu-io --image-opts driver=qcow2,file.filename=/home/berrange/demo.qcow2 This flag is mutually exclusive with the '-f' flag and with the '-o' flag to the 'open' command Signed-off-by: Daniel P. Berrange <berrange@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
* qemu-img: add support for --object command line argDaniel P. Berrange2019-11-293-30/+282
| | | | | | | | | | | | | | | Allow creation of user creatable object types with qemu-img via a new --object command line arg. This will be used to supply passwords and/or encryption keys to the various block driver backends via the recently added 'secret' object type. # printf letmein > mypasswd.txt # qemu-img info --object secret,id=sec0,file=mypasswd.txt \ ...other info args... Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Daniel P. Berrange <berrange@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
* qemu-io: add support for --object command line argDaniel P. Berrange2019-11-291-0/+34
| | | | | | | | | | | | | | | Allow creation of user creatable object types with qemu-io via a new --object command line arg. This will be used to supply passwords and/or encryption keys to the various block driver backends via the recently added 'secret' object type. # printf letmein > mypasswd.txt # qemu-io --object secret,id=sec0,file=mypasswd.txt \ ...other args... Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Daniel P. Berrange <berrange@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
* block: Fix -incoming with snapshot=onKevin Wolf2019-11-295-4/+66
| | | | | | | | | | | | | The BDRV_O_INACTIVE flag should only be set for images explicitly opened by the user. snapshot=on needs to create a new qcow2 image and write some metadata to it. This is not a problem because it can't come from the source, so there's no reason to mark it as BDRV_O_INACTIVE, even though it is opened while waiting for the migration to complete. This fixes an assertion failure when -incoming and snapshot=on are combined. Signed-off-by: Kevin Wolf <kwolf@redhat.com>
* spec: add qcow2 bitmaps extension specificationVladimir Sementsov-Ogievskiy2019-11-291-1/+220
| | | | | | | | | | | | | | | | | | | The new feature for qcow2: storing bitmaps. This patch adds new header extension to qcow2 - Bitmaps Extension. It provides an ability to store virtual disk related bitmaps in a qcow2 image. For now there is only one type of such bitmaps: Dirty Tracking Bitmap, which just tracks virtual disk changes from some moment. Note: Only bitmaps, relative to the virtual disk, stored in qcow2 file, should be stored in this qcow2 file. The size of each bitmap (considering its granularity) is equal to virtual disk size. Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com> Reviewed-by: Max Reitz <mreitz@redhat.com> Reviewed-by: John Snow <jsnow@redhat.com> Reviewed-by: Fam Zheng <famz@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
* quorum: fix segfault when read fails in fifo modeChanglong Xie2019-11-291-1/+2
| | | | | | | Signed-off-by: Wen Congyang <wency@cn.fujitsu.com> Signed-off-by: Changlong Xie <xiecl.fnst@cn.fujitsu.com> Reviewed-by: Alberto Garcia <berto@igalia.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
* qemu-img: initialize MapEntry objectJohn Snow2019-11-291-11/+15
| | | | | | | | | | | | | Commit 16b0d555 introduced an issue where we are not initializing has_filename for the 'next' MapEntry object, which leads to interesting errors in both Valgrind and Clang -fsanitize=undefined. Zero the stack object at allocation AND make sure the utility to populate the fields properly marks has_filename as false if applicable. Signed-off-by: John Snow <jsnow@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
* gtk: fix uninitialized temporary VirtualConsolePaolo Bonzini2019-11-291-1/+1
| | | | | | | | | | | | | | Only the echo field is used in the temporary VirtualConsole, so the damage was limited. But still, if echo was incorrectly set to true, the result would be some puzzling output in VTE monitor and serial consoles. Fixes: fba958c692e47a373d15c1fd3d72b255bf76adbd Cc: Gerd Hoffmann <kraxel@redhat.com> Tested-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Message-id: 1455015557-15106-2-git-send-email-pbonzini@redhat.com Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* etraxfs_dma: Dont forward zero-length payload to clientsEdgar E. Iglesias2019-11-291-5/+8
| | | | Signed-off-by: Edgar E. Iglesias <edgar.iglesias@xilinx.com>
* qemu-options.hx: Improve documentation of chardev multiplexing modePeter Maydell2019-11-292-12/+63
| | | | | | | | | The current documentation of chardev mux=on is rather brief and opaque; expand it to hopefully be a bit more helpful. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Message-Id: <1455643738-6068-1-git-send-email-peter.maydell@linaro.org> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
* vfio/pci: use PCI_MSIX_FLAGS on retrieving the MSIX entriesWei Yang2019-11-291-1/+1
| | | | | | | | | | Even PCI_CAP_FLAGS has the same value as PCI_MSIX_FLAGS, the later one is the more proper on retrieving MSIX entries. This patch uses PCI_MSIX_FLAGS to retrieve the MSIX entries. Signed-off-by: Wei Yang <richard.weiyang@gmail.com> Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
* hw/arm/sysbus-fdt: remove qemu_fdt_setprop returned value checkEric Auger2019-11-291-14/+5
| | | | | | | | | qemu_fdt_setprop asserts in case of error hence no need to check the returned value. Signed-off-by: Eric Auger <eric.auger@linaro.org> Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
* hw/arm/sysbus-fdt: enable amd-xgbe dynamic instantiationEric Auger2019-11-291-6/+188
| | | | | | | | | | | | | | | | | | | | | | | | | | This patch allows the instantiation of the vfio-amd-xgbe device from the QEMU command line (-device vfio-amd-xgbe,host="<device>"). The guest is exposed with a device tree node that combines the description of both XGBE and PHY (representation supported from 4.2 onwards kernel): Documentation/devicetree/bindings/net/amd-xgbe.txt. There are 5 register regions, 6 interrupts including 4 optional edge-sensitive per-channel interrupts. Some property values are inherited from host device tree. Host device tree must feature a combined XGBE/PHY representation (>= 4.2 host kernel). 2 clock nodes (dma and ptp) also are created. It is checked those clocks are fixed on host side. AMD XGBE node creation function has a dependency on vfio Linux header and more generally node creation function for VFIO platform devices only make sense with CONFIG_LINUX so let's protect this code with #ifdef CONFIG_LINUX. Signed-off-by: Eric Auger <eric.auger@linaro.org> Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
* hw/arm/sysbus-fdt: helpers for clock node generationEric Auger2019-11-291-0/+120
| | | | | | | | | | | | | | | | | | Some passthrough'ed devices depend on clock nodes. Those need to be generated in the guest device tree. This patch introduces some helpers to build a clock node from information retrieved in the host device tree. - copy_properties_from_host copies properties from a host device tree node to a guest device tree node - fdt_build_clock_node builds a guest clock node and checks the host fellow clock is a fixed one. fdt_build_clock_node will become static as soon as it gets used. A dummy pre-declaration is needed for compilation of this patch. Signed-off-by: Eric Auger <eric.auger@linaro.org> Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
* device_tree: qemu_fdt_getprop_cell converted to use the error APIEric Auger2019-11-294-12/+35
| | | | | | | | | | | | | | This patch aligns the prototype with qemu_fdt_getprop. The caller can choose whether the function self-asserts on error (passing &error_fatal as Error ** argument, corresponding to the legacy behavior), or behaves differently such as simply output a message. In this later case the caller can use the new lenp parameter to interpret the error if any. Signed-off-by: Eric Auger <eric.auger@linaro.org> Reviewed-by: Peter Crosthwaite <crosthwaite.peter@gmail.com> Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
* device_tree: qemu_fdt_getprop converted to use the error APIEric Auger2019-11-292-6/+18
| | | | | | | | | | | | | | | Current qemu_fdt_getprop exits if the property is not found. It is sometimes needed to read an optional property, in which case we do not wish to exit but simply returns a null value. This patch converts qemu_fdt_getprop to accept an Error **, and existing users are converted to pass &error_fatal. This preserves the existing behaviour. Then to use the API with your optional semantic a null parameter can be conveyed. Signed-off-by: Eric Auger <eric.auger@linaro.org> Reviewed-by: Peter Crosthwaite <crosthwaite.peter@gmail.com> Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
* device_tree: introduce qemu_fdt_node_pathEric Auger2019-11-292-0/+72
| | | | | | | | | This new helper routine returns a NULL terminated array of node paths matching a node name and a compat string. Signed-off-by: Eric Auger <eric.auger@linaro.org> Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
* device_tree: introduce load_device_tree_from_sysfsEric Auger2019-11-292-0/+108
| | | | | | | | | | This function returns the host device tree blob from sysfs (/proc/device-tree). It uses a recursive function inspired from dtc read_fstree. Signed-off-by: Eric Auger <eric.auger@linaro.org> Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
* hw/vfio/platform: amd-xgbe deviceEric Auger2019-11-293-0/+107
| | | | | | | | | | This patch introduces the amd-xgbe VFIO platform device. It allows the guest to do passthrough on a device exposing an "amd,xgbe-seattle-v1a" compat string. Signed-off-by: Eric Auger <eric.auger@linaro.org> Reviewed-by: Alex Bennée <alex.bennee@linaro.org> Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
* vfio/pci: replace 1 with PCI_CAP_LIST_NEXT to make code self-explainWei Yang2019-11-291-4/+4
| | | | | | | | | | Use the macro PCI_CAP_LIST_NEXT instead of 1, so that the code would be more self-explain. This patch makes this change and also fixs one typo in comment. Signed-off-by: Wei Yang <richard.weiyang@gmail.com> Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
* pcie_aer: expose pcie_aer_msg() interfaceChen Fan2019-11-292-1/+2
| | | | | | | | | | For vfio device, we need to propagate the aer error to Guest OS. we use the pcie_aer_msg() to send aer error to guest. Signed-off-by: Chen Fan <chen.fan.fnst@cn.fujitsu.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
* aer: impove pcie_aer_init to support vfio deviceChen Fan2019-11-295-6/+6
| | | | | | | | | | | pcie_aer_init was used to emulate an aer capability for pcie device, but for vfio device, the aer config space size is mutable and is not always equal to PCI_ERR_SIZEOF(0x48). it depends on where the TLP Prefix register required, so here we add a size argument. Signed-off-by: Chen Fan <chen.fan.fnst@cn.fujitsu.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
* vfio: make the 4 bytes aligned for capability sizeChen Fan2019-11-291-1/+2
| | | | | | | | | | this function search the capability from the end, the last size should 0x100 - pos, not 0xff - pos. Signed-off-by: Chen Fan <chen.fan.fnst@cn.fujitsu.com> Reviewed-by: Marcel Apfelbaum <marcel@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
OpenPOWER on IntegriCloud