virt-install: Add support for xenbus controller

libvirt commit 09eb1ae0 added support for a new 'xenbus' controller
type. Add support for the controller in virtinst, including support
for the maxGrantFrames attribute.

Reviewed-by: Cole Robinson <crobinso@redhat.com>
Signed-off-by: Jim Fehlig <jfehlig@suse.com>
This commit is contained in:
Jim Fehlig 2019-03-20 14:24:41 -06:00 committed by Cole Robinson
parent 7afbb90b4d
commit 8d9743d69f
5 changed files with 10 additions and 2 deletions

View File

@ -187,6 +187,7 @@
<controller type="scsi" index="0" model="virtio-scsi">
<driver queues="4"/>
</controller>
<controller type="xenbus" index="0" maxGrantFrames="64"/>
<filesystem type="mount" accessmode="mapped">
<source dir="/source"/>
<target dir="/target"/>

View File

@ -22,6 +22,7 @@
<source file="/dev/default-pool/testvol1.img"/>
<target dev="xvda" bus="xen"/>
</disk>
<controller type="xenbus" index="0" maxGrantFrames="64"/>
<interface type="bridge">
<source bridge="eth0"/>
<mac address="00:11:22:33:44:55"/>
@ -51,6 +52,7 @@
<source file="/dev/default-pool/testvol1.img"/>
<target dev="xvda" bus="xen"/>
</disk>
<controller type="xenbus" index="0" maxGrantFrames="64"/>
<interface type="bridge">
<source bridge="eth0"/>
<mac address="00:11:22:33:44:55"/>

View File

@ -510,6 +510,7 @@ c.add_compare(""" \
--controller usb,model=ich9-uhci2,address=0:0:4.1,index=0,master=2 \
--controller usb,model=ich9-uhci3,address=0:0:4.2,index=0,master=4 \
--controller scsi,model=virtio-scsi,driver_queues=4 \
--controller xenbus,maxGrantFrames=64 \
\
--input type=keyboard,bus=usb \
--input tablet \
@ -840,7 +841,7 @@ c.add_compare("--init /usr/bin/httpd", "manual-init")
c = vinst.add_category("xen", "--noautoconsole --connect " + utils.URIs.xen)
c.add_valid("--disk %(EXISTIMG1)s --location %(TREEDIR)s --paravirt --graphics none") # Xen PV install headless
c.add_compare("--disk %(EXISTIMG1)s --import", "xen-default") # Xen default
c.add_compare("--disk %(EXISTIMG1)s --location %(TREEDIR)s --paravirt", "xen-pv") # Xen PV
c.add_compare("--disk %(EXISTIMG1)s --location %(TREEDIR)s --paravirt --controller xenbus,maxGrantFrames=64", "xen-pv") # Xen PV
c.add_compare("--disk /iscsi-pool/diskvol1 --cdrom %(EXISTIMG1)s --livecd --hvm", "xen-hvm") # Xen HVM

View File

@ -2647,6 +2647,7 @@ class ParserController(VirtCLIParser):
cls.add_arg("index", "index")
cls.add_arg("master_startport", "master")
cls.add_arg("driver_queues", "driver_queues")
cls.add_arg("maxGrantFrames", "maxGrantFrames")
cls.add_arg(None, "address", cb=cls.set_server_cb)

View File

@ -19,6 +19,7 @@ class DeviceController(Device):
TYPE_USB = "usb"
TYPE_PCI = "pci"
TYPE_CCID = "ccid"
TYPE_XENBUS = "xenbus"
@staticmethod
def get_recommended_types(_guest):
@ -38,6 +39,7 @@ class DeviceController(Device):
DeviceController.TYPE_USB: "USB",
DeviceController.TYPE_PCI: "PCI",
DeviceController.TYPE_CCID: "CCID",
DeviceController.TYPE_XENBUS: "xenbus",
}
if ctype not in pretty_mappings:
@ -86,7 +88,7 @@ class DeviceController(Device):
return ctrl
_XML_PROP_ORDER = ["type", "index", "model", "master_startport", "driver_queues"]
_XML_PROP_ORDER = ["type", "index", "model", "master_startport", "driver_queues", "maxGrantFrames"]
type = XMLProperty("./@type")
model = XMLProperty("./@model")
@ -94,6 +96,7 @@ class DeviceController(Device):
ports = XMLProperty("./@ports", is_int=True)
master_startport = XMLProperty("./master/@startport", is_int=True)
driver_queues = XMLProperty("./driver/@queues", is_int=True)
maxGrantFrames = XMLProperty("./@maxGrantFrames", is_int=True)
index = XMLProperty("./@index", is_int=True)