On Thu, 2007-07-26 at 10:04 -0500, Anthony Liguori wrote:
> How are you planning on going about switching to container_of()?  Commit 
> this, commit Rusty's stuff, then commit a fix or commit Rusty's stuff, 
> then update your patch set?

My patch is less mature, and am still arguing with Avi about the
details.

So I'll pull in Gregory's patch and try to work mine on top.  They
overlap somewhat, but mine should get rid of some of the warts,
including converting to container_of, and getting rid of "valid".

> >  static void svm_inject_gp(struct kvm_vcpu *vcpu, unsigned error_code)
> >  {
> > -   vcpu->svm->vmcb->control.event_inj =    SVM_EVTINJ_VALID |
> > +   svm(vcpu)->vmcb->control.event_inj =    SVM_EVTINJ_VALID |
> >                                             SVM_EVTINJ_VALID_ERR |
> >                                             SVM_EVTINJ_TYPE_EXEPT |
> >                                             GP_VECTOR;
> > -   vcpu->svm->vmcb->control.event_inj_err = error_code;
> > +   svm(vcpu)->vmcb->control.event_inj_err = error_code;
> >  }
> 
> I'm willing to concede on using the name "svm()" here although I think 

Kernel convention seems to be converging on "to_<typename>", so
"to_vcpu_svm" (although "svm_vcpu" rings better than "vcpu_svm" to me,
but that's minor).

static inline struct vcpu_svm *to_vcpu_svm(struct kvm_vcpu *vcpu)
{
#if LATER
        return container_of(vcpu, struct vcpu_svm, vcpu);
#else
        return vcpu->_priv;
#endif
}

Cheers,
Rusty.


-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/
_______________________________________________
kvm-devel mailing list
kvm-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/kvm-devel

Reply via email to