mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-03-07 17:28:15 +00:00
qemu: do not support non-network disks without -drive
QEMU added -drive in 2007, and NBD in 2008. Both appeared first in release 0.10.0. Thus the code to support network disks without -drive is dead, and in fact it incorrectly escapes commas. Drop it. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
This commit is contained in:
parent
73cc87d161
commit
af9474557e
@ -6284,57 +6284,8 @@ qemuBuildCommandLine(virConnectPtr conn,
|
|||||||
goto no_memory;
|
goto no_memory;
|
||||||
}
|
}
|
||||||
} else if (disk->type == VIR_DOMAIN_DISK_TYPE_NETWORK) {
|
} else if (disk->type == VIR_DOMAIN_DISK_TYPE_NETWORK) {
|
||||||
switch (disk->protocol) {
|
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
||||||
case VIR_DOMAIN_DISK_PROTOCOL_NBD:
|
_("network disks are only supported with -drive"));
|
||||||
if (disk->nhosts != 1) {
|
|
||||||
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
|
||||||
_("NBD accepts only one host"));
|
|
||||||
goto error;
|
|
||||||
}
|
|
||||||
if (virAsprintf(&file, "nbd:%s:%s,", disk->hosts->name,
|
|
||||||
disk->hosts->port) < 0) {
|
|
||||||
goto no_memory;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case VIR_DOMAIN_DISK_PROTOCOL_RBD:
|
|
||||||
{
|
|
||||||
virBuffer opt = VIR_BUFFER_INITIALIZER;
|
|
||||||
if (qemuBuildRBDString(conn, disk, &opt) < 0)
|
|
||||||
goto error;
|
|
||||||
if (virBufferError(&opt)) {
|
|
||||||
virReportOOMError();
|
|
||||||
goto error;
|
|
||||||
}
|
|
||||||
file = virBufferContentAndReset(&opt);
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case VIR_DOMAIN_DISK_PROTOCOL_GLUSTER:
|
|
||||||
{
|
|
||||||
virBuffer opt = VIR_BUFFER_INITIALIZER;
|
|
||||||
if (qemuBuildGlusterString(disk, &opt) < 0)
|
|
||||||
goto error;
|
|
||||||
if (virBufferError(&opt)) {
|
|
||||||
virReportOOMError();
|
|
||||||
goto error;
|
|
||||||
}
|
|
||||||
file = virBufferContentAndReset(&opt);
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case VIR_DOMAIN_DISK_PROTOCOL_SHEEPDOG:
|
|
||||||
if (disk->nhosts == 0) {
|
|
||||||
if (virAsprintf(&file, "sheepdog:%s,", disk->src) < 0) {
|
|
||||||
goto no_memory;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
/* only one host is supported now */
|
|
||||||
if (virAsprintf(&file, "sheepdog:%s:%s:%s,",
|
|
||||||
disk->hosts->name, disk->hosts->port,
|
|
||||||
disk->src) < 0) {
|
|
||||||
goto no_memory;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
if (!(file = strdup(disk->src))) {
|
if (!(file = strdup(disk->src))) {
|
||||||
goto no_memory;
|
goto no_memory;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user