[libvirt PATCH] gitlab: enable debug output for test suite
by Daniel P. Berrangé
When CI jobs fail on the test suite, we don't see much helpful
information by default:
stderr:
TEST: bhyvexml2argvtest
......!!.............!......!........... 40
........................!...... 71 FAIL
Some tests failed. Run them using:
VIR_TEST_DEBUG=1 VIR_TEST_RANGE=7-8,22,29,65
/tmp/cirrus-ci-build/build/meson-private/dist-build/tests/bhyvexml2argvtest
Following the instructions to re-run the test with VIR_TEST_DEBUG=1 is
great if running locally, but quite unfriendly for CI.
Signed-off-by: Daniel P. Berrangé <berrange(a)redhat.com>
---
Compare before:
https://gitlab.com/libvirt/libvirt/-/jobs/1237988893
and after:
https://gitlab.com/berrange/libvirt/-/jobs/1238324746
.gitlab-ci.yml | 2 ++
ci/cirrus/build.yml | 2 ++
2 files changed, 4 insertions(+)
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 35ec626113..89f618e678 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -11,6 +11,8 @@ stages:
export CCACHE_DIR="$CCACHE_BASEDIR/ccache"
export CCACHE_MAXSIZE="500M"
export PATH="$CCACHE_WRAPPERSDIR:$PATH"
+ export VIR_TEST_VERBOSE="1"
+ export VIR_TEST_DEBUG="1"
# Common templates
diff --git a/ci/cirrus/build.yml b/ci/cirrus/build.yml
index 2d3c46a77c..f7ef5c2d13 100644
--- a/ci/cirrus/build.yml
+++ b/ci/cirrus/build.yml
@@ -9,6 +9,8 @@ env:
PKG_CONFIG_PATH: "@PKG_CONFIG_PATH@"
PYTHON: "@PYTHON@"
MAKE: "@MAKE@"
+ VIR_TEST_VERBOSE: "1"
+ VIR_TEST_DEBUG: "1"
build_task:
install_script:
--
2.31.1
3 years, 7 months
[PATCH] virDomainVideoDriverDefParseXML: Fix use of uninitialized variable
by Peter Krempa
Commit fc7e1b2f03cfe2a5f3fce737390548505382d8ed which refactored the
video driver parse helper introduced a use of uninitialized variable,
which caused test failure at least when compiled with clang.
Pass 'def->vgaconf' directly to virXMLPropEnum. 'def' needs to be
converted to use g_autofree to handle error scenarios.
Signed-off-by: Peter Krempa <pkrempa(a)redhat.com>
---
Pushed under the build-breaker fix rule.
src/conf/domain_conf.c | 12 +++++-------
1 file changed, 5 insertions(+), 7 deletions(-)
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index 64f525fc08..d5d8bd0a01 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -14313,8 +14313,7 @@ static virDomainVideoDriverDef *
virDomainVideoDriverDefParseXML(xmlNodePtr node,
xmlXPathContextPtr ctxt)
{
- virDomainVideoDriverDef *def;
- unsigned int val;
+ g_autofree virDomainVideoDriverDef *def = NULL;
xmlNodePtr driver = NULL;
VIR_XPATH_NODE_AUTORESTORE(ctxt)
@@ -14323,15 +14322,14 @@ virDomainVideoDriverDefParseXML(xmlNodePtr node,
if (!(driver = virXPathNode("./driver", ctxt)))
return NULL;
+ def = g_new0(virDomainVideoDriverDef, 1);
+
if (virXMLPropEnum(driver, "vgaconf",
virDomainVideoVGAConfTypeFromString,
- VIR_XML_PROP_NONZERO, &val) < 0)
+ VIR_XML_PROP_NONZERO, &def->vgaconf) < 0)
return NULL;
- def = g_new0(virDomainVideoDriverDef, 1);
- def->vgaconf = val;
-
- return def;
+ return g_steal_pointer(&def);
}
static virDomainVideoDef *
--
2.30.2
3 years, 7 months
[libvirt PATCH 0/8] ci: Refresh contents, update list of targets
by Andrea Bolognani
This brings our pipeline in sync with the current status of the
libvirt-ci repository.
Test pipeline: https://gitlab.com/abologna/libvirt/-/pipelines/296773363
Andrea Bolognani (8):
ci: Remove Fedora Rawhide dwarf4 hack
ci: Rename CentOS Stream 8 and openSUSE Leap 15.2 containers
ci: Refresh contents
ci: Add openSUSE Tumbleweed
ci: Add FreeBSD 13
ci: Add Fedora 34
ci: Drop Fedora 32
ci: Drop CentOS 7
.gitlab-ci.yml | 88 +++++------
ci/cirrus/freebsd-12.vars | 2 +-
.../{freebsd-12.vars =3D> freebsd-13.vars} | 4 +-
ci/cirrus/freebsd-current.vars | 2 +-
ci/cirrus/macos-11.vars | 2 +-
ci/containers/centos-7.Dockerfile | 138 ------------------
ci/containers/centos-8.Dockerfile | 2 +-
....Dockerfile =3D> centos-stream-8.Dockerfile} | 10 +-
.../debian-10-cross-aarch64.Dockerfile | 4 +-
.../debian-10-cross-armv6l.Dockerfile | 4 +-
.../debian-10-cross-armv7l.Dockerfile | 4 +-
ci/containers/debian-10-cross-i686.Dockerfile | 4 +-
ci/containers/debian-10-cross-mips.Dockerfile | 4 +-
.../debian-10-cross-mips64el.Dockerfile | 4 +-
.../debian-10-cross-mipsel.Dockerfile | 4 +-
.../debian-10-cross-ppc64le.Dockerfile | 4 +-
.../debian-10-cross-s390x.Dockerfile | 4 +-
ci/containers/debian-10.Dockerfile | 4 +-
.../debian-sid-cross-aarch64.Dockerfile | 4 +-
.../debian-sid-cross-armv6l.Dockerfile | 4 +-
.../debian-sid-cross-armv7l.Dockerfile | 4 +-
.../debian-sid-cross-i686.Dockerfile | 4 +-
.../debian-sid-cross-mips64el.Dockerfile | 4 +-
.../debian-sid-cross-mipsel.Dockerfile | 4 +-
.../debian-sid-cross-ppc64le.Dockerfile | 4 +-
.../debian-sid-cross-s390x.Dockerfile | 4 +-
ci/containers/debian-sid.Dockerfile | 4 +-
ci/containers/fedora-33.Dockerfile | 4 +-
...ora-32.Dockerfile =3D> fedora-34.Dockerfile} | 8 +-
.../fedora-rawhide-cross-mingw32.Dockerfile | 4 +-
.../fedora-rawhide-cross-mingw64.Dockerfile | 4 +-
ci/containers/fedora-rawhide.Dockerfile | 4 +-
...ockerfile =3D> opensuse-leap-152.Dockerfile} | 6 +-
...kerfile =3D> opensuse-tumbleweed.Dockerfile} | 15 +-
ci/containers/ubuntu-1804.Dockerfile | 4 +-
ci/containers/ubuntu-2004.Dockerfile | 4 +-
36 files changed, 117 insertions(+), 260 deletions(-)
copy ci/cirrus/{freebsd-12.vars =3D> freebsd-13.vars} (79%)
delete mode 100644 ci/containers/centos-7.Dockerfile
rename ci/containers/{centos-stream.Dockerfile =3D> centos-stream-8.Dockerfi=
le} (89%)
rename ci/containers/{fedora-32.Dockerfile =3D> fedora-34.Dockerfile} (93%)
copy ci/containers/{opensuse-152.Dockerfile =3D> opensuse-leap-152.Dockerfil=
e} (94%)
rename ci/containers/{opensuse-152.Dockerfile =3D> opensuse-tumbleweed.Docke=
rfile} (88%)
--=20
2.26.3
3 years, 7 months
[PATCH v1 0/4] libxl: fix affinity assignment
by Olaf Hering
Olaf Hering (4):
libxl: remove obsolete VIR_LIBXL_EVENT_CONST
libxl: remove obsolete check for result of xc_get_max_cpus
libxl: remove obsolete libxlDomainSetVcpuAffinities function
libxl: set vcpu affinity during domain creation
src/libxl/libxl_conf.c | 53 ++++++++++++++++++++++++++++++++++++++++
src/libxl/libxl_domain.c | 48 +-----------------------------------
src/libxl/libxl_domain.h | 18 +-------------
src/libxl/libxl_driver.c | 6 +----
4 files changed, 56 insertions(+), 69 deletions(-)
3 years, 7 months
[PATCH v2] docs: cputune is also supported by the xen driver
by Olaf Hering
Since commit 68c5b6fb2b5fdabce775e9f8fc761a400e16a9d3 libxl also handles
a domain/cputune/vcpupin element in domU.xml.
Signed-off-by: Olaf Hering <olaf(a)aepfle.de>
---
docs/formatdomain.rst | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/docs/formatdomain.rst b/docs/formatdomain.rst
index 282176c4f4..fa5c14febc 100644
--- a/docs/formatdomain.rst
+++ b/docs/formatdomain.rst
@@ -744,8 +744,8 @@ CPU Tuning
of element ``vcpu`` is not specified, the vCPU is pinned to all the physical
CPUs by default. It contains two required attributes, the attribute ``vcpu``
specifies vCPU id, and the attribute ``cpuset`` is same as attribute
- ``cpuset`` of element ``vcpu``. (NB: Only qemu driver support) :since:`Since
- 0.9.0`
+ ``cpuset`` of element ``vcpu``.
+ :since:`QEMU driver support since 0.9.0, Xen driver support since 0.9.1`
``emulatorpin``
The optional ``emulatorpin`` element specifies which of host physical CPUs
the "emulator", a subset of a domain not including vCPU or iothreads will be
3 years, 7 months
[PATCH v1] docs: cputune is also supported by the xen driver
by Olaf Hering
Since commit 68c5b6fb2b5fdabce775e9f8fc761a400e16a9d3 libxl also handles
a domain/cputune/vcpupin element in domU.xml.
Signed-off-by: Olaf Hering <olaf(a)aepfle.de>
---
docs/formatdomain.rst | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/docs/formatdomain.rst b/docs/formatdomain.rst
index 282176c4f4..0328fe488b 100644
--- a/docs/formatdomain.rst
+++ b/docs/formatdomain.rst
@@ -744,8 +744,8 @@ CPU Tuning
of element ``vcpu`` is not specified, the vCPU is pinned to all the physical
CPUs by default. It contains two required attributes, the attribute ``vcpu``
specifies vCPU id, and the attribute ``cpuset`` is same as attribute
- ``cpuset`` of element ``vcpu``. (NB: Only qemu driver support) :since:`Since
- 0.9.0`
+ ``cpuset`` of element ``vcpu``. (NB: Only qemu and xen driver support)
+ :since:`Since 0.9.0`
``emulatorpin``
The optional ``emulatorpin`` element specifies which of host physical CPUs
the "emulator", a subset of a domain not including vCPU or iothreads will be
3 years, 7 months
[PATCH] virtio-blk: drop deprecated scsi=on|off property
by Stefan Hajnoczi
The scsi=on|off property was deprecated in QEMU 5.0 and can be removed
completely at this point.
Drop the scsi=on|off option. It was only available on Legacy virtio-blk
devices. Linux v5.6 already dropped support for it.
Remove the hw_compat_2_4[] property assignment since scsi=on|off no
longer exists. Old guests with Legacy virtio-blk devices no longer see
the SCSI host features bit.
Live migrating old guests from an old QEMU with the SCSI feature bit
enabled will fail with "Features 0x... unsupported. Allowed features:
0x...". We've followed the QEMU deprecation policy so users have been
warned...
I have tested that libvirt still works when the property is absent. It
no longer adds scsi=on|off to the command-line.
Cc: Markus Armbruster <armbru(a)redhat.com>
Cc: Christoph Hellwig <hch(a)lst.de>
Cc: Peter Krempa <pkrempa(a)redhat.com>
Cc: Dr. David Alan Gilbert <dgilbert(a)redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha(a)redhat.com>
---
docs/specs/tpm.rst | 2 +-
docs/system/deprecated.rst | 13 ---
docs/pci_expander_bridge.txt | 2 +-
hw/block/virtio-blk.c | 192 +----------------------------------
hw/core/machine.c | 2 -
5 files changed, 3 insertions(+), 208 deletions(-)
diff --git a/docs/specs/tpm.rst b/docs/specs/tpm.rst
index 3be190343a..0ec017ab95 100644
--- a/docs/specs/tpm.rst
+++ b/docs/specs/tpm.rst
@@ -328,7 +328,7 @@ In case a pSeries machine is emulated, use the following command line:
-tpmdev emulator,id=tpm0,chardev=chrtpm \
-device tpm-spapr,tpmdev=tpm0 \
-device spapr-vscsi,id=scsi0,reg=0x00002000 \
- -device virtio-blk-pci,scsi=off,bus=pci.0,addr=0x3,drive=drive-virtio-disk0,id=virtio-disk0 \
+ -device virtio-blk-pci,bus=pci.0,addr=0x3,drive=drive-virtio-disk0,id=virtio-disk0 \
-drive file=test.img,format=raw,if=none,id=drive-virtio-disk0
In case an Arm virt machine is emulated, use the following command line:
diff --git a/docs/system/deprecated.rst b/docs/system/deprecated.rst
index 80cae86252..1abb64b669 100644
--- a/docs/system/deprecated.rst
+++ b/docs/system/deprecated.rst
@@ -248,19 +248,6 @@ machines have been renamed ``raspi2b`` and ``raspi3b``.
Device options
--------------
-Emulated device options
-'''''''''''''''''''''''
-
-``-device virtio-blk,scsi=on|off`` (since 5.0.0)
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-
-The virtio-blk SCSI passthrough feature is a legacy VIRTIO feature. VIRTIO 1.0
-and later do not support it because the virtio-scsi device was introduced for
-full SCSI support. Use virtio-scsi instead when SCSI passthrough is required.
-
-Note this also applies to ``-device virtio-blk-pci,scsi=on|off``, which is an
-alias.
-
Block device options
''''''''''''''''''''
diff --git a/docs/pci_expander_bridge.txt b/docs/pci_expander_bridge.txt
index 36750273bb..540191f5e0 100644
--- a/docs/pci_expander_bridge.txt
+++ b/docs/pci_expander_bridge.txt
@@ -25,7 +25,7 @@ A detailed command line would be:
-object memory-backend-ram,size=1024M,policy=bind,host-nodes=1,id=ram-node1 -numa node,nodeid=1,cpus=1,memdev=ram-node1
-device pxb,id=bridge1,bus=pci.0,numa_node=1,bus_nr=4 -netdev user,id=nd -device e1000,bus=bridge1,addr=0x4,netdev=nd
-device pxb,id=bridge2,bus=pci.0,numa_node=0,bus_nr=8 -device e1000,bus=bridge2,addr=0x3
--device pxb,id=bridge3,bus=pci.0,bus_nr=40 -drive if=none,id=drive0,file=[img] -device virtio-blk-pci,drive=drive0,scsi=off,bus=bridge3,addr=1
+-device pxb,id=bridge3,bus=pci.0,bus_nr=40 -drive if=none,id=drive0,file=[img] -device virtio-blk-pci,drive=drive0,bus=bridge3,addr=1
Here you have:
- 2 NUMA nodes for the guest, 0 and 1. (both mapped to the same NUMA node in host, but you can and should put it in different host NUMA nodes)
diff --git a/hw/block/virtio-blk.c b/hw/block/virtio-blk.c
index d28979efb8..5023e046fc 100644
--- a/hw/block/virtio-blk.c
+++ b/hw/block/virtio-blk.c
@@ -25,10 +25,6 @@
#include "sysemu/runstate.h"
#include "hw/virtio/virtio-blk.h"
#include "dataplane/virtio-blk.h"
-#include "scsi/constants.h"
-#ifdef __linux__
-# include <scsi/sg.h>
-#endif
#include "hw/virtio/virtio-bus.h"
#include "migration/qemu-file-types.h"
#include "hw/virtio/virtio-access.h"
@@ -200,59 +196,6 @@ out:
aio_context_release(blk_get_aio_context(s->conf.conf.blk));
}
-#ifdef __linux__
-
-typedef struct {
- VirtIOBlockReq *req;
- struct sg_io_hdr hdr;
-} VirtIOBlockIoctlReq;
-
-static void virtio_blk_ioctl_complete(void *opaque, int status)
-{
- VirtIOBlockIoctlReq *ioctl_req = opaque;
- VirtIOBlockReq *req = ioctl_req->req;
- VirtIOBlock *s = req->dev;
- VirtIODevice *vdev = VIRTIO_DEVICE(s);
- struct virtio_scsi_inhdr *scsi;
- struct sg_io_hdr *hdr;
-
- scsi = (void *)req->elem.in_sg[req->elem.in_num - 2].iov_base;
-
- if (status) {
- status = VIRTIO_BLK_S_UNSUPP;
- virtio_stl_p(vdev, &scsi->errors, 255);
- goto out;
- }
-
- hdr = &ioctl_req->hdr;
- /*
- * From SCSI-Generic-HOWTO: "Some lower level drivers (e.g. ide-scsi)
- * clear the masked_status field [hence status gets cleared too, see
- * block/scsi_ioctl.c] even when a CHECK_CONDITION or COMMAND_TERMINATED
- * status has occurred. However they do set DRIVER_SENSE in driver_status
- * field. Also a (sb_len_wr > 0) indicates there is a sense buffer.
- */
- if (hdr->status == 0 && hdr->sb_len_wr > 0) {
- hdr->status = CHECK_CONDITION;
- }
-
- virtio_stl_p(vdev, &scsi->errors,
- hdr->status | (hdr->msg_status << 8) |
- (hdr->host_status << 16) | (hdr->driver_status << 24));
- virtio_stl_p(vdev, &scsi->residual, hdr->resid);
- virtio_stl_p(vdev, &scsi->sense_len, hdr->sb_len_wr);
- virtio_stl_p(vdev, &scsi->data_len, hdr->dxfer_len);
-
-out:
- aio_context_acquire(blk_get_aio_context(s->conf.conf.blk));
- virtio_blk_req_complete(req, status);
- virtio_blk_free_request(req);
- aio_context_release(blk_get_aio_context(s->conf.conf.blk));
- g_free(ioctl_req);
-}
-
-#endif
-
static VirtIOBlockReq *virtio_blk_get_request(VirtIOBlock *s, VirtQueue *vq)
{
VirtIOBlockReq *req = virtqueue_pop(vq, sizeof(VirtIOBlockReq));
@@ -263,126 +206,6 @@ static VirtIOBlockReq *virtio_blk_get_request(VirtIOBlock *s, VirtQueue *vq)
return req;
}
-static int virtio_blk_handle_scsi_req(VirtIOBlockReq *req)
-{
- int status = VIRTIO_BLK_S_OK;
- struct virtio_scsi_inhdr *scsi = NULL;
- VirtIOBlock *blk = req->dev;
- VirtIODevice *vdev = VIRTIO_DEVICE(blk);
- VirtQueueElement *elem = &req->elem;
-
-#ifdef __linux__
- int i;
- VirtIOBlockIoctlReq *ioctl_req;
- BlockAIOCB *acb;
-#endif
-
- /*
- * We require at least one output segment each for the virtio_blk_outhdr
- * and the SCSI command block.
- *
- * We also at least require the virtio_blk_inhdr, the virtio_scsi_inhdr
- * and the sense buffer pointer in the input segments.
- */
- if (elem->out_num < 2 || elem->in_num < 3) {
- status = VIRTIO_BLK_S_IOERR;
- goto fail;
- }
-
- /*
- * The scsi inhdr is placed in the second-to-last input segment, just
- * before the regular inhdr.
- */
- scsi = (void *)elem->in_sg[elem->in_num - 2].iov_base;
-
- if (!virtio_has_feature(blk->host_features, VIRTIO_BLK_F_SCSI)) {
- status = VIRTIO_BLK_S_UNSUPP;
- goto fail;
- }
-
- /*
- * No support for bidirection commands yet.
- */
- if (elem->out_num > 2 && elem->in_num > 3) {
- status = VIRTIO_BLK_S_UNSUPP;
- goto fail;
- }
-
-#ifdef __linux__
- ioctl_req = g_new0(VirtIOBlockIoctlReq, 1);
- ioctl_req->req = req;
- ioctl_req->hdr.interface_id = 'S';
- ioctl_req->hdr.cmd_len = elem->out_sg[1].iov_len;
- ioctl_req->hdr.cmdp = elem->out_sg[1].iov_base;
- ioctl_req->hdr.dxfer_len = 0;
-
- if (elem->out_num > 2) {
- /*
- * If there are more than the minimally required 2 output segments
- * there is write payload starting from the third iovec.
- */
- ioctl_req->hdr.dxfer_direction = SG_DXFER_TO_DEV;
- ioctl_req->hdr.iovec_count = elem->out_num - 2;
-
- for (i = 0; i < ioctl_req->hdr.iovec_count; i++) {
- ioctl_req->hdr.dxfer_len += elem->out_sg[i + 2].iov_len;
- }
-
- ioctl_req->hdr.dxferp = elem->out_sg + 2;
-
- } else if (elem->in_num > 3) {
- /*
- * If we have more than 3 input segments the guest wants to actually
- * read data.
- */
- ioctl_req->hdr.dxfer_direction = SG_DXFER_FROM_DEV;
- ioctl_req->hdr.iovec_count = elem->in_num - 3;
- for (i = 0; i < ioctl_req->hdr.iovec_count; i++) {
- ioctl_req->hdr.dxfer_len += elem->in_sg[i].iov_len;
- }
-
- ioctl_req->hdr.dxferp = elem->in_sg;
- } else {
- /*
- * Some SCSI commands don't actually transfer any data.
- */
- ioctl_req->hdr.dxfer_direction = SG_DXFER_NONE;
- }
-
- ioctl_req->hdr.sbp = elem->in_sg[elem->in_num - 3].iov_base;
- ioctl_req->hdr.mx_sb_len = elem->in_sg[elem->in_num - 3].iov_len;
-
- acb = blk_aio_ioctl(blk->blk, SG_IO, &ioctl_req->hdr,
- virtio_blk_ioctl_complete, ioctl_req);
- if (!acb) {
- g_free(ioctl_req);
- status = VIRTIO_BLK_S_UNSUPP;
- goto fail;
- }
- return -EINPROGRESS;
-#else
- abort();
-#endif
-
-fail:
- /* Just put anything nonzero so that the ioctl fails in the guest. */
- if (scsi) {
- virtio_stl_p(vdev, &scsi->errors, 255);
- }
- return status;
-}
-
-static void virtio_blk_handle_scsi(VirtIOBlockReq *req)
-{
- int status;
-
- status = virtio_blk_handle_scsi_req(req);
- if (status != -EINPROGRESS) {
- virtio_blk_req_complete(req, status);
- virtio_blk_free_request(req);
- }
-}
-
static inline void submit_requests(BlockBackend *blk, MultiReqBuffer *mrb,
int start, int num_reqs, int niov)
{
@@ -699,9 +522,6 @@ static int virtio_blk_handle_request(VirtIOBlockReq *req, MultiReqBuffer *mrb)
case VIRTIO_BLK_T_FLUSH:
virtio_blk_handle_flush(req, mrb);
break;
- case VIRTIO_BLK_T_SCSI_CMD:
- virtio_blk_handle_scsi(req);
- break;
case VIRTIO_BLK_T_GET_ID:
{
/*
@@ -1010,14 +830,8 @@ static uint64_t virtio_blk_get_features(VirtIODevice *vdev, uint64_t features,
virtio_add_feature(&features, VIRTIO_BLK_F_GEOMETRY);
virtio_add_feature(&features, VIRTIO_BLK_F_TOPOLOGY);
virtio_add_feature(&features, VIRTIO_BLK_F_BLK_SIZE);
- if (virtio_has_feature(features, VIRTIO_F_VERSION_1)) {
- if (virtio_has_feature(s->host_features, VIRTIO_BLK_F_SCSI)) {
- error_setg(errp, "Please set scsi=off for virtio-blk devices in order to use virtio 1.0");
- return 0;
- }
- } else {
+ if (!virtio_has_feature(features, VIRTIO_F_VERSION_1)) {
virtio_clear_feature(&features, VIRTIO_F_ANY_LAYOUT);
- virtio_add_feature(&features, VIRTIO_BLK_F_SCSI);
}
if (blk_enable_write_cache(s->blk) ||
@@ -1289,10 +1103,6 @@ static Property virtio_blk_properties[] = {
DEFINE_PROP_STRING("serial", VirtIOBlock, conf.serial),
DEFINE_PROP_BIT64("config-wce", VirtIOBlock, host_features,
VIRTIO_BLK_F_CONFIG_WCE, true),
-#ifdef __linux__
- DEFINE_PROP_BIT64("scsi", VirtIOBlock, host_features,
- VIRTIO_BLK_F_SCSI, false),
-#endif
DEFINE_PROP_BIT("request-merging", VirtIOBlock, conf.request_merging, 0,
true),
DEFINE_PROP_UINT16("num-queues", VirtIOBlock, conf.num_queues,
diff --git a/hw/core/machine.c b/hw/core/machine.c
index 40def78183..286f18ec6d 100644
--- a/hw/core/machine.c
+++ b/hw/core/machine.c
@@ -194,8 +194,6 @@ GlobalProperty hw_compat_2_5[] = {
const size_t hw_compat_2_5_len = G_N_ELEMENTS(hw_compat_2_5);
GlobalProperty hw_compat_2_4[] = {
- /* Optional because the 'scsi' property is Linux-only */
- { "virtio-blk-device", "scsi", "true", .optional = true },
{ "e1000", "extra_mac_registers", "off" },
{ "virtio-pci", "x-disable-pcie", "on" },
{ "virtio-pci", "migrate-extra", "off" },
--
2.30.2
3 years, 7 months
Re: Let's remove some deprecated stuff
by Eric Blake
On 4/29/21 4:59 AM, Markus Armbruster wrote:
> If you're cc'ed, you added a section to docs/system/deprecated.rst that
> is old enough to permit removal. This is *not* a demand to remove, it's
> a polite request to consider whether the time for removal has come.
> Extra points for telling us in a reply. "We should remove, but I can't
> do it myself right now" is a valid answer. Let's review the file:
>
[adjusting cc for this response]
>
> Eric Blake:
>
> qemu-img amend to adjust backing file (since 5.1)
> '''''''''''''''''''''''''''''''''''''''''''''''''
>
> The use of ``qemu-img amend`` to modify the name or format of a qcow2
> backing image is deprecated; this functionality was never fully
> documented or tested, and interferes with other amend operations that
> need access to the original backing image (such as deciding whether a
> v3 zero cluster may be left unallocated when converting to a v2
> image). Rather, any changes to the backing chain should be performed
> with ``qemu-img rebase -u`` either before or after the remaining
> changes being performed by amend, as appropriate.
>
> qemu-img backing file without format (since 5.1)
> ''''''''''''''''''''''''''''''''''''''''''''''''
>
> The use of ``qemu-img create``, ``qemu-img rebase``, or ``qemu-img
> convert`` to create or modify an image that depends on a backing file
> now recommends that an explicit backing format be provided. This is
> for safety: if QEMU probes a different format than what you thought,
> the data presented to the guest will be corrupt; similarly, presenting
> a raw image to a guest allows a potential security exploit if a future
> probe sees a non-raw image based on guest writes.
>
> To avoid the warning message, or even future refusal to create an
> unsafe image, you must pass ``-o backing_fmt=`` (or the shorthand
> ``-F`` during create) to specify the intended backing format. You may
> use ``qemu-img rebase -u`` to retroactively add a backing format to an
> existing image. However, be aware that there are already potential
> security risks to blindly using ``qemu-img info`` to probe the format
> of an untrusted backing image, when deciding what format to add into
> an existing image.
I'm not sure how widely used these were, but I'm game for writing a
patch to drop them. I'm fairly certain libvirt is not using them.
>
> Kevin Wolf:
>
> ``nbd-server-add`` and ``nbd-server-remove`` (since 5.2)
> ''''''''''''''''''''''''''''''''''''''''''''''''''''''''
>
> Use the more generic commands ``block-export-add`` and ``block-export-del``
> instead. As part of this deprecation, where ``nbd-server-add`` used a
> single ``bitmap``, the new ``block-export-add`` uses a list of ``bitmaps``.
Peter, is libvirt good for this one to go?
--
Eric Blake, Principal Software Engineer
Red Hat, Inc. +1-919-301-3226
Virtualization: qemu.org | libvirt.org
3 years, 7 months
[libvirt PATCH 0/6] Enable sanitizers
by Tim Wiederhake
This series enables and adds AddressSanitizer and UndefinedBehaviorSanitizer
builds to the CI.
See:
https://clang.llvm.org/docs/AddressSanitizer.html and
https://clang.llvm.org/docs/UndefinedBehaviorSanitizer.html
These sanitizers already found some issues in libvirt, e.g.
4eb7c621985dad4de911ec394ac628bd1a5b29ab,
1294de209cee6643511265c7e2d4283c047cf652,
8b8c91f487592c6c067847ca59dde405ca17573f, or
1c34211c22de28127a509edbf2cf2f44cb0d891e.
There exist two more relevant sanitizers, ThreadSanitizer and MemorySanitizer.
Unfortunately, those two require an instrumented build of all dependencies,
including libc, to work correctly.
Note that clang and gcc have different implementations of these sanitizers,
hence the introduction of two new jobs to the CI. The latter one issues a
warning about the use of LD_PRELOAD in `virTestMain`, which in this
particular case can be safely ignored by setting `ASAN_OPTIONS` to
verify_asan_link_order=0` for the gcc build.
Cheers,
Tim
Tim Wiederhake (6):
meson: Allow larger stack frames when instrumenting
meson: Allow undefined symbols when sanitizers are enabled
tests: virfilemock: realpath: Allow non-null second parameter
tests: openvzutilstest: Remove duplicate linking with libvirt_openvz.a
virt-aa-helper: Remove duplicate linking with src/datatypes.o
ci: Enable address and undefined behavior sanitizers
.gitlab-ci.yml | 35 +++++++++++++++++++++++++++++++++++
build-aux/syntax-check.mk | 2 +-
meson.build | 8 +++++++-
src/libvirt_openvz.syms | 2 ++
src/security/meson.build | 1 -
tests/meson.build | 2 +-
tests/virfilemock.c | 12 ++++++------
7 files changed, 52 insertions(+), 10 deletions(-)
--
2.26.3
3 years, 7 months
[PATCH] Add page_per_vq flag to the 'driver' element of virtio devices
by Gavi Teitz
https://bugzilla.redhat.com/show_bug.cgi?id=1925363
Add support for setting the page-per-vq flag, which is important for
vdpa with vhost-user performance.
Signed-off-by: Gavi Teitz <gavi(a)nvidia.com>
---
docs/formatdomain.rst | 11 +++++-
docs/schemas/domaincommon.rng | 5 +++
src/conf/domain_conf.c | 15 ++++++++
src/conf/domain_conf.h | 1 +
src/qemu/qemu_capabilities.c | 2 +
src/qemu/qemu_capabilities.h | 1 +
src/qemu/qemu_command.c | 5 +++
src/qemu/qemu_hotplug.c | 1 +
tests/qemuxml2argvdata/net-virtio-page-per-vq.args | 31 ++++++++++++++++
tests/qemuxml2argvdata/net-virtio-page-per-vq.xml | 29 +++++++++++++++
tests/qemuxml2argvtest.c | 2 +
.../qemuxml2xmloutdata/net-virtio-page-per-vq.xml | 43 ++++++++++++++++++++++
tests/qemuxml2xmltest.c | 2 +
13 files changed, 147 insertions(+), 1 deletion(-)
create mode 100644 tests/qemuxml2argvdata/net-virtio-page-per-vq.args
create mode 100644 tests/qemuxml2argvdata/net-virtio-page-per-vq.xml
create mode 100644 tests/qemuxml2xmloutdata/net-virtio-page-per-vq.xml
diff --git a/docs/formatdomain.rst b/docs/formatdomain.rst
index 282176c..f5a9c70 100644
--- a/docs/formatdomain.rst
+++ b/docs/formatdomain.rst
@@ -5120,7 +5120,7 @@ Setting NIC driver-specific options
<source network='default'/>
<target dev='vnet1'/>
<model type='virtio'/>
- <driver name='vhost' txmode='iothread' ioeventfd='on' event_idx='off' queues='5' rx_queue_size='256' tx_queue_size='256'>
+ <driver name='vhost' txmode='iothread' ioeventfd='on' event_idx='off' queues='5' rx_queue_size='256' tx_queue_size='256' page_per_vq='on'>
<host csum='off' gso='off' tso4='off' tso6='off' ecn='off' ufo='off' mrg_rxbuf='off'/>
<guest csum='off' tso4='off' tso6='off' ecn='off' ufo='off'/>
</driver>
@@ -5215,6 +5215,15 @@ following attributes are available for the ``"virtio"`` NIC driver:
only for ``vhostuser`` type. :since:`Since 3.7.0 (QEMU and KVM only)`
**In general you should leave this option alone, unless you are very certain
you know what you are doing.**
+``page_per_vq``
+ This optional attribute controls the layout of the notification capabilities
+ exposed to the guest. When enabled, each virtio queue will have a dedicated
+ page on the device BAR exposed to the guest. It is recommended to be used when
+ vDPA is enabled on the hypervisor, as it enables mapping the notification area
+ to the physical device, which is only supported in page granularity. The
+ default is determined by QEMU; as off. :since:`Since 2.8.0 (QEMU only)`
+ **In general you should leave this option alone, unless you are very certain
+ you know what you are doing.**
virtio options
For virtio interfaces, `Virtio-specific options <#elementsVirtio>`__ can also
be set. ( :since:`Since 3.5.0` )
diff --git a/docs/schemas/domaincommon.rng b/docs/schemas/domaincommon.rng
index a2e5c50..e61ad67 100644
--- a/docs/schemas/domaincommon.rng
+++ b/docs/schemas/domaincommon.rng
@@ -3463,6 +3463,11 @@
</attribute>
</optional>
<optional>
+ <attribute name="page_per_vq">
+ <ref name="virOnOff"/>
+ </attribute>
+ </optional>
+ <optional>
<attribute name="txmode">
<choice>
<value>iothread</value>
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index 9d98f48..0350fde 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -10446,6 +10446,7 @@ virDomainNetDefParseXML(virDomainXMLOption *xmlopt,
g_autofree char *queues = NULL;
g_autofree char *rx_queue_size = NULL;
g_autofree char *tx_queue_size = NULL;
+ g_autofree char *page_per_vq = NULL;
g_autofree char *filter = NULL;
g_autofree char *internal = NULL;
g_autofree char *mode = NULL;
@@ -10615,6 +10616,7 @@ virDomainNetDefParseXML(virDomainXMLOption *xmlopt,
queues = virXMLPropString(cur, "queues");
rx_queue_size = virXMLPropString(cur, "rx_queue_size");
tx_queue_size = virXMLPropString(cur, "tx_queue_size");
+ page_per_vq = virXMLPropString(cur, "page_per_vq");
if (virDomainVirtioOptionsParseXML(cur, &def->virtio) < 0)
goto error;
@@ -11041,6 +11043,15 @@ virDomainNetDefParseXML(virDomainXMLOption *xmlopt,
}
def->driver.virtio.tx_queue_size = q;
}
+ if (page_per_vq) {
+ if ((val = virTristateSwitchTypeFromString(page_per_vq)) <= 0) {
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
+ _("unknown page_per_vq mode '%s'"),
+ page_per_vq);
+ goto error;
+ }
+ def->driver.virtio.page_per_vq = val;
+ }
if ((tmpNode = virXPathNode("./driver/host", ctxt))) {
if (virXMLPropTristateSwitch(tmpNode, "csum", VIR_XML_PROP_NONE,
@@ -25453,6 +25464,10 @@ virDomainVirtioNetDriverFormat(virBuffer *buf,
if (def->driver.virtio.tx_queue_size)
virBufferAsprintf(buf, " tx_queue_size='%u'",
def->driver.virtio.tx_queue_size);
+ if (def->driver.virtio.page_per_vq) {
+ virBufferAsprintf(buf, " page_per_vq='%s'",
+ virTristateSwitchTypeToString(def->driver.virtio.page_per_vq));
+ }
virDomainVirtioOptionsFormat(buf, def->virtio);
}
diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h
index 85c318d..7aab565 100644
--- a/src/conf/domain_conf.h
+++ b/src/conf/domain_conf.h
@@ -1027,6 +1027,7 @@ struct _virDomainNetDef {
virDomainNetVirtioTxModeType txmode;
virTristateSwitch ioeventfd;
virTristateSwitch event_idx;
+ virTristateSwitch page_per_vq;
unsigned int queues; /* Multiqueue virtio-net */
unsigned int rx_queue_size;
unsigned int tx_queue_size;
diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c
index 7971a9c..e5646cb 100644
--- a/src/qemu/qemu_capabilities.c
+++ b/src/qemu/qemu_capabilities.c
@@ -629,6 +629,7 @@ VIR_ENUM_IMPL(virQEMUCaps,
/* 400 */
"compat-deprecated",
"acpi-index",
+ "virtio-net.page_per_vq",
);
@@ -1405,6 +1406,7 @@ static struct virQEMUCapsDevicePropsFlags virQEMUCapsDevicePropsVirtioNet[] = {
{ "event_idx", QEMU_CAPS_VIRTIO_NET_EVENT_IDX, NULL },
{ "rx_queue_size", QEMU_CAPS_VIRTIO_NET_RX_QUEUE_SIZE, NULL },
{ "tx_queue_size", QEMU_CAPS_VIRTIO_NET_TX_QUEUE_SIZE, NULL },
+ { "page_per_vq", QEMU_CAPS_VIRTIO_NET_PAGE_PER_VQ, NULL },
{ "host_mtu", QEMU_CAPS_VIRTIO_NET_HOST_MTU, NULL },
{ "disable-legacy", QEMU_CAPS_VIRTIO_PCI_DISABLE_LEGACY, NULL },
{ "iommu_platform", QEMU_CAPS_VIRTIO_PCI_IOMMU_PLATFORM, NULL },
diff --git a/src/qemu/qemu_capabilities.h b/src/qemu/qemu_capabilities.h
index f54aad5..75feed4 100644
--- a/src/qemu/qemu_capabilities.h
+++ b/src/qemu/qemu_capabilities.h
@@ -609,6 +609,7 @@ typedef enum { /* virQEMUCapsFlags grouping marker for syntax-check */
/* 400 */
QEMU_CAPS_COMPAT_DEPRECATED, /* -compat deprecated-(input|output) is supported */
QEMU_CAPS_ACPI_INDEX, /* PCI device 'acpi-index' property */
+ QEMU_CAPS_VIRTIO_NET_PAGE_PER_VQ, /* virtio-net-*.page_per_vq */
QEMU_CAPS_LAST /* this must always be the last item */
} virQEMUCapsFlags;
diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
index d7f1c71..7b5834f 100644
--- a/src/qemu/qemu_command.c
+++ b/src/qemu/qemu_command.c
@@ -3630,6 +3630,11 @@ qemuBuildNicDevStr(virDomainDef *def,
if (net->driver.virtio.tx_queue_size)
virBufferAsprintf(&buf, ",tx_queue_size=%u", net->driver.virtio.tx_queue_size);
+ if (net->driver.virtio.page_per_vq) {
+ virBufferAsprintf(&buf, ",page-per-vq=%s",
+ virTristateSwitchTypeToString(net->driver.virtio.page_per_vq));
+ }
+
if (net->mtu)
virBufferAsprintf(&buf, ",host_mtu=%u", net->mtu);
diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c
index 4344edc..f79c3d8 100644
--- a/src/qemu/qemu_hotplug.c
+++ b/src/qemu/qemu_hotplug.c
@@ -3578,6 +3578,7 @@ qemuDomainChangeNet(virQEMUDriver *driver,
olddev->driver.virtio.queues != newdev->driver.virtio.queues ||
olddev->driver.virtio.rx_queue_size != newdev->driver.virtio.rx_queue_size ||
olddev->driver.virtio.tx_queue_size != newdev->driver.virtio.tx_queue_size ||
+ olddev->driver.virtio.page_per_vq != newdev->driver.virtio.page_per_vq ||
olddev->driver.virtio.host.csum != newdev->driver.virtio.host.csum ||
olddev->driver.virtio.host.gso != newdev->driver.virtio.host.gso ||
olddev->driver.virtio.host.tso4 != newdev->driver.virtio.host.tso4 ||
diff --git a/tests/qemuxml2argvdata/net-virtio-page-per-vq.args b/tests/qemuxml2argvdata/net-virtio-page-per-vq.args
new file mode 100644
index 0000000..d7db71f
--- /dev/null
+++ b/tests/qemuxml2argvdata/net-virtio-page-per-vq.args
@@ -0,0 +1,31 @@
+LC_ALL=C \
+PATH=/bin \
+HOME=/tmp/lib/domain--1-QEMUGuest1 \
+USER=test \
+LOGNAME=test \
+XDG_DATA_HOME=/tmp/lib/domain--1-QEMUGuest1/.local/share \
+XDG_CACHE_HOME=/tmp/lib/domain--1-QEMUGuest1/.cache \
+XDG_CONFIG_HOME=/tmp/lib/domain--1-QEMUGuest1/.config \
+QEMU_AUDIO_DRV=none \
+/usr/bin/qemu-system-i386 \
+-name QEMUGuest1 \
+-S \
+-machine pc,accel=tcg,usb=off,dump-guest-core=off \
+-m 214 \
+-realtime mlock=off \
+-smp 1,sockets=1,cores=1,threads=1 \
+-uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \
+-display none \
+-no-user-config \
+-nodefaults \
+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server=on,wait=off \
+-mon chardev=charmonitor,id=monitor,mode=control \
+-rtc base=utc \
+-no-shutdown \
+-no-acpi \
+-usb \
+-drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0 \
+-device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 \
+-netdev user,id=hostnet0 \
+-device virtio-net-pci,page-per-vq=on,netdev=hostnet0,id=net0,mac=00:11:22:33:44:55,bus=pci.0,addr=0x3 \
+-device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x4
diff --git a/tests/qemuxml2argvdata/net-virtio-page-per-vq.xml b/tests/qemuxml2argvdata/net-virtio-page-per-vq.xml
new file mode 100644
index 0000000..e22ecd6
--- /dev/null
+++ b/tests/qemuxml2argvdata/net-virtio-page-per-vq.xml
@@ -0,0 +1,29 @@
+<domain type='qemu'>
+ <name>QEMUGuest1</name>
+ <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid>
+ <memory unit='KiB'>219100</memory>
+ <currentMemory unit='KiB'>219100</currentMemory>
+ <vcpu placement='static'>1</vcpu>
+ <os>
+ <type arch='i686' machine='pc'>hvm</type>
+ <boot dev='hd'/>
+ </os>
+ <clock offset='utc'/>
+ <on_poweroff>destroy</on_poweroff>
+ <on_reboot>restart</on_reboot>
+ <on_crash>destroy</on_crash>
+ <devices>
+ <emulator>/usr/bin/qemu-system-i386</emulator>
+ <disk type='block' device='disk'>
+ <source dev='/dev/HostVG/QEMUGuest1'/>
+ <target dev='hda' bus='ide'/>
+ </disk>
+ <controller type='usb' index='0'/>
+ <interface type='user'>
+ <mac address='00:11:22:33:44:55'/>
+ <model type='virtio'/>
+ <driver page_per_vq='on'/>
+ </interface>
+ <memballoon model='virtio'/>
+ </devices>
+</domain>
diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c
index f0efe98..f6b8f34 100644
--- a/tests/qemuxml2argvtest.c
+++ b/tests/qemuxml2argvtest.c
@@ -1654,6 +1654,8 @@ mymain(void)
QEMU_CAPS_VIRTIO_NET_TX_QUEUE_SIZE);
DO_TEST_PARSE_ERROR("net-virtio-rxqueuesize-invalid-size",
QEMU_CAPS_VIRTIO_NET_RX_QUEUE_SIZE);
+ DO_TEST("net-virtio-page-per-vq",
+ QEMU_CAPS_VIRTIO_NET_PAGE_PER_VQ);
DO_TEST("net-virtio-teaming",
QEMU_CAPS_VIRTIO_NET_FAILOVER,
QEMU_CAPS_DEVICE_VFIO_PCI);
diff --git a/tests/qemuxml2xmloutdata/net-virtio-page-per-vq.xml b/tests/qemuxml2xmloutdata/net-virtio-page-per-vq.xml
new file mode 100644
index 0000000..a35ed8a
--- /dev/null
+++ b/tests/qemuxml2xmloutdata/net-virtio-page-per-vq.xml
@@ -0,0 +1,43 @@
+<domain type='qemu'>
+ <name>QEMUGuest1</name>
+ <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid>
+ <memory unit='KiB'>219100</memory>
+ <currentMemory unit='KiB'>219100</currentMemory>
+ <vcpu placement='static'>1</vcpu>
+ <os>
+ <type arch='i686' machine='pc'>hvm</type>
+ <boot dev='hd'/>
+ </os>
+ <clock offset='utc'/>
+ <on_poweroff>destroy</on_poweroff>
+ <on_reboot>restart</on_reboot>
+ <on_crash>destroy</on_crash>
+ <devices>
+ <emulator>/usr/bin/qemu-system-i386</emulator>
+ <disk type='block' device='disk'>
+ <driver name='qemu' type='raw'/>
+ <source dev='/dev/HostVG/QEMUGuest1'/>
+ <target dev='hda' bus='ide'/>
+ <address type='drive' controller='0' bus='0' target='0' unit='0'/>
+ </disk>
+ <controller type='usb' index='0'>
+ <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x2'/>
+ </controller>
+ <controller type='pci' index='0' model='pci-root'/>
+ <controller type='ide' index='0'>
+ <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x1'/>
+ </controller>
+ <interface type='user'>
+ <mac address='00:11:22:33:44:55'/>
+ <model type='virtio'/>
+ <driver page_per_vq='on'/>
+ <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
+ </interface>
+ <input type='mouse' bus='ps2'/>
+ <input type='keyboard' bus='ps2'/>
+ <audio id='1' type='none'/>
+ <memballoon model='virtio'>
+ <address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/>
+ </memballoon>
+ </devices>
+</domain>
diff --git a/tests/qemuxml2xmltest.c b/tests/qemuxml2xmltest.c
index c37de0c..2bd6eea 100644
--- a/tests/qemuxml2xmltest.c
+++ b/tests/qemuxml2xmltest.c
@@ -450,6 +450,8 @@ mymain(void)
DO_TEST("net-virtio-rxtxqueuesize",
QEMU_CAPS_VIRTIO_NET_RX_QUEUE_SIZE,
QEMU_CAPS_VIRTIO_NET_TX_QUEUE_SIZE);
+ DO_TEST("net-virtio-page-per-vq",
+ QEMU_CAPS_VIRTIO_NET_PAGE_PER_VQ);
DO_TEST("net-virtio-teaming",
QEMU_CAPS_VIRTIO_NET_FAILOVER,
QEMU_CAPS_DEVICE_VFIO_PCI);
--
1.8.3.1
3 years, 7 months