Re: [libvirt] [PATCH] qemu: add support for LSI SAS1068 (aka MPT Fusion) SCSI controller

2016-02-22 Thread Paolo Bonzini


- Original Message -
> From: "John Ferlan" 
> To: "Paolo Bonzini" , libvir-list@redhat.com
> Sent: Monday, February 22, 2016 3:00:19 PM
> Subject: Re: [libvirt] [PATCH] qemu: add support for LSI SAS1068 (aka MPT 
> Fusion) SCSI controller
> 
> 
> 
> On 02/11/2016 05:48 AM, Paolo Bonzini wrote:
> > This does nothing more than adding the new device and capability.
> > The device is present since QEMU 2.6.0.
> > 
> > Signed-off-by: Paolo Bonzini 
> > ---
> >  src/qemu/qemu_capabilities.c   |  2 +
> >  src/qemu/qemu_capabilities.h   |  1 +
> >  src/qemu/qemu_command.c| 13 ++-
> >  .../qemuxml2argv-disk-scsi-mptsas1068.args | 27 +
> >  .../qemuxml2argv-disk-scsi-mptsas1068.xml  | 36 ++
> >  tests/qemuxml2argvtest.c   |  4 ++
> >  .../qemuxml2xmlout-disk-scsi-mptsas1068.xml| 44
> >  ++
> >  tests/qemuxml2xmltest.c|  4 ++
> >  8 files changed, 130 insertions(+), 1 deletion(-)
> >  create mode 100644
> >  tests/qemuxml2argvdata/qemuxml2argv-disk-scsi-mptsas1068.args
> >  create mode 100644
> >  tests/qemuxml2argvdata/qemuxml2argv-disk-scsi-mptsas1068.xml
> >  create mode 100644
> >  tests/qemuxml2xmloutdata/qemuxml2xmlout-disk-scsi-mptsas1068.xml
> > 
> 
> Is the '' required to be provided for the  XML if using this
> controller?

No, but on Linux the disks are only visible if you have a WWN, so I
chose to include it in the tests.

Paolo

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


Re: [libvirt] [PATCH] qemu: add support for LSI SAS1068 (aka MPT Fusion) SCSI controller

2016-02-22 Thread John Ferlan


On 02/11/2016 05:48 AM, Paolo Bonzini wrote:
> This does nothing more than adding the new device and capability.
> The device is present since QEMU 2.6.0.
> 
> Signed-off-by: Paolo Bonzini 
> ---
>  src/qemu/qemu_capabilities.c   |  2 +
>  src/qemu/qemu_capabilities.h   |  1 +
>  src/qemu/qemu_command.c| 13 ++-
>  .../qemuxml2argv-disk-scsi-mptsas1068.args | 27 +
>  .../qemuxml2argv-disk-scsi-mptsas1068.xml  | 36 ++
>  tests/qemuxml2argvtest.c   |  4 ++
>  .../qemuxml2xmlout-disk-scsi-mptsas1068.xml| 44 
> ++
>  tests/qemuxml2xmltest.c|  4 ++
>  8 files changed, 130 insertions(+), 1 deletion(-)
>  create mode 100644 
> tests/qemuxml2argvdata/qemuxml2argv-disk-scsi-mptsas1068.args
>  create mode 100644 
> tests/qemuxml2argvdata/qemuxml2argv-disk-scsi-mptsas1068.xml
>  create mode 100644 
> tests/qemuxml2xmloutdata/qemuxml2xmlout-disk-scsi-mptsas1068.xml
> 

Is the '' required to be provided for the  XML if using this
controller?  Something we should probably then check in post processing...

John
> diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c
> index 3099e34..2b953ea 100644
> --- a/src/qemu/qemu_capabilities.c
> +++ b/src/qemu/qemu_capabilities.c
> @@ -314,6 +314,7 @@ VIR_ENUM_IMPL(virQEMUCaps, QEMU_CAPS_LAST,
>  
>"vserport-change-event", /* 210 */
>"virtio-balloon-pci.deflate-on-oom",
> +  "mptsas1068",
>  );
>  
>  
> @@ -1567,6 +1568,7 @@ struct virQEMUCapsStringFlags virQEMUCapsObjectTypes[] 
> = {
>  { "virtio-tablet-pci", QEMU_CAPS_VIRTIO_TABLET },
>  { "virtio-input-host-device", QEMU_CAPS_VIRTIO_INPUT_HOST },
>  { "virtio-input-host-pci", QEMU_CAPS_VIRTIO_INPUT_HOST },
> +{ "mptsas1068", QEMU_CAPS_SCSI_MPTSAS1068 },
>  };
>  
>  static struct virQEMUCapsStringFlags virQEMUCapsObjectPropsVirtioBalloon[] = 
> {
> diff --git a/src/qemu/qemu_capabilities.h b/src/qemu/qemu_capabilities.h
> index e5353de..b73c529 100644
> --- a/src/qemu/qemu_capabilities.h
> +++ b/src/qemu/qemu_capabilities.h
> @@ -343,6 +343,7 @@ typedef enum {
>  QEMU_CAPS_VSERPORT_CHANGE, /* VSERPORT_CHANGE event */
>  QEMU_CAPS_VIRTIO_BALLOON_AUTODEFLATE, /* virtio-balloon-{device,pci,ccw}.
> * deflate-on-oom */
> +QEMU_CAPS_SCSI_MPTSAS1068, /* -device mptsas1068 */
>  
>  QEMU_CAPS_LAST /* this must always be the last item */
>  } virQEMUCapsFlags;
> diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
> index d7f19f3..4d4d65e 100644
> --- a/src/qemu/qemu_command.c
> +++ b/src/qemu/qemu_command.c
> @@ -872,11 +872,19 @@ qemuSetSCSIControllerModel(virDomainDefPtr def,
>  case VIR_DOMAIN_CONTROLLER_MODEL_SCSI_IBMVSCSI:
>  /*TODO: need checking work here if necessary */
>  break;
> +case VIR_DOMAIN_CONTROLLER_MODEL_SCSI_LSISAS1068:
> +if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_SCSI_MPTSAS1068)) {
> +virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
> +   _("This QEMU doesn't support "
> + "the LSI SAS1068 (MPT Fusion) controller"));
> +return -1;
> +}
> +break;
>  case VIR_DOMAIN_CONTROLLER_MODEL_SCSI_LSISAS1078:
>  if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_SCSI_MEGASAS)) {
>  virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
> _("This QEMU doesn't support "
> - "the LSI SAS1078 controller"));
> + "the LSI SAS1078 (MegaRAID) controller"));
>  return -1;
>  }
>  break;
> @@ -4753,6 +4761,9 @@ qemuBuildControllerDevStr(virDomainDefPtr domainDef,
>  case VIR_DOMAIN_CONTROLLER_MODEL_SCSI_IBMVSCSI:
>  virBufferAddLit(&buf, "spapr-vscsi");
>  break;
> +case VIR_DOMAIN_CONTROLLER_MODEL_SCSI_LSISAS1068:
> +virBufferAddLit(&buf, "mptsas1068");
> +break;
>  case VIR_DOMAIN_CONTROLLER_MODEL_SCSI_LSISAS1078:
>  virBufferAddLit(&buf, "megasas");
>  break;
> diff --git a/tests/qemuxml2argvdata/qemuxml2argv-disk-scsi-mptsas1068.args 
> b/tests/qemuxml2argvdata/qemuxml2argv-disk-scsi-mptsas1068.args
> new file mode 100644
> index 000..bdfc1af
> --- /dev/null
> +++ b/tests/qemuxml2argvdata/qemuxml2argv-disk-scsi-mptsas1068.args
> @@ -0,0 +1,27 @@
> +LC_ALL=C \
> +PATH=/bin \
> +HOME=/home/test \
> +USER=test \
> +LOGNAME=test \
> +QEMU_AUDIO_DRV=none \
> +/usr/bin/qemu \
> +-name QEMUGuest1 \
> +-S \
> +-M pc \
> +-m 214 \
> +-smp 1 \
> +-uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \
> +-nographic \
> +-nodefconfig \
> +-nodefaults \
> +-monitor unix:/tmp/test-monitor,server,n

Re: [libvirt] [PATCH] qemu: add support for LSI SAS1068 (aka MPT Fusion) SCSI controller

2016-02-22 Thread Daniel P. Berrange
On Thu, Feb 11, 2016 at 11:48:20AM +0100, Paolo Bonzini wrote:
> This does nothing more than adding the new device and capability.
> The device is present since QEMU 2.6.0.
> 
> Signed-off-by: Paolo Bonzini 
> ---
>  src/qemu/qemu_capabilities.c   |  2 +
>  src/qemu/qemu_capabilities.h   |  1 +
>  src/qemu/qemu_command.c| 13 ++-
>  .../qemuxml2argv-disk-scsi-mptsas1068.args | 27 +
>  .../qemuxml2argv-disk-scsi-mptsas1068.xml  | 36 ++
>  tests/qemuxml2argvtest.c   |  4 ++
>  .../qemuxml2xmlout-disk-scsi-mptsas1068.xml| 44 
> ++
>  tests/qemuxml2xmltest.c|  4 ++
>  8 files changed, 130 insertions(+), 1 deletion(-)
>  create mode 100644 
> tests/qemuxml2argvdata/qemuxml2argv-disk-scsi-mptsas1068.args
>  create mode 100644 
> tests/qemuxml2argvdata/qemuxml2argv-disk-scsi-mptsas1068.xml
>  create mode 100644 
> tests/qemuxml2xmloutdata/qemuxml2xmlout-disk-scsi-mptsas1068.xml

ACK,

It needed a bit of a rebase due to recent moving/refactoring of code,
but I've fixed it up and pushed to git.


Regards,
Daniel
-- 
|: http://berrange.com  -o-http://www.flickr.com/photos/dberrange/ :|
|: http://libvirt.org  -o- http://virt-manager.org :|
|: http://autobuild.org   -o- http://search.cpan.org/~danberr/ :|
|: http://entangle-photo.org   -o-   http://live.gnome.org/gtk-vnc :|

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


Re: [libvirt] [PATCH] qemu: add support for LSI SAS1068 (aka MPT Fusion) SCSI controller

2016-02-20 Thread Paolo Bonzini


On 11/02/2016 11:48, Paolo Bonzini wrote:
> This does nothing more than adding the new device and capability.
> The device is present since QEMU 2.6.0.
> 
> Signed-off-by: Paolo Bonzini 
> ---
>  src/qemu/qemu_capabilities.c   |  2 +
>  src/qemu/qemu_capabilities.h   |  1 +
>  src/qemu/qemu_command.c| 13 ++-
>  .../qemuxml2argv-disk-scsi-mptsas1068.args | 27 +
>  .../qemuxml2argv-disk-scsi-mptsas1068.xml  | 36 ++
>  tests/qemuxml2argvtest.c   |  4 ++
>  .../qemuxml2xmlout-disk-scsi-mptsas1068.xml| 44 
> ++
>  tests/qemuxml2xmltest.c|  4 ++
>  8 files changed, 130 insertions(+), 1 deletion(-)
>  create mode 100644 
> tests/qemuxml2argvdata/qemuxml2argv-disk-scsi-mptsas1068.args
>  create mode 100644 
> tests/qemuxml2argvdata/qemuxml2argv-disk-scsi-mptsas1068.xml
>  create mode 100644 
> tests/qemuxml2xmloutdata/qemuxml2xmlout-disk-scsi-mptsas1068.xml
> 
> diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c
> index 3099e34..2b953ea 100644
> --- a/src/qemu/qemu_capabilities.c
> +++ b/src/qemu/qemu_capabilities.c
> @@ -314,6 +314,7 @@ VIR_ENUM_IMPL(virQEMUCaps, QEMU_CAPS_LAST,
>  
>"vserport-change-event", /* 210 */
>"virtio-balloon-pci.deflate-on-oom",
> +  "mptsas1068",
>  );
>  
>  
> @@ -1567,6 +1568,7 @@ struct virQEMUCapsStringFlags virQEMUCapsObjectTypes[] 
> = {
>  { "virtio-tablet-pci", QEMU_CAPS_VIRTIO_TABLET },
>  { "virtio-input-host-device", QEMU_CAPS_VIRTIO_INPUT_HOST },
>  { "virtio-input-host-pci", QEMU_CAPS_VIRTIO_INPUT_HOST },
> +{ "mptsas1068", QEMU_CAPS_SCSI_MPTSAS1068 },
>  };
>  
>  static struct virQEMUCapsStringFlags virQEMUCapsObjectPropsVirtioBalloon[] = 
> {
> diff --git a/src/qemu/qemu_capabilities.h b/src/qemu/qemu_capabilities.h
> index e5353de..b73c529 100644
> --- a/src/qemu/qemu_capabilities.h
> +++ b/src/qemu/qemu_capabilities.h
> @@ -343,6 +343,7 @@ typedef enum {
>  QEMU_CAPS_VSERPORT_CHANGE, /* VSERPORT_CHANGE event */
>  QEMU_CAPS_VIRTIO_BALLOON_AUTODEFLATE, /* virtio-balloon-{device,pci,ccw}.
> * deflate-on-oom */
> +QEMU_CAPS_SCSI_MPTSAS1068, /* -device mptsas1068 */
>  
>  QEMU_CAPS_LAST /* this must always be the last item */
>  } virQEMUCapsFlags;
> diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
> index d7f19f3..4d4d65e 100644
> --- a/src/qemu/qemu_command.c
> +++ b/src/qemu/qemu_command.c
> @@ -872,11 +872,19 @@ qemuSetSCSIControllerModel(virDomainDefPtr def,
>  case VIR_DOMAIN_CONTROLLER_MODEL_SCSI_IBMVSCSI:
>  /*TODO: need checking work here if necessary */
>  break;
> +case VIR_DOMAIN_CONTROLLER_MODEL_SCSI_LSISAS1068:
> +if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_SCSI_MPTSAS1068)) {
> +virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
> +   _("This QEMU doesn't support "
> + "the LSI SAS1068 (MPT Fusion) controller"));
> +return -1;
> +}
> +break;
>  case VIR_DOMAIN_CONTROLLER_MODEL_SCSI_LSISAS1078:
>  if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_SCSI_MEGASAS)) {
>  virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
> _("This QEMU doesn't support "
> - "the LSI SAS1078 controller"));
> + "the LSI SAS1078 (MegaRAID) controller"));
>  return -1;
>  }
>  break;
> @@ -4753,6 +4761,9 @@ qemuBuildControllerDevStr(virDomainDefPtr domainDef,
>  case VIR_DOMAIN_CONTROLLER_MODEL_SCSI_IBMVSCSI:
>  virBufferAddLit(&buf, "spapr-vscsi");
>  break;
> +case VIR_DOMAIN_CONTROLLER_MODEL_SCSI_LSISAS1068:
> +virBufferAddLit(&buf, "mptsas1068");
> +break;
>  case VIR_DOMAIN_CONTROLLER_MODEL_SCSI_LSISAS1078:
>  virBufferAddLit(&buf, "megasas");
>  break;
> diff --git a/tests/qemuxml2argvdata/qemuxml2argv-disk-scsi-mptsas1068.args 
> b/tests/qemuxml2argvdata/qemuxml2argv-disk-scsi-mptsas1068.args
> new file mode 100644
> index 000..bdfc1af
> --- /dev/null
> +++ b/tests/qemuxml2argvdata/qemuxml2argv-disk-scsi-mptsas1068.args
> @@ -0,0 +1,27 @@
> +LC_ALL=C \
> +PATH=/bin \
> +HOME=/home/test \
> +USER=test \
> +LOGNAME=test \
> +QEMU_AUDIO_DRV=none \
> +/usr/bin/qemu \
> +-name QEMUGuest1 \
> +-S \
> +-M pc \
> +-m 214 \
> +-smp 1 \
> +-uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \
> +-nographic \
> +-nodefconfig \
> +-nodefaults \
> +-monitor unix:/tmp/test-monitor,server,nowait \
> +-no-acpi \
> +-boot c \
> +-device mptsas1068,id=scsi0,bus=pci.0,addr=0x3 \
> +-usb \
> +-drive file=/dev/HostVG/QEMUGuest1,format=raw,