diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in
index 5e89a92401..97dffc8b50 100644
--- a/docs/formatdomain.html.in
+++ b/docs/formatdomain.html.in
@@ -2506,6 +2506,12 @@
Indicates that the device is readonly, only supported by SCSI host
device now. Since 1.0.6 (QEMU and KVM only)
+ shareable
+ If present, this indicates the device is expected to be shared
+ between domains (assuming the hypervisor and OS support this).
+ Only supported by SCSI host device.
+ Since 1.0.6
+
diff --git a/docs/schemas/domaincommon.rng b/docs/schemas/domaincommon.rng
index 361794e9b1..548838f90d 100644
--- a/docs/schemas/domaincommon.rng
+++ b/docs/schemas/domaincommon.rng
@@ -3135,6 +3135,11 @@
+
+
+
+
+
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index 81e8087df7..781a7b648a 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -8829,6 +8829,8 @@ virDomainHostdevDefParseXML(const xmlNodePtr node,
if (virXPathBoolean("boolean(./readonly)", ctxt))
def->readonly = true;
+ if (virXPathBoolean("boolean(./shareable)", ctxt))
+ def->shareable = true;
break;
}
}
@@ -15457,6 +15459,8 @@ virDomainHostdevDefFormat(virBufferPtr buf,
if (def->readonly)
virBufferAddLit(buf, " \n");
+ if (def->shareable)
+ virBufferAddLit(buf, " \n");
virBufferAdjustIndent(buf, -6);
if (virDomainDeviceInfoFormat(buf, def->info,
diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h
index c176a4cd3a..7716dab608 100644
--- a/src/conf/domain_conf.h
+++ b/src/conf/domain_conf.h
@@ -462,6 +462,7 @@ struct _virDomainHostdevDef {
bool managed;
bool missing;
bool readonly;
+ bool shareable;
union {
virDomainHostdevSubsys subsys;
virDomainHostdevCaps caps;
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-hostdev-scsi-shareable.xml b/tests/qemuxml2argvdata/qemuxml2argv-hostdev-scsi-shareable.xml
new file mode 100644
index 0000000000..f9ce8af594
--- /dev/null
+++ b/tests/qemuxml2argvdata/qemuxml2argv-hostdev-scsi-shareable.xml
@@ -0,0 +1,36 @@
+
+ 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 807b623417..ba492d141f 100644
--- a/tests/qemuxml2xmltest.c
+++ b/tests/qemuxml2xmltest.c
@@ -294,6 +294,7 @@ mymain(void)
DO_TEST("hostdev-scsi-readonly");
DO_TEST("disk-copy_on_read");
+ DO_TEST("hostdev-scsi-shareable");
virObjectUnref(driver.caps);
virObjectUnref(driver.xmlopt);