From 52a166f493970f0eb2b9c96ac3544904564e209b Mon Sep 17 00:00:00 2001 From: Ján Tomko Date: Feb 25 2015 09:04:58 +0000 Subject: Assign default SCSI controller model before checking attribute validity If the qemu binary on x86 does not support lsi SCSI controller, but it supports virtio-scsi, we reject the virtio-specific attributes for no reason. Move the default controller assignment before the check. https://bugzilla.redhat.com/show_bug.cgi?id=1168849 --- diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index fb3d5ab..dd06f09 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -4353,10 +4353,15 @@ qemuBuildControllerDevStr(virDomainDefPtr domainDef, int *nusbcontroller) { virBuffer buf = VIR_BUFFER_INITIALIZER; - int model; + int model = def->model; + + if (def->type == VIR_DOMAIN_CONTROLLER_TYPE_SCSI) { + if ((qemuSetSCSIControllerModel(domainDef, qemuCaps, &model)) < 0) + return NULL; + } if (!(def->type == VIR_DOMAIN_CONTROLLER_TYPE_SCSI && - def->model == VIR_DOMAIN_CONTROLLER_MODEL_SCSI_VIRTIO_SCSI)) { + model == VIR_DOMAIN_CONTROLLER_MODEL_SCSI_VIRTIO_SCSI)) { if (def->queues) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", _("'queues' is only supported by virtio-scsi controller")); @@ -4376,10 +4381,6 @@ qemuBuildControllerDevStr(virDomainDefPtr domainDef, switch (def->type) { case VIR_DOMAIN_CONTROLLER_TYPE_SCSI: - model = def->model; - if ((qemuSetSCSIControllerModel(domainDef, qemuCaps, &model)) < 0) - return NULL; - switch (model) { case VIR_DOMAIN_CONTROLLER_MODEL_SCSI_VIRTIO_SCSI: if (def->info.type == VIR_DOMAIN_DEVICE_ADDRESS_TYPE_CCW)