From 1d94891288286bdd1c2d4eea1940f32de56bb09c Mon Sep 17 00:00:00 2001 From: Paolo Bonzini Date: Mon, 25 Feb 2013 18:44:26 +0100 Subject: [PATCH] domain: add support for iscsi network disks This plumbs in the XML description of iSCSI shares. The next patches will add support for the libiscsi userspace initiator. Signed-off-by: Paolo Bonzini --- docs/formatdomain.html.in | 10 +++++-- docs/schemas/domaincommon.rng | 1 + src/conf/domain_conf.c | 3 ++- src/conf/domain_conf.h | 1 + .../qemuxml2argv-disk-drive-network-iscsi.xml | 27 +++++++++++++++++++ tests/qemuxml2xmltest.c | 1 + 6 files changed, 40 insertions(+), 3 deletions(-) create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-disk-drive-network-iscsi.xml diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in index e83bdd0649..e4ed3f7f35 100644 --- a/docs/formatdomain.html.in +++ b/docs/formatdomain.html.in @@ -1443,7 +1443,7 @@ to the directory to use as the disk. If the disk type is "network", then the protocol attribute specifies the protocol to access to the requested image; possible values - are "nbd", "rbd", "sheepdog" or "gluster". If the + are "nbd", "iscsi", "rbd", "sheepdog" or "gluster". If the protocol attribute is "rbd", "sheepdog" or "gluster", an additional attribute name is mandatory to specify which volume/image will be used; for "nbd" it is optional. When the disk @@ -1451,7 +1451,8 @@ or more host sub-elements used to specify the hosts to connect. Since 0.0.3; type='dir' since - 0.7.5; type='network' since 0.8.7
+ 0.7.5; type='network' since + 0.8.7; protocol='iscsi' since 1.0.4
For a "file" disk type which represents a cdrom or floppy (the device attribute), it is possible to define policy what to do with the disk if the source file is not accessible. @@ -1702,6 +1703,11 @@ a server running nbd-server only one + + iscsi + an iSCSI server + only one + rbd monitor servers of RBD diff --git a/docs/schemas/domaincommon.rng b/docs/schemas/domaincommon.rng index 90647df7a6..c4e7b7abb0 100644 --- a/docs/schemas/domaincommon.rng +++ b/docs/schemas/domaincommon.rng @@ -1090,6 +1090,7 @@ rbd sheepdog gluster + iscsi diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index fa70329176..b06cae5793 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -250,7 +250,8 @@ VIR_ENUM_IMPL(virDomainDiskProtocol, VIR_DOMAIN_DISK_PROTOCOL_LAST, "nbd", "rbd", "sheepdog", - "gluster") + "gluster", + "iscsi") VIR_ENUM_IMPL(virDomainDiskProtocolTransport, VIR_DOMAIN_DISK_PROTO_TRANS_LAST, "tcp", diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h index 6d856a3934..a750a1f862 100644 --- a/src/conf/domain_conf.h +++ b/src/conf/domain_conf.h @@ -500,6 +500,7 @@ enum virDomainDiskProtocol { VIR_DOMAIN_DISK_PROTOCOL_RBD, VIR_DOMAIN_DISK_PROTOCOL_SHEEPDOG, VIR_DOMAIN_DISK_PROTOCOL_GLUSTER, + VIR_DOMAIN_DISK_PROTOCOL_ISCSI, VIR_DOMAIN_DISK_PROTOCOL_LAST }; diff --git a/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-network-iscsi.xml b/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-network-iscsi.xml new file mode 100644 index 0000000000..dd8503261e --- /dev/null +++ b/tests/qemuxml2argvdata/qemuxml2argv-disk-drive-network-iscsi.xml @@ -0,0 +1,27 @@ + + QEMUGuest1 + c7a5fdbd-edaf-9455-926a-d65c16db1809 + 219136 + 219136 + 1 + + hvm + + + + destroy + restart + destroy + + /usr/bin/qemu + + + + + + + + + + + diff --git a/tests/qemuxml2xmltest.c b/tests/qemuxml2xmltest.c index 09d81e04e5..41613ea95c 100644 --- a/tests/qemuxml2xmltest.c +++ b/tests/qemuxml2xmltest.c @@ -174,6 +174,7 @@ mymain(void) DO_TEST("disk-drive-network-nbd-ipv6"); DO_TEST("disk-drive-network-nbd-ipv6-export"); DO_TEST("disk-drive-network-nbd-unix"); + DO_TEST("disk-drive-network-iscsi"); DO_TEST("disk-scsi-device"); DO_TEST("disk-scsi-vscsi"); DO_TEST("disk-scsi-virtio-scsi");