From nobody Mon Feb 9 22:13:47 2026
Delivered-To: importer@patchew.org
Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28
as permitted sender) client-ip=209.132.183.28;
envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com;
Authentication-Results: mx.zoho.com;
spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as
permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com;
Return-Path:
Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by
mx.zohomail.com
with SMTPS id 1496863672730278.34818852177466;
Wed, 7 Jun 2017 12:27:52 -0700 (PDT)
Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com
[10.5.11.12])
(using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits))
(No client certificate requested)
by mx1.redhat.com (Postfix) with ESMTPS id E60AF85359;
Wed, 7 Jun 2017 19:27:37 +0000 (UTC)
Received: from colo-mx.corp.redhat.com
(colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20])
by smtp.corp.redhat.com (Postfix) with ESMTPS id AFC0B77EE0;
Wed, 7 Jun 2017 19:27:37 +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 54BFF18521C1;
Wed, 7 Jun 2017 19:27:37 +0000 (UTC)
Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com
[10.5.11.11])
by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP
id v57JRN4l028456 for ;
Wed, 7 Jun 2017 15:27:23 -0400
Received: by smtp.corp.redhat.com (Postfix)
id 0681618A81; Wed, 7 Jun 2017 19:27:23 +0000 (UTC)
Received: from icr.brq.redhat.com (dhcp129-58.brq.redhat.com [10.34.129.58])
by smtp.corp.redhat.com (Postfix) with ESMTP id 8438418A82
for ; Wed, 7 Jun 2017 19:27:22 +0000 (UTC)
DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com E60AF85359
Authentication-Results: ext-mx01.extmail.prod.ext.phx2.redhat.com;
dmarc=none (p=none dis=none) header.from=redhat.com
Authentication-Results: ext-mx01.extmail.prod.ext.phx2.redhat.com;
spf=pass smtp.mailfrom=libvir-list-bounces@redhat.com
DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com E60AF85359
From: =?UTF-8?q?J=C3=A1n=20Tomko?=
To: libvir-list@redhat.com
Date: Wed, 7 Jun 2017 21:24:56 +0200
Message-Id:
<7692674dacd9c1debdfc5661ac3b2b2933458548.1496863201.git.jtomko@redhat.com>
In-Reply-To:
References:
In-Reply-To:
References:
X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11
X-loop: libvir-list@redhat.com
Subject: [libvirt] [PATCHv3 06/14] add virtio-related options to memballoon
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: ,
MIME-Version: 1.0
Content-Transfer-Encoding: quoted-printable
Sender: libvir-list-bounces@redhat.com
Errors-To: libvir-list-bounces@redhat.com
X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12
X-Greylist: Sender IP whitelisted,
not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.25]);
Wed, 07 Jun 2017 19:27:38 +0000 (UTC)
X-ZohoMail: RSF_0 Z_629925259 SPT_0
Content-Type: text/plain; charset="utf-8"
https://bugzilla.redhat.com/show_bug.cgi?id=3D1283251
---
docs/formatdomain.html.in | 7 +++++++
docs/schemas/domaincommon.rng | 5 +++++
src/conf/domain_conf.c | 24 ++++++++++++++++++=
++++
src/conf/domain_conf.h | 1 +
.../qemuxml2argv-virtio-options.xml | 1 +
5 files changed, 38 insertions(+)
diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in
index e9ff73b..77ccb2d 100644
--- a/docs/formatdomain.html.in
+++ b/docs/formatdomain.html.in
@@ -6916,6 +6916,7 @@ qemu-kvm -net nic,model=3D? /dev/null
<memballoon model=3D'virtio'>
<address type=3D'pci' domain=3D'0x0000' bus=3D'0x00' slot=3D'0x02=
' function=3D'0x0'/>
<stats period=3D'10'/>
+ <driver iommu=3D'on' ats=3D'on'/>
</memballoon>
</devices>
</domain>
@@ -6960,6 +6961,12 @@ qemu-kvm -net nic,model=3D? /dev/null
Since 1.1.1, requires QEMU 1.5
+ driver
+
+ For model virtio memballoon,
+ Virtio-specific options can also be
+ set. (Since 3.5.0)
+
=20
diff --git a/docs/schemas/domaincommon.rng b/docs/schemas/domaincommon.rng
index 15fd72f..7cea0c5 100644
--- a/docs/schemas/domaincommon.rng
+++ b/docs/schemas/domaincommon.rng
@@ -3784,6 +3784,11 @@
+
+
+ [
+ ]
+
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index 22b8653..58ba1da 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -2305,6 +2305,7 @@ void virDomainMemballoonDefFree(virDomainMemballoonDe=
fPtr def)
return;
=20
virDomainDeviceInfoClear(&def->info);
+ VIR_FREE(def->virtio);
=20
VIR_FREE(def);
}
@@ -12997,6 +12998,9 @@ virDomainMemballoonDefParseXML(xmlNodePtr node,
else if (virDomainDeviceInfoParseXML(node, NULL, &def->info, flags) < =
0)
goto error;
=20
+ if (virDomainVirtioOptionsParseXML(ctxt, &def->virtio) < 0)
+ goto error;
+
cleanup:
VIR_FREE(model);
VIR_FREE(deflate);
@@ -19608,6 +19612,10 @@ virDomainMemballoonDefCheckABIStability(virDomainM=
emballoonDefPtr src,
return false;
}
=20
+ if (src->virtio && dst->virtio &&
+ !virDomainVirtioOptionsCheckABIStability(src->virtio, dst->virtio))
+ return false;
+
if (!virDomainDeviceInfoCheckABIStability(&src->info, &dst->info))
return false;
=20
@@ -22978,6 +22986,22 @@ virDomainMemballoonDefFormat(virBufferPtr buf,
return -1;
}
=20
+ if (def->virtio) {
+ virBuffer driverBuf =3D VIR_BUFFER_INITIALIZER;
+
+ virDomainVirtioOptionsFormat(&driverBuf, def->virtio);
+
+ if (virBufferCheckError(&driverBuf) < 0) {
+ virBufferFreeAndReset(&childrenBuf);
+ return -1;
+ }
+ if (virBufferUse(&driverBuf)) {
+ virBufferAddLit(&childrenBuf, "\n");
+ }
+ }
+
if (!virBufferUse(&childrenBuf)) {
virBufferAddLit(buf, "/>\n");
} else {
diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h
index b3e607b..b6594d3 100644
--- a/src/conf/domain_conf.h
+++ b/src/conf/domain_conf.h
@@ -1609,6 +1609,7 @@ struct _virDomainMemballoonDef {
virDomainDeviceInfo info;
int period; /* seconds between collections */
int autodeflate; /* enum virTristateSwitch */
+ virDomainVirtioOptionsPtr virtio;
};
=20
struct _virDomainNVRAMDef {
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-virtio-options.xml b/tests=
/qemuxml2argvdata/qemuxml2argv-virtio-options.xml
index 3357bc6..b16a984 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-virtio-options.xml
+++ b/tests/qemuxml2argvdata/qemuxml2argv-virtio-options.xml
@@ -73,6 +73,7 @@
+
/dev/random
--=20
2.10.2
--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list