From nobody Fri May 16 10:57:36 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 14961488141775.671952922446735;
Tue, 30 May 2017 05:53:34 -0700 (PDT)
Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com
[10.5.11.14])
(using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits))
(No client certificate requested)
by mx1.redhat.com (Postfix) with ESMTPS id 250AA448D66;
Tue, 30 May 2017 12:53:30 +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 EE6A27E399;
Tue, 30 May 2017 12:53:29 +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 A1573180BAF5;
Tue, 30 May 2017 12:53:29 +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 v4UCrRIE013265 for ;
Tue, 30 May 2017 08:53:27 -0400
Received: by smtp.corp.redhat.com (Postfix)
id D220219E97; Tue, 30 May 2017 12:53:27 +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 98F085C7A7;
Tue, 30 May 2017 12:53:21 +0000 (UTC)
DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 250AA448D66
Authentication-Results: ext-mx05.extmail.prod.ext.phx2.redhat.com;
dmarc=none (p=none dis=none) header.from=redhat.com
Authentication-Results: ext-mx05.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 250AA448D66
From: =?UTF-8?q?J=C3=A1n=20Tomko?=
To: libvir-list@redhat.com
Date: Tue, 30 May 2017 14:50:33 +0200
Message-Id:
<12a88187de197550979c9e751f0f75ae4dec9595.1496148357.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
Cc: jasowang@redhat.com
Subject: [libvirt] [PATCH 10/18] 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.14
X-Greylist: Sender IP whitelisted,
not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]);
Tue, 30 May 2017 12:53:31 +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 a83f7dc..ae7cb14 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -2284,6 +2284,7 @@ void virDomainMemballoonDefFree(virDomainMemballoonDe=
fPtr def)
return;
=20
virDomainDeviceInfoClear(&def->info);
+ VIR_FREE(def->virtio);
=20
VIR_FREE(def);
}
@@ -12947,6 +12948,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);
@@ -22896,6 +22900,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 68f8d0c..3a95c64 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