aboutsummaryrefslogtreecommitdiff
path: root/block/iscsi.c
diff options
context:
space:
mode:
Diffstat (limited to 'block/iscsi.c')
-rw-r--r--block/iscsi.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/block/iscsi.c b/block/iscsi.c
index fd954d4c1f..219f927823 100644
--- a/block/iscsi.c
+++ b/block/iscsi.c
@@ -896,6 +896,7 @@ static char *parse_initiator_name(const char *target)
QemuOptsList *list;
QemuOpts *opts;
const char *name = NULL;
+ const char *iscsi_name = qemu_get_vm_name();
list = qemu_find_opts("iscsi");
if (list) {
@@ -911,7 +912,9 @@ static char *parse_initiator_name(const char *target)
if (name) {
return g_strdup(name);
} else {
- return g_strdup("iqn.2008-11.org.linux-kvm");
+ return g_strdup_printf("iqn.2008-11.org.linux-kvm%s%s",
+ iscsi_name ? ":" : "",
+ iscsi_name ? iscsi_name : "");
}
}