[libvirt] [PATCH] qemu: hotplug virtio_scsi over lsilogic when sicsi controller is not present

It may be better to check virtio-scsi controller first since it is supported better in qemu level. Signed-off-by: Liang Yan<lyan@suse.com> --- src/qemu/qemu_domain_address.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/qemu/qemu_domain_address.c b/src/qemu/qemu_domain_address.c index b5b863fe4..9bec0790f 100644 --- a/src/qemu/qemu_domain_address.c +++ b/src/qemu/qemu_domain_address.c @@ -90,10 +90,10 @@ qemuDomainSetSCSIControllerModel(const virDomainDef *def, } else { if (qemuDomainIsPSeries(def)) { *model = VIR_DOMAIN_CONTROLLER_MODEL_SCSI_IBMVSCSI; - } else if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_SCSI_LSI)) { - *model = VIR_DOMAIN_CONTROLLER_MODEL_SCSI_LSILOGIC; } else if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_VIRTIO_SCSI)) { *model = VIR_DOMAIN_CONTROLLER_MODEL_SCSI_VIRTIO_SCSI; + } else if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_SCSI_LSI)) { + *model = VIR_DOMAIN_CONTROLLER_MODEL_SCSI_LSILOGIC; } else { virReportError(VIR_ERR_INTERNAL_ERROR, "%s", _("Unable to determine model for scsi controller")); -- 2.13.2

On Tue, Jul 11, 2017 at 21:33:49 -0600, Liang Yan wrote:
It may be better to check virtio-scsi controller first since it is supported better in qemu level.
This is not true for OS support. The old controller usually has drivers shipped with the system, whereas you need to install drivers separately for virtio-scsi. I don't think we can change the default easily. NACK
Signed-off-by: Liang Yan<lyan@suse.com>
Your signoff line does not have a space betweent the name and address.
--- src/qemu/qemu_domain_address.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)

On Tue, Jul 11, 2017 at 21:33:49 -0600, Liang Yan wrote:
It may be better to check virtio-scsi controller first since it is supported better in qemu level. This is not true for OS support. The old controller usually has drivers shipped with the system, whereas you need to install drivers separately for virtio-scsi. That is fair, I only thought limited distro this time, my bad, :) We do have some issues recently that attach passthrough lun device could work well with virtio-scsi controller but not lsi controller, we
On 7/12/17 2:49 AM, Peter Krempa wrote: thought it may be better to set a specif controller for "attach-disk" here, what do you say? Do you think is it necessary to add an extra parameter or just fine-grain support for "-targetbus" that could support specific type? or another solution that I missed? I would be glad to implement it. Thanks so much for your response. Best, Liang
I don't think we can change the default easily.
NACK
Signed-off-by: Liang Yan<lyan@suse.com>
Your signoff line does not have a space betweent the name and address.
--- src/qemu/qemu_domain_address.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)

On Wed, Jul 12, 2017 at 23:13:58 -0400, Liang Yan wrote:
On Tue, Jul 11, 2017 at 21:33:49 -0600, Liang Yan wrote:
It may be better to check virtio-scsi controller first since it is supported better in qemu level. This is not true for OS support. The old controller usually has drivers shipped with the system, whereas you need to install drivers separately for virtio-scsi. That is fair, I only thought limited distro this time, my bad, :) We do have some issues recently that attach passthrough lun device could work well with virtio-scsi controller but not lsi controller, we
On 7/12/17 2:49 AM, Peter Krempa wrote: thought it may be better to set a specif controller for "attach-disk" here, what do you say? Do you think is it necessary to add an extra
You need to do this as a separate step. The attach-disk (and the virDomainAttachDevice API) add the controller only if necessary. If you manually add a controller of the correct type beforehand, you have full control what the type is before.
parameter or just fine-grain support for "-targetbus" that could support specific type? or another solution that I missed? I would be glad to implement it.
I don't think it's necessary. It's only necessary to plug the controller in before adding the disk if you require the non-default one.
participants (2)
-
Liang Yan
-
Peter Krempa