[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Xen-devel] [PATCH v2 07/10] vm_event: Add vm_event_ng interface
> + > +out: > + rc2 = xc_domain_unpause(xch, domain_id); > + if ( rc1 || rc2 ) > + { > + if ( rc2 ) > + PERROR("Unable to pause domain\n"); > + > + if ( rc1 == 0 ) > + rc1 = rc2; You can use !rc1 here. > + } > + > + return rc1; > +} > + > +int xc_vm_event_ng_disable(xc_interface *xch, uint32_t domain_id, int type, > + xenforeignmemory_resource_handle **fres) > +{ > + xenforeignmemory_unmap_resource(xch->fmem, *fres); > + *fres = NULL; > + > + return xc_vm_event_control(xch, domain_id, XEN_VM_EVENT_DISABLE, > + type, XEN_VM_EVENT_FLAGS_NG_OP, NULL); > +} > + > > +static int vm_event_ring_pfn_param(uint32_t type) > +{ > + switch( type ) > + { > +#ifdef CONFIG_HAS_MEM_PAGING > + case XEN_VM_EVENT_TYPE_PAGING: > + return HVM_PARAM_PAGING_RING_PFN; > +#endif > + case XEN_VM_EVENT_TYPE_MONITOR: > + return HVM_PARAM_MONITOR_RING_PFN; > +#ifdef CONFIG_HAS_MEM_SHARING > + case XEN_VM_EVENT_TYPE_SHARING: > + return HVM_PARAM_SHARING_RING_PFN; > +#endif > + }; > + > + ASSERT_UNREACHABLE(); > + return -1; Blank line before final return... > +} > + > +static int vm_event_pause_flag(uint32_t type) > +{ > + switch( type ) > + { > +#ifdef CONFIG_HAS_MEM_PAGING > + case XEN_VM_EVENT_TYPE_PAGING: > + return _VPF_mem_paging; > +#endif > + case XEN_VM_EVENT_TYPE_MONITOR: > + return _VPF_mem_access; > +#ifdef CONFIG_HAS_MEM_SHARING > + case XEN_VM_EVENT_TYPE_SHARING: > + return _VPF_mem_sharing; > +#endif > + }; > + > + ASSERT_UNREACHABLE(); > + return -1; here > +} > + > +#ifdef CONFIG_HAS_MEM_PAGING > +static void mem_paging_notification(struct vcpu *v, unsigned int port); > +#endif > +static void monitor_notification(struct vcpu *v, unsigned int port); > +#ifdef CONFIG_HAS_MEM_SHARING > +static void mem_sharing_notification(struct vcpu *v, unsigned int port); > +#endif > + > +static xen_event_channel_notification_t vm_event_notification_fn(uint32_t > type) > +{ > + switch( type ) > + { > +#ifdef CONFIG_HAS_MEM_PAGING > + case XEN_VM_EVENT_TYPE_PAGING: > + return mem_paging_notification; > +#endif > + case XEN_VM_EVENT_TYPE_MONITOR: > + return monitor_notification; > +#ifdef CONFIG_HAS_MEM_SHARING > + case XEN_VM_EVENT_TYPE_SHARING: > + return mem_sharing_notification; > +#endif > + }; > + > + ASSERT_UNREACHABLE(); > + return NULL; and here > +} > + > +/* > + * VM event ring implementation; > + */ Alex _______________________________________________ Xen-devel mailing list Xen-devel@xxxxxxxxxxxxxxxxxxxx https://lists.xenproject.org/mailman/listinfo/xen-devel
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |