From patchwork Fri Feb 8 22:12:02 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cole Robinson X-Patchwork-Id: 157887 Delivered-To: patch@linaro.org Received: by 2002:a02:48:0:0:0:0:0 with SMTP id 69csp1644jaa; Fri, 8 Feb 2019 14:13:12 -0800 (PST) X-Google-Smtp-Source: AHgI3IbbxroSagCUZODeWh257AaMZwP8PGD5ZKzlobCzJSZ9yVLWwV9m3eW4xtd1FNw7glPhfXzj X-Received: by 2002:a0c:a1c6:: with SMTP id e64mr18038326qva.196.1549663992092; Fri, 08 Feb 2019 14:13:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549663992; cv=none; d=google.com; s=arc-20160816; b=lAIAr82/zootgOE+oSGY/yu5KJ4c4cze8kFmatp4yo3bY3eLfgwp9mtJUyaTmQsb9S KbIcRs2Qs4obT1e7S/qzOAHo6JJl77rNcUZk+r8xIfo8tEo4agCjEO8NQsL+Docyr06x TE3Y1uJY5sg7mrVhLQfRnGks4Sm4dZUexgveZMQ4oHInFilhAfspyDxjlSKLNwQX7AbP 7JO4+YVINUoDPjvGtmi9VHCnW5/N6IaY9LV0StThGXx/rDsSLPdW8zw+TdohaXLD00yF U4SzQ8LmqpasyWeAJTPC5Nik4WUUzA5VKq1c2emH2INMlKq6qgZeiyP2bgq2msK55C+2 W58w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:sender:content-transfer-encoding:list-subscribe:list-help :list-post:list-archive:list-unsubscribe:list-id:precedence:subject :cc:mime-version:references:in-reply-to:message-id:date:to:from :delivered-to; bh=t04kmLM6/2N1jIj0uWlRDbuaaRFEqSl8ADy+CLMRRwo=; b=IR+wWK+N/V1MBR7refSbI/EHZWiIOB08aVyhLKQy2yizzP6n2TzMsYOXbSJaGqRgpC 5+CwHIM+ATP7ChOySOQhcFeys14wrZZ7NJs0AAtWb8gOnyiOx6SYvbEqCToqYGQA8k8X MbI/XI5MevIfvSXwdYZZ4D4whCqktWvE0lKeqkL9jyCIZGbJLqZ7twoD4WNG3rdC8dII yp79AE5gHShVjMciRherQwg6cdylkbLumOV8wWO/fTme0rVNrbmLu+OhfEzDxR32FI8+ idnfaFXXbmrc3ax8cW/XDeEdkYj7YQ3Lrd74bvQY/TWRPFzdolDk1Hnz048eovmVL84X iW2g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of libvir-list-bounces@redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com. [209.132.183.28]) by mx.google.com with ESMTPS id d12si256539qtb.76.2019.02.08.14.13.11 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 08 Feb 2019 14:13:12 -0800 (PST) Received-SPF: pass (google.com: domain of libvir-list-bounces@redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; Authentication-Results: mx.google.com; spf=pass (google.com: domain of libvir-list-bounces@redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 09218C0740E4; Fri, 8 Feb 2019 22:13:10 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id C5E48101962E; Fri, 8 Feb 2019 22:13:09 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 832FE3D39A; Fri, 8 Feb 2019 22:13:09 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x18MCQlF008468 for ; Fri, 8 Feb 2019 17:12:26 -0500 Received: by smtp.corp.redhat.com (Postfix) id A612F5C6A6; Fri, 8 Feb 2019 22:12:26 +0000 (UTC) Delivered-To: libvirt-list@redhat.com Received: from worklaptop.redhat.com (ovpn-123-115.rdu2.redhat.com [10.10.123.115]) by smtp.corp.redhat.com (Postfix) with ESMTP id 3298A1F8; Fri, 8 Feb 2019 22:12:26 +0000 (UTC) From: Cole Robinson To: libvirt-list@redhat.com Date: Fri, 8 Feb 2019 17:12:02 -0500 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-loop: libvir-list@redhat.com Cc: Andrea Bolognani Subject: [libvirt] [PATCH v3 11/17] qemu: Support memballoon model=virtio-{non-}transitional X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Fri, 08 Feb 2019 22:13:11 +0000 (UTC) Add new model values for virtio transitional devices. Ex: * "virtio-transitional" maps to qemu "virtio-balloon-pci-transitional" * "virtio-non-transitional" maps to qemu "virtio-balloon-pci-non-transitional" Reviewed-by: Andrea Bolognani Signed-off-by: Cole Robinson --- docs/formatdomain.html.in | 4 ++++ docs/schemas/domaincommon.rng | 2 ++ src/conf/domain_conf.c | 2 ++ src/conf/domain_conf.h | 2 ++ src/libxl/libxl_conf.c | 2 ++ src/qemu/qemu_command.c | 6 +++++- src/qemu/qemu_domain.c | 4 +++- src/qemu/qemu_domain_address.c | 3 +++ .../virtio-non-transitional.x86_64-3.1.0.args | 5 ++++- .../virtio-non-transitional.x86_64-latest.args | 4 +++- tests/qemuxml2argvdata/virtio-non-transitional.xml | 2 +- .../virtio-transitional.x86_64-3.1.0.args | 4 +++- .../virtio-transitional.x86_64-latest.args | 3 ++- tests/qemuxml2argvdata/virtio-transitional.xml | 2 +- tests/qemuxml2xmloutdata/virtio-non-transitional.xml | 11 +++++++++-- tests/qemuxml2xmloutdata/virtio-transitional.xml | 6 ++++-- 16 files changed, 50 insertions(+), 12 deletions(-) -- 2.20.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list Reviewed-by: Andrea Bolognani diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in index e84e71fda8..4a1ba83cd8 100644 --- a/docs/formatdomain.html.in +++ b/docs/formatdomain.html.in @@ -7944,8 +7944,12 @@ qemu-kvm -net nic,model=? /dev/null

  • 'virtio' - default with QEMU/KVM
  • +
  • 'virtio-transitional' Since 5.1.0
  • +
  • 'virtio-non-transitional' Since 5.1.0
  • 'xen' - default with Xen
+ See Virtio transitional devices + for more details.
autodeflate
diff --git a/docs/schemas/domaincommon.rng b/docs/schemas/domaincommon.rng index a26f5d9548..94c358b578 100644 --- a/docs/schemas/domaincommon.rng +++ b/docs/schemas/domaincommon.rng @@ -4093,6 +4093,8 @@ virtio + virtio-transitional + virtio-non-transitional xen none diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 5e2f24de1b..e4484f9982 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -593,6 +593,8 @@ VIR_ENUM_IMPL(virDomainMemballoonModel, VIR_DOMAIN_MEMBALLOON_MODEL_LAST, "virtio", "xen", "none", + "virtio-transitional", + "virtio-non-transitional", ); VIR_ENUM_IMPL(virDomainSmbiosMode, VIR_DOMAIN_SMBIOS_LAST, diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h index f836919d6f..40da1b40b7 100644 --- a/src/conf/domain_conf.h +++ b/src/conf/domain_conf.h @@ -1733,6 +1733,8 @@ typedef enum { VIR_DOMAIN_MEMBALLOON_MODEL_VIRTIO, VIR_DOMAIN_MEMBALLOON_MODEL_XEN, VIR_DOMAIN_MEMBALLOON_MODEL_NONE, + VIR_DOMAIN_MEMBALLOON_MODEL_VIRTIO_TRANSITIONAL, + VIR_DOMAIN_MEMBALLOON_MODEL_VIRTIO_NON_TRANSITIONAL, VIR_DOMAIN_MEMBALLOON_MODEL_LAST } virDomainMemballoonModel; diff --git a/src/libxl/libxl_conf.c b/src/libxl/libxl_conf.c index 0e08b8f0a2..c769050ff1 100644 --- a/src/libxl/libxl_conf.c +++ b/src/libxl/libxl_conf.c @@ -718,6 +718,8 @@ libxlMakeDomBuildInfo(virDomainDefPtr def, case VIR_DOMAIN_MEMBALLOON_MODEL_XEN: break; case VIR_DOMAIN_MEMBALLOON_MODEL_VIRTIO: + case VIR_DOMAIN_MEMBALLOON_MODEL_VIRTIO_TRANSITIONAL: + case VIR_DOMAIN_MEMBALLOON_MODEL_VIRTIO_NON_TRANSITIONAL: virReportError(VIR_ERR_CONFIG_UNSUPPORTED, _("unsupported balloon device model '%s'"), virDomainMemballoonModelTypeToString(model)); diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index efb108989f..b843408402 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -502,6 +502,11 @@ qemuBuildVirtioDevStr(virBufferPtr buf, has_ntmodel = device.data.fs->model == VIR_DOMAIN_FS_MODEL_VIRTIO_NON_TRANSITIONAL; break; + case VIR_DOMAIN_DEVICE_MEMBALLOON: + has_tmodel = device.data.memballoon->model == VIR_DOMAIN_MEMBALLOON_MODEL_VIRTIO_TRANSITIONAL; + has_ntmodel = device.data.memballoon->model == VIR_DOMAIN_MEMBALLOON_MODEL_VIRTIO_NON_TRANSITIONAL; + break; + case VIR_DOMAIN_DEVICE_LEASE: case VIR_DOMAIN_DEVICE_INPUT: case VIR_DOMAIN_DEVICE_SOUND: @@ -514,7 +519,6 @@ qemuBuildVirtioDevStr(virBufferPtr buf, case VIR_DOMAIN_DEVICE_NONE: case VIR_DOMAIN_DEVICE_SMARTCARD: case VIR_DOMAIN_DEVICE_CHR: - case VIR_DOMAIN_DEVICE_MEMBALLOON: case VIR_DOMAIN_DEVICE_NVRAM: case VIR_DOMAIN_DEVICE_SHMEM: case VIR_DOMAIN_DEVICE_TPM: diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index 4e9c179db3..16929ea656 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -6027,7 +6027,9 @@ qemuDomainDeviceDefValidateMemballoon(const virDomainMemballoonDef *memballoon, return 0; } - if (memballoon->model != VIR_DOMAIN_MEMBALLOON_MODEL_VIRTIO) { + if (memballoon->model != VIR_DOMAIN_MEMBALLOON_MODEL_VIRTIO && + memballoon->model != VIR_DOMAIN_MEMBALLOON_MODEL_VIRTIO_TRANSITIONAL && + memballoon->model != VIR_DOMAIN_MEMBALLOON_MODEL_VIRTIO_NON_TRANSITIONAL) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, _("Memory balloon device type '%s' is not supported by this version of qemu"), virDomainMemballoonModelTypeToString(memballoon->model)); diff --git a/src/qemu/qemu_domain_address.c b/src/qemu/qemu_domain_address.c index 01343357f7..c1a6d94a4c 100644 --- a/src/qemu/qemu_domain_address.c +++ b/src/qemu/qemu_domain_address.c @@ -882,7 +882,10 @@ qemuDomainDeviceCalculatePCIConnectFlags(virDomainDeviceDefPtr dev, case VIR_DOMAIN_DEVICE_MEMBALLOON: switch ((virDomainMemballoonModel) dev->data.memballoon->model) { case VIR_DOMAIN_MEMBALLOON_MODEL_VIRTIO: + case VIR_DOMAIN_MEMBALLOON_MODEL_VIRTIO_NON_TRANSITIONAL: return virtioFlags; + case VIR_DOMAIN_MEMBALLOON_MODEL_VIRTIO_TRANSITIONAL: + return pciFlags; case VIR_DOMAIN_MEMBALLOON_MODEL_XEN: case VIR_DOMAIN_MEMBALLOON_MODEL_NONE: diff --git a/tests/qemuxml2argvdata/virtio-non-transitional.x86_64-3.1.0.args b/tests/qemuxml2argvdata/virtio-non-transitional.x86_64-3.1.0.args index 38a9cab582..30e8e4244e 100644 --- a/tests/qemuxml2argvdata/virtio-non-transitional.x86_64-3.1.0.args +++ b/tests/qemuxml2argvdata/virtio-non-transitional.x86_64-3.1.0.args @@ -30,6 +30,7 @@ addr=0x1 \ -device pcie-root-port,port=0xb,chassis=4,id=pci.4,bus=pcie.0,addr=0x1.0x3 \ -device pcie-root-port,port=0xc,chassis=5,id=pci.5,bus=pcie.0,addr=0x1.0x4 \ -device pcie-root-port,port=0xd,chassis=6,id=pci.6,bus=pcie.0,addr=0x1.0x5 \ +-device pcie-root-port,port=0xe,chassis=7,id=pci.7,bus=pcie.0,addr=0x1.0x6 \ -drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-virtio-disk0 \ -device virtio-blk-pci,disable-legacy=on,disable-modern=off,scsi=off,bus=pci.3,\ addr=0x0,drive=drive-virtio-disk0,id=virtio-disk0,bootindex=1 \ @@ -41,9 +42,11 @@ fsdev=fsdev-fs0,mount_tag=fs1,bus=pci.1,addr=0x0 \ id=net0,mac=00:11:22:33:44:55,bus=pci.2,addr=0x0 \ -device vhost-scsi-pci,disable-legacy=on,disable-modern=off,\ wwpn=naa.5123456789abcde0,vhostfd=3,id=hostdev0,bus=pci.4,addr=0x0 \ +-device virtio-balloon-pci,disable-legacy=on,disable-modern=off,id=balloon0,\ +bus=pci.5,addr=0x0 \ -object rng-random,id=objrng0,filename=/dev/urandom \ -device virtio-rng-pci,disable-legacy=on,disable-modern=off,rng=objrng0,\ -id=rng0,bus=pci.5,addr=0x0 \ +id=rng0,bus=pci.6,addr=0x0 \ -sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,\ resourcecontrol=deny \ -msg timestamp=on diff --git a/tests/qemuxml2argvdata/virtio-non-transitional.x86_64-latest.args b/tests/qemuxml2argvdata/virtio-non-transitional.x86_64-latest.args index 8c571c04f1..dbf7a4ef15 100644 --- a/tests/qemuxml2argvdata/virtio-non-transitional.x86_64-latest.args +++ b/tests/qemuxml2argvdata/virtio-non-transitional.x86_64-latest.args @@ -30,6 +30,7 @@ addr=0x1 \ -device pcie-root-port,port=0xb,chassis=4,id=pci.4,bus=pcie.0,addr=0x1.0x3 \ -device pcie-root-port,port=0xc,chassis=5,id=pci.5,bus=pcie.0,addr=0x1.0x4 \ -device pcie-root-port,port=0xd,chassis=6,id=pci.6,bus=pcie.0,addr=0x1.0x5 \ +-device pcie-root-port,port=0xe,chassis=7,id=pci.7,bus=pcie.0,addr=0x1.0x6 \ -drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-virtio-disk0 \ -device virtio-blk-pci-non-transitional,scsi=off,bus=pci.3,addr=0x0,\ drive=drive-virtio-disk0,id=virtio-disk0,bootindex=1 \ @@ -41,8 +42,9 @@ bus=pci.1,addr=0x0 \ mac=00:11:22:33:44:55,bus=pci.2,addr=0x0 \ -device vhost-scsi-pci-non-transitional,wwpn=naa.5123456789abcde0,vhostfd=3,\ id=hostdev0,bus=pci.4,addr=0x0 \ +-device virtio-balloon-pci-non-transitional,id=balloon0,bus=pci.5,addr=0x0 \ -object rng-random,id=objrng0,filename=/dev/urandom \ --device virtio-rng-pci-non-transitional,rng=objrng0,id=rng0,bus=pci.5,addr=0x0 \ +-device virtio-rng-pci-non-transitional,rng=objrng0,id=rng0,bus=pci.6,addr=0x0 \ -sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,\ resourcecontrol=deny \ -msg timestamp=on diff --git a/tests/qemuxml2argvdata/virtio-non-transitional.xml b/tests/qemuxml2argvdata/virtio-non-transitional.xml index eec8b544e2..6d9691c1e5 100644 --- a/tests/qemuxml2argvdata/virtio-non-transitional.xml +++ b/tests/qemuxml2argvdata/virtio-non-transitional.xml @@ -26,6 +26,6 @@ - + diff --git a/tests/qemuxml2argvdata/virtio-transitional.x86_64-3.1.0.args b/tests/qemuxml2argvdata/virtio-transitional.x86_64-3.1.0.args index 796a29044c..b7cb304891 100644 --- a/tests/qemuxml2argvdata/virtio-transitional.x86_64-3.1.0.args +++ b/tests/qemuxml2argvdata/virtio-transitional.x86_64-3.1.0.args @@ -38,9 +38,11 @@ fsdev=fsdev-fs0,mount_tag=fs1,bus=pci.2,addr=0x1 \ id=net0,mac=00:11:22:33:44:55,bus=pci.2,addr=0x2 \ -device vhost-scsi-pci,disable-legacy=off,disable-modern=off,\ wwpn=naa.5123456789abcde0,vhostfd=3,id=hostdev0,bus=pci.2,addr=0x4 \ +-device virtio-balloon-pci,disable-legacy=off,disable-modern=off,id=balloon0,\ +bus=pci.2,addr=0x5 \ -object rng-random,id=objrng0,filename=/dev/urandom \ -device virtio-rng-pci,disable-legacy=off,disable-modern=off,rng=objrng0,\ -id=rng0,bus=pci.2,addr=0x5 \ +id=rng0,bus=pci.2,addr=0x6 \ -sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,\ resourcecontrol=deny \ -msg timestamp=on diff --git a/tests/qemuxml2argvdata/virtio-transitional.x86_64-latest.args b/tests/qemuxml2argvdata/virtio-transitional.x86_64-latest.args index eb8da465f6..77332549bf 100644 --- a/tests/qemuxml2argvdata/virtio-transitional.x86_64-latest.args +++ b/tests/qemuxml2argvdata/virtio-transitional.x86_64-latest.args @@ -38,8 +38,9 @@ bus=pci.2,addr=0x1 \ mac=00:11:22:33:44:55,bus=pci.2,addr=0x2 \ -device vhost-scsi-pci-transitional,wwpn=naa.5123456789abcde0,vhostfd=3,\ id=hostdev0,bus=pci.2,addr=0x4 \ +-device virtio-balloon-pci-transitional,id=balloon0,bus=pci.2,addr=0x5 \ -object rng-random,id=objrng0,filename=/dev/urandom \ --device virtio-rng-pci-transitional,rng=objrng0,id=rng0,bus=pci.2,addr=0x5 \ +-device virtio-rng-pci-transitional,rng=objrng0,id=rng0,bus=pci.2,addr=0x6 \ -sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,\ resourcecontrol=deny \ -msg timestamp=on diff --git a/tests/qemuxml2argvdata/virtio-transitional.xml b/tests/qemuxml2argvdata/virtio-transitional.xml index cb23d4d7a8..43c55e9d31 100644 --- a/tests/qemuxml2argvdata/virtio-transitional.xml +++ b/tests/qemuxml2argvdata/virtio-transitional.xml @@ -26,6 +26,6 @@ - + diff --git a/tests/qemuxml2xmloutdata/virtio-non-transitional.xml b/tests/qemuxml2xmloutdata/virtio-non-transitional.xml index 18ef85092a..721dccbaef 100644 --- a/tests/qemuxml2xmloutdata/virtio-non-transitional.xml +++ b/tests/qemuxml2xmloutdata/virtio-non-transitional.xml @@ -55,6 +55,11 @@
+ + + +
+ @@ -71,10 +76,12 @@
- + +
+ /dev/urandom -
+
diff --git a/tests/qemuxml2xmloutdata/virtio-transitional.xml b/tests/qemuxml2xmloutdata/virtio-transitional.xml index 334cfaa6e4..2402c5f227 100644 --- a/tests/qemuxml2xmloutdata/virtio-transitional.xml +++ b/tests/qemuxml2xmloutdata/virtio-transitional.xml @@ -55,10 +55,12 @@
- + +
+ /dev/urandom -
+