Re: [PATCH] qemu: Use scsi-block for lun passthrough instead of scsi-disk

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Il 12/03/2012 14:55, Osier Yang ha scritto:
> -            if (!qemuCapsGet(qemuCaps, QEMU_CAPS_SCSI_DISK_CHANNEL)) {
> -                if (disk->info.addr.drive.target > 7) {
> -                    qemuReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
> -                                    _("This QEMU doesn't support target "
> -                                      "greater than 7"));
> -                    goto error;
> -                }
> +            if ((disk->device != VIR_DOMAIN_DISK_DEVICE_LUN)) {
> +                if (!qemuCapsGet(qemuCaps, QEMU_CAPS_SCSI_DISK_CHANNEL)) {
> +                    if (disk->info.addr.drive.target > 7) {
> +                        qemuReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
> +                                        _("This QEMU doesn't support target "
> +                                          "greater than 7"));
> +                        goto error;
> +                    }
>  
> -                if ((disk->info.addr.drive.bus != disk->info.addr.drive.unit) &&
> -                    (disk->info.addr.drive.bus != 0)) {
> -                    qemuReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
> -                                    _("This QEMU only supports both bus and "
> -                                      "unit equal to 0"));
> -                    goto error;
> +                    if ((disk->info.addr.drive.bus != disk->info.addr.drive.unit) &&
> +                        (disk->info.addr.drive.bus != 0)) {
> +                        qemuReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
> +                                        _("This QEMU only supports both bus and "
> +                                          "unit equal to 0"));
> +                        goto error;
> +                    }
>                  }
> +                virBufferAddLit(&opt, "scsi-disk");
> +            } else {
> +                virBufferAddLit(&opt, "scsi-block");
>              }
>  
> -            virBufferAddLit(&opt, "scsi-disk");

Why not the simpler:

-            virBufferAddLit(&opt, "scsi-disk");
+            if (disk->device == VIR_DOMAIN_DISK_DEVICE_LUN)
+                virBufferAddLit(&opt, "scsi-disk");
+            else
+                virBufferAddLit(&opt, "scsi-block");

as in the case above for lsilogic?  Am I missing something obvious?

Paolo

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list


[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]