On Tue, Mar 01, 2011 at 02:20:02PM +0200, Michael S. Tsirkin wrote:
> On Tue, Mar 01, 2011 at 02:10:37PM +0800, Sheng Yang wrote:
> > On Monday 28 February 2011 19:27:29 Michael S. Tsirkin wrote:
> > > On Mon, Feb 28, 2011 at 03:20:04PM +0800, Sheng Yang wrote:
> > > > @@ -1877,6 +1879,24 @@ static long kvm_vm_ioctl(struct file *filp,
> > > > 
> > > >                 mutex_unlock(&kvm->lock);
> > > >                 break;
> > > >  
> > > >  #endif
> > > > 
> > > > +       case KVM_REGISTER_MSIX_MMIO: {
> > > > +               struct kvm_msix_mmio_user mmio_user;
> > > > +
> > > > +               r = -EFAULT;
> > > > +               if (copy_from_user(&mmio_user, argp, sizeof mmio_user))
> > > > +                       goto out;
> > > > +               r = kvm_vm_ioctl_register_msix_mmio(kvm, &mmio_user);
> > > > +               break;
> > > > +       }
> > > > +       case KVM_UNREGISTER_MSIX_MMIO: {
> > > > +               struct kvm_msix_mmio_user mmio_user;
> > > > +
> > > > +               r = -EFAULT;
> > > > +               if (copy_from_user(&mmio_user, argp, sizeof mmio_user))
> > > > +                       goto out;
> > > > +               r = kvm_vm_ioctl_unregister_msix_mmio(kvm, &mmio_user);
> > > > +               break;
> > > > +       }
> > > > 
> > > >         default:
> > > >                 r = kvm_arch_vm_ioctl(filp, ioctl, arg);
> > > >                 if (r == -ENOTTY)
> > > > 
> > > > @@ -1988,6 +2008,12 @@ static int kvm_dev_ioctl_create_vm(void)
> > > > 
> > > >                 return r;
> > > >         
> > > >         }
> > > >  
> > > >  #endif
> > > > 
> > > > +       r = kvm_register_msix_mmio_dev(kvm);
> > > > +       if (r < 0) {
> > > > +               kvm_put_kvm(kvm);
> > > > +               return r;
> > > > +       }
> > > > +
> > > 
> > > Need to fix error handling below as well?
> > > Better do it with chained gotos if yes.
> > 
> > Let's make it another separate patch. 
> 
> Well you add a new failure mode, you need to cleanup
> properly ...

Oh, I think kvm_put_kvm() should take care of this?

-- 
regards
Yang, Sheng
--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to