mirror of
https://github.com/libvirt/libvirt.git
synced 2025-02-25 18:55:26 -06:00
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
This commit is contained in:
parent
b7e257c4cc
commit
52a166f493
@ -4353,10 +4353,15 @@ qemuBuildControllerDevStr(virDomainDefPtr domainDef,
|
|||||||
int *nusbcontroller)
|
int *nusbcontroller)
|
||||||
{
|
{
|
||||||
virBuffer buf = VIR_BUFFER_INITIALIZER;
|
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 &&
|
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) {
|
if (def->queues) {
|
||||||
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
|
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
|
||||||
_("'queues' is only supported by virtio-scsi controller"));
|
_("'queues' is only supported by virtio-scsi controller"));
|
||||||
@ -4376,10 +4381,6 @@ qemuBuildControllerDevStr(virDomainDefPtr domainDef,
|
|||||||
|
|
||||||
switch (def->type) {
|
switch (def->type) {
|
||||||
case VIR_DOMAIN_CONTROLLER_TYPE_SCSI:
|
case VIR_DOMAIN_CONTROLLER_TYPE_SCSI:
|
||||||
model = def->model;
|
|
||||||
if ((qemuSetSCSIControllerModel(domainDef, qemuCaps, &model)) < 0)
|
|
||||||
return NULL;
|
|
||||||
|
|
||||||
switch (model) {
|
switch (model) {
|
||||||
case VIR_DOMAIN_CONTROLLER_MODEL_SCSI_VIRTIO_SCSI:
|
case VIR_DOMAIN_CONTROLLER_MODEL_SCSI_VIRTIO_SCSI:
|
||||||
if (def->info.type == VIR_DOMAIN_DEVICE_ADDRESS_TYPE_CCW)
|
if (def->info.type == VIR_DOMAIN_DEVICE_ADDRESS_TYPE_CCW)
|
||||||
|
Loading…
Reference in New Issue
Block a user