qemuBuildHostdevSCSIAttachPrepare is supposed to prepare the data
structure used for attaching the hostdev not preparing the hostdev
definition itself. Move the corresponding bits to qemuDomainPrepareHostdev
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
src = scsisrc->u.host.src;
- src->type = VIR_STORAGE_TYPE_BLOCK;
src->path = g_strdup_printf("/dev/%s", devstr);
break;
return NULL;
}
- src->readonly = hostdev->readonly;
ret->storageNodeName = src->nodestorage;
*backendAlias = src->nodestorage;
virObjectUnref(scsisrc->u.host.src);
scsisrc->u.host.src = virStorageSourceNew();
src = scsisrc->u.host.src;
+
+ src->type = VIR_STORAGE_TYPE_BLOCK;
+
break;
case VIR_DOMAIN_HOSTDEV_SCSI_PROTOCOL_TYPE_ISCSI:
if (src) {
const char *backendalias = hostdev->info->alias;
+ src->readonly = hostdev->readonly;
+
if (virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_BLOCKDEV_HOSTDEV_SCSI)) {
src->id = qemuDomainStorageIdNew(priv);
src->nodestorage = g_strdup_printf("libvirt-%d-backend", src->id);