- Indicates whether the disk is needs rawio capability; valid
+ Indicates whether the disk needs rawio capability. Valid
settings are "yes" or "no" (default is "no"). If any one disk
in a domain has rawio='yes', rawio capability will be enabled
for all disks in the domain (because, in the case of QEMU, this
@@ -2925,7 +2925,7 @@
...
<devices>
- <hostdev mode='subsystem' type='scsi'>
+ <hostdev mode='subsystem' type='scsi' sgio='filtered' rawio='yes'>
<source>
<adapter name='scsi_host0'/>
<address type='scsi' bus='0' target='0' unit='0'/>
@@ -2984,7 +2984,13 @@
(since 1.0.6) attribute indicates
whether the kernel will filter unprivileged SG_IO commands for
the disk, valid settings are "filtered" or "unfiltered".
- The default is "filtered".
+ The default is "filtered". The optional rawio
+ (since 1.2.9) attribute indicates
+ whether the lun needs the rawio capability. Valid settings are
+ "yes" or "no". See the rawio description within the
+ disk section.
+ If a disk lun in the domain already has the rawio capability,
+ then this setting not required.
diff --git a/docs/schemas/domaincommon.rng b/docs/schemas/domaincommon.rng
index 19dc82f16e6f8c2e25fa7513173cfe3d2182696d..36bc184cc37a62490a52c30b9420fb723e930fd7 100644
--- a/docs/schemas/domaincommon.rng
+++ b/docs/schemas/domaincommon.rng
@@ -1252,9 +1252,7 @@
-
-
-
+
@@ -3577,6 +3575,9 @@
+
+
+
@@ -4937,4 +4938,9 @@
+
+
+
+
+
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index c240c8365fdaa05a707992c288b79c6b42b7a7b5..bb4a4cb9b3c395437826b8fbbd912203c8a2af63 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -4504,6 +4504,7 @@ virDomainHostdevDefParseXMLSubsys(xmlNodePtr node,
xmlNodePtr sourcenode;
char *managed = NULL;
char *sgio = NULL;
+ char *rawio = NULL;
char *backendStr = NULL;
int backend;
int ret = -1;
@@ -4521,6 +4522,7 @@ virDomainHostdevDefParseXMLSubsys(xmlNodePtr node,
}
sgio = virXMLPropString(node, "sgio");
+ rawio = virXMLPropString(node, "rawio");
/* @type is passed in from the caller rather than read from the
* xml document, because it is specified in different places for
@@ -4572,6 +4574,21 @@ virDomainHostdevDefParseXMLSubsys(xmlNodePtr node,
}
}
+ if (rawio) {
+ if (def->source.subsys.type != VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_SCSI) {
+ virReportError(VIR_ERR_XML_ERROR, "%s",
+ _("rawio is only supported for scsi host device"));
+ goto error;
+ }
+
+ if ((scsisrc->rawio = virTristateBoolTypeFromString(rawio)) <= 0) {
+ virReportError(VIR_ERR_XML_ERROR,
+ _("unknown hostdev rawio setting '%s'"),
+ rawio);
+ goto error;
+ }
+ }
+
switch (def->source.subsys.type) {
case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_PCI:
if (virDomainHostdevSubsysPCIDefParseXML(sourcenode, def, flags) < 0)
@@ -4611,6 +4628,7 @@ virDomainHostdevDefParseXMLSubsys(xmlNodePtr node,
error:
VIR_FREE(managed);
VIR_FREE(sgio);
+ VIR_FREE(rawio);
VIR_FREE(backendStr);
return ret;
}
@@ -17804,6 +17822,12 @@ virDomainHostdevDefFormat(virBufferPtr buf,
scsisrc->sgio)
virBufferAsprintf(buf, " sgio='%s'",
virDomainDeviceSGIOTypeToString(scsisrc->sgio));
+
+ if (def->source.subsys.type == VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_SCSI &&
+ scsisrc->rawio) {
+ virBufferAsprintf(buf, " rawio='%s'",
+ virTristateBoolTypeToString(scsisrc->rawio));
+ }
}
virBufferAddLit(buf, ">\n");
virBufferAdjustIndent(buf, 2);
diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h
index afd9943af1d1a5f25337b83c108a56581a2595f4..47a18516d2bcd0d4281bfb89109ab416571604a9 100644
--- a/src/conf/domain_conf.h
+++ b/src/conf/domain_conf.h
@@ -439,6 +439,7 @@ typedef virDomainHostdevSubsysSCSI *virDomainHostdevSubsysSCSIPtr;
struct _virDomainHostdevSubsysSCSI {
int protocol; /* enum virDomainHostdevSCSIProtocolType */
int sgio; /* enum virDomainDeviceSGIO */
+ int rawio; /* enum virTristateBool */
union {
virDomainHostdevSubsysSCSIHost host;
virDomainHostdevSubsysSCSIiSCSI iscsi;
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-hostdev-scsi-rawio.xml b/tests/qemuxml2argvdata/qemuxml2argv-hostdev-scsi-rawio.xml
new file mode 100644
index 0000000000000000000000000000000000000000..69fdde37d637136575d3b6174cf8876f19d1eed1
--- /dev/null
+++ b/tests/qemuxml2argvdata/qemuxml2argv-hostdev-scsi-rawio.xml
@@ -0,0 +1,35 @@
+
+ QEMUGuest2
+ c7a5fdbd-edaf-9466-926a-d65c16db1809
+ 219100
+ 219100
+ 1
+
+ hvm
+
+
+
+ destroy
+ restart
+ destroy
+
+ /usr/bin/qemu
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/tests/qemuxml2xmltest.c b/tests/qemuxml2xmltest.c
index 675403a1ff77f7dde1140cabc719174e647c9e23..56a371ea38d9b08e85ca6748098709f6d70f0ab1 100644
--- a/tests/qemuxml2xmltest.c
+++ b/tests/qemuxml2xmltest.c
@@ -369,6 +369,7 @@ mymain(void)
DO_TEST("disk-copy_on_read");
DO_TEST("hostdev-scsi-shareable");
DO_TEST("hostdev-scsi-sgio");
+ DO_TEST("hostdev-scsi-rawio");
DO_TEST_DIFFERENT("hostdev-scsi-autogen-address");