qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH 2/2] virtio-scsi: Implement fc_host feature


From: Fam Zheng
Subject: Re: [Qemu-devel] [PATCH 2/2] virtio-scsi: Implement fc_host feature
Date: Wed, 18 Jan 2017 08:02:08 +0800
User-agent: Mutt/1.7.1 (2016-10-04)

On Tue, 01/17 10:54, Stefan Hajnoczi wrote:
> On Tue, Jan 17, 2017 at 12:07:30AM +0800, Fam Zheng wrote:
> >  static void virtio_scsi_device_realize(DeviceState *dev, Error **errp)
> >  {
> >      VirtIODevice *vdev = VIRTIO_DEVICE(dev);
> >      VirtIOSCSI *s = VIRTIO_SCSI(dev);
> > +    VirtIOSCSICommon *vs = VIRTIO_SCSI_COMMON(dev);
> >      Error *err = NULL;
> >  
> > +    if (vs->conf.fc_host) {
> > +        if (!strcmp(vs->conf.fc_host, "off")) {
> > +            vs->conf.primary_wwpn = 0;
> > +            vs->conf.primary_wwnn = 0;
> > +            vs->conf.secondary_wwpn = 0;
> > +            vs->conf.secondary_wwnn = 0;
> > +        } else if (!strcmp(vs->conf.fc_host, "primary") ||
> > +                   !strcmp(vs->conf.fc_host, "secondary")) {
> > +            virtio_add_feature(&vdev->host_features, 
> > VIRTIO_SCSI_F_FC_HOST);
> > +            vs->conf.primary_active = !strcmp(vs->conf.fc_host, "primary");
> > +            if (!vs->conf.primary_wwpn) {
> > +                error_setg(errp, "fc_host enabled but primary_wwpn not 
> > set");
> > +                return;
> > +            }
> > +            if (!vs->conf.primary_wwnn) {
> > +                error_setg(errp, "fc_host enabled but primary_wwnn not 
> > set");
> > +                return;
> > +            }
> > +            if (!vs->conf.secondary_wwpn) {
> > +                error_setg(errp, "fc_host enabled but secondary_wwpn not 
> > set");
> > +                return;
> > +            }
> > +            if (!vs->conf.secondary_wwnn) {
> > +                error_setg(errp, "fc_host enabled but secondary_wwnn not 
> > set");
> > +                return;
> > +            }
> > +            s->vm_state_change =
> > +                
> > qemu_add_vm_change_state_handler(virtio_scsi_vm_state_change, s);
> 
> Missing qemu_del_vm_change_state_handler() in .unrealize() and in error
> code paths in this function.

Will fix it. Thanks!

Fam




reply via email to

[Prev in Thread] Current Thread [Next in Thread]