diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in
index a0b3632b7e2474d1c5b07f1f363cee7e5004b5b1..0e3799061d93d2c5b8e0cdacb8f6788c2e92c0c4 100644
--- a/docs/formatdomain.html.in
+++ b/docs/formatdomain.html.in
@@ -4201,6 +4201,7 @@
<driver iothread='4'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x0b' function='0x0'/>
</controller>
+ <controller type='xenbus' maxGrantFrames='64'/>
...
</devices>
...
@@ -4256,6 +4257,11 @@
Since 3.10.0 for the vbox driver, the
ide
controller has an optional attribute
model
, which is one of "piix3", "piix4" or "ich6".
+ xenbus
+ Since 5.2.0, the xenbus
+ controller has an optional attribute maxGrantFrames
,
+ which specifies the maximum number of grant frames the controller
+ makes available for connected devices.
diff --git a/docs/schemas/domaincommon.rng b/docs/schemas/domaincommon.rng
index 87ba9daedaa418bf7add5153261214a2e1be5074..1828e0795bd41a6e43a06d6dc025293473faf426 100644
--- a/docs/schemas/domaincommon.rng
+++ b/docs/schemas/domaincommon.rng
@@ -2345,6 +2345,17 @@
+
+
+
+ xenbus
+
+
+
+
+
+
+
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index cfd72215389dd757370b68b5a2bbe3c4a1ad1abd..35001be2a8e7e15a72fc952b0dea11a8b8c8857f 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -347,6 +347,7 @@ VIR_ENUM_IMPL(virDomainController, VIR_DOMAIN_CONTROLLER_TYPE_LAST,
"ccid",
"usb",
"pci",
+ "xenbus",
);
VIR_ENUM_IMPL(virDomainControllerModelPCI, VIR_DOMAIN_CONTROLLER_MODEL_PCI_LAST,
@@ -2073,6 +2074,9 @@ virDomainControllerDefNew(virDomainControllerType type)
def->opts.pciopts.targetIndex = -1;
def->opts.pciopts.numaNode = -1;
break;
+ case VIR_DOMAIN_CONTROLLER_TYPE_XENBUS:
+ def->opts.xenbusopts.maxGrantFrames = -1;
+ break;
case VIR_DOMAIN_CONTROLLER_TYPE_IDE:
case VIR_DOMAIN_CONTROLLER_TYPE_FDC:
case VIR_DOMAIN_CONTROLLER_TYPE_SCSI:
@@ -10718,6 +10722,20 @@ virDomainControllerDefParseXML(virDomainXMLOptionPtr xmlopt,
def->opts.pciopts.numaNode = numaNode;
}
break;
+ case VIR_DOMAIN_CONTROLLER_TYPE_XENBUS: {
+ VIR_AUTOFREE(char *) gntframes = virXMLPropString(node, "maxGrantFrames");
+
+ if (gntframes) {
+ int r = virStrToLong_i(gntframes, NULL, 10,
+ &def->opts.xenbusopts.maxGrantFrames);
+ if (r != 0 || def->opts.xenbusopts.maxGrantFrames < 0) {
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ _("Invalid maxGrantFrames: %s"), gntframes);
+ goto error;
+ }
+ }
+ break;
+ }
default:
break;
@@ -24327,6 +24345,13 @@ virDomainControllerDefFormat(virBufferPtr buf,
}
break;
+ case VIR_DOMAIN_CONTROLLER_TYPE_XENBUS:
+ if (def->opts.xenbusopts.maxGrantFrames != -1) {
+ virBufferAsprintf(&attrBuf, " maxGrantFrames='%d'",
+ def->opts.xenbusopts.maxGrantFrames);
+ }
+ break;
+
default:
break;
}
diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h
index fe9d4fb81aa52347d1c77e79a72f549903929b35..78e7ccb4637f178ff961d16bc0a9ec7a86ac31d2 100644
--- a/src/conf/domain_conf.h
+++ b/src/conf/domain_conf.h
@@ -709,6 +709,7 @@ typedef enum {
VIR_DOMAIN_CONTROLLER_TYPE_CCID,
VIR_DOMAIN_CONTROLLER_TYPE_USB,
VIR_DOMAIN_CONTROLLER_TYPE_PCI,
+ VIR_DOMAIN_CONTROLLER_TYPE_XENBUS,
VIR_DOMAIN_CONTROLLER_TYPE_LAST
} virDomainControllerType;
@@ -852,6 +853,12 @@ struct _virDomainUSBControllerOpts {
int ports; /* -1 == undef */
};
+typedef struct _virDomainXenbusControllerOpts virDomainXenbusControllerOpts;
+typedef virDomainXenbusControllerOpts *virDomainXenbusControllerOptsPtr;
+struct _virDomainXenbusControllerOpts {
+ int maxGrantFrames; /* -1 == undef */
+};
+
/* Stores the virtual disk controller configuration */
struct _virDomainControllerDef {
int type;
@@ -866,6 +873,7 @@ struct _virDomainControllerDef {
virDomainVirtioSerialOpts vioserial;
virDomainPCIControllerOpts pciopts;
virDomainUSBControllerOpts usbopts;
+ virDomainXenbusControllerOpts xenbusopts;
} opts;
virDomainDeviceInfo info;
virDomainVirtioOptionsPtr virtio;
diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
index 5e56447b76b4f5eef72279a6b0e31fc49fcf0fa1..1b82b70cc11bf62ec8da910459bd1994389ef428 100644
--- a/src/qemu/qemu_command.c
+++ b/src/qemu/qemu_command.c
@@ -3146,6 +3146,7 @@ qemuBuildControllerDevStr(const virDomainDef *domainDef,
case VIR_DOMAIN_CONTROLLER_TYPE_IDE:
case VIR_DOMAIN_CONTROLLER_TYPE_FDC:
+ case VIR_DOMAIN_CONTROLLER_TYPE_XENBUS:
case VIR_DOMAIN_CONTROLLER_TYPE_LAST:
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
_("Unsupported controller type: %s"),
diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c
index 788c19c248f5c738c7f74d6cf8929aeefe5e5989..df2f4de262223e15a55f543bfbc5b50a896aba88 100644
--- a/src/qemu/qemu_domain.c
+++ b/src/qemu/qemu_domain.c
@@ -5867,6 +5867,7 @@ qemuDomainDeviceDefValidateController(const virDomainControllerDef *controller,
case VIR_DOMAIN_CONTROLLER_TYPE_VIRTIO_SERIAL:
case VIR_DOMAIN_CONTROLLER_TYPE_CCID:
case VIR_DOMAIN_CONTROLLER_TYPE_USB:
+ case VIR_DOMAIN_CONTROLLER_TYPE_XENBUS:
case VIR_DOMAIN_CONTROLLER_TYPE_LAST:
break;
}
@@ -6519,6 +6520,7 @@ qemuDomainControllerDefPostParse(virDomainControllerDefPtr cont,
case VIR_DOMAIN_CONTROLLER_TYPE_CCID:
case VIR_DOMAIN_CONTROLLER_TYPE_IDE:
case VIR_DOMAIN_CONTROLLER_TYPE_FDC:
+ case VIR_DOMAIN_CONTROLLER_TYPE_XENBUS:
case VIR_DOMAIN_CONTROLLER_TYPE_LAST:
break;
}
diff --git a/src/qemu/qemu_domain_address.c b/src/qemu/qemu_domain_address.c
index 4740536d8291723f16396310289c96e5befa044d..3eccf40eb592270fce9131c3dee7c1695be8dc3d 100644
--- a/src/qemu/qemu_domain_address.c
+++ b/src/qemu/qemu_domain_address.c
@@ -685,6 +685,7 @@ qemuDomainDeviceCalculatePCIConnectFlags(virDomainDeviceDefPtr dev,
case VIR_DOMAIN_CONTROLLER_TYPE_FDC:
case VIR_DOMAIN_CONTROLLER_TYPE_CCID:
+ case VIR_DOMAIN_CONTROLLER_TYPE_XENBUS:
case VIR_DOMAIN_CONTROLLER_TYPE_LAST:
/* should be 0 */
return pciFlags;