From nobody Fri May 16 08:14:42 2025
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 1496749235962791.8962596541033;
Tue, 6 Jun 2017 04:40:35 -0700 (PDT)
Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com
[10.5.11.11])
(using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits))
(No client certificate requested)
by mx1.redhat.com (Postfix) with ESMTPS id 6FF4580474;
Tue, 6 Jun 2017 11:40:32 +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 3CACE5B827;
Tue, 6 Jun 2017 11:40:32 +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 E913D4A48E;
Tue, 6 Jun 2017 11:40:13 +0000 (UTC)
Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com
[10.5.11.12])
by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP
id v56Bcn0v001932 for ;
Tue, 6 Jun 2017 07:38:49 -0400
Received: by smtp.corp.redhat.com (Postfix)
id CF99C756BF; Tue, 6 Jun 2017 11:38:49 +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 56A09756C4
for ; Tue, 6 Jun 2017 11:38:49 +0000 (UTC)
DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 6FF4580474
Authentication-Results: ext-mx04.extmail.prod.ext.phx2.redhat.com;
dmarc=none (p=none dis=none) header.from=redhat.com
Authentication-Results: ext-mx04.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 6FF4580474
From: =?UTF-8?q?J=C3=A1n=20Tomko?=
To: libvir-list@redhat.com
Date: Tue, 6 Jun 2017 13:36:21 +0200
Message-Id:
<3d5d4e073be275057fc2ee28a3b7d8a475bec2f0.1496748930.git.jtomko@redhat.com>
In-Reply-To:
References:
In-Reply-To:
References:
X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12
X-loop: libvir-list@redhat.com
Subject: [libvirt] [PATCHv2 07/15] 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.11
X-Greylist: Sender IP whitelisted,
not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]);
Tue, 06 Jun 2017 11:40:33 +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 | 21 +++++++++++++++++=
++++
src/conf/domain_conf.h | 1 +
.../qemuxml2argv-virtio-options.xml | 1 +
.../qemuxml2xmlout-virtio-options.xml | 1 +
6 files changed, 36 insertions(+)
diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in
index dcc2e5e..c286f50 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_platform=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 d7f3b02..5b424c7 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 ef3383d..7744563 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -2291,6 +2291,7 @@ void virDomainMemballoonDefFree(virDomainMemballoonDe=
fPtr def)
return;
=20
virDomainDeviceInfoClear(&def->info);
+ VIR_FREE(def->virtio);
=20
VIR_FREE(def);
}
@@ -12954,6 +12955,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);
@@ -22908,6 +22912,23 @@ virDomainMemballoonDefFormat(virBufferPtr buf,
return -1;
}
=20
+ if (def->virtio) {
+ virBuffer driverBuf =3D VIR_BUFFER_INITIALIZER;
+
+ virDomainVirtioOptionsFormat(&driverBuf, def->virtio);
+ virBufferTrim(&driverBuf, " ", -1);
+
+ 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 a17f217..a3bb2cf 100644
--- a/src/conf/domain_conf.h
+++ b/src/conf/domain_conf.h
@@ -1616,6 +1616,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 a2bbbee..96ec700 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-virtio-options.xml
+++ b/tests/qemuxml2argvdata/qemuxml2argv-virtio-options.xml
@@ -85,6 +85,7 @@
+
/dev/random
diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-virtio-options.xml b/t=
ests/qemuxml2xmloutdata/qemuxml2xmlout-virtio-options.xml
index a2bbbee..96ec700 100644
--- a/tests/qemuxml2xmloutdata/qemuxml2xmlout-virtio-options.xml
+++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-virtio-options.xml
@@ -85,6 +85,7 @@
+
/dev/random
--=20
2.10.2
--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list