//int  hyperxl_domain_start(libxl_ctx* ctx, hyperxl_domain_config* config);
192494
func HyperxlDomainStart(ctx LibxlCtxPtr, config *DomainConfig) (int, unsafe.Pointer, int) {
	cc := config.toC()
	res := (int)(C.hyperxl_domain_start((*C.struct_libxl__ctx)(ctx), cc))
	return (int)(cc.domid), cc.ev, res
}
665671
func HyperxlNicAdd(ctx LibxlCtxPtr, domid uint32, ip, bridge, gatewaydev, ifname string, mac []byte) int {
	var nic *HyperxlNicConfig = &HyperxlNicConfig{
		ip:         C.CString(ip),
		bridge:     C.CString(bridge),
		gatewaydev: C.CString(gatewaydev),
		mac:        (*C.char)(unsafe.Pointer(&mac[0])),
		ifname:     C.CString(ifname),
	}
	return (int)(C.hyperxl_nic_add((*C.struct_libxl__ctx)(ctx), (C.uint32_t)(domid), (*C.struct_hyperxl_nic_config)(nic)))
}
837585
func licenseDefinition() (*design.LicenseDefinition, bool) {
	l, ok := dslengine.CurrentDefinition().(*design.LicenseDefinition)
	if !ok {
		dslengine.IncompatibleDSL()
	}
	return l, ok
}
406813
func (app *App) Domain(domain string) *Router {
	app.domainListLock.Lock()
	if app.domains[domain] == nil {
		app.domains[domain] = &Router{
			router: newRouter(),
			app:    app,
		}
	}
	app.domainListLock.Unlock()
	return app.domains[domain]
}
224413
func hyperxl_log_cgo(msg *C.char, len C.int) {
	if glog.V(1) {
		glog.Info("[libxl] ", C.GoStringN(msg, len))
	}
}
1137247
func (b *builder) start() {
	graphname := "unnamed"
	if b.config.Title != "" {
		graphname = b.config.Title
	}
	fmt.Fprintln(b, `digraph "`+graphname+`" {`)
	fmt.Fprintln(b, `node [style=filled fillcolor="#f8f8f8"]`)
}
689496
func HyperxlNicRemove(ctx LibxlCtxPtr, domid uint32, mac string) int {
	return (int)(C.hyperxl_nic_remove((*C.struct_libxl__ctx)(ctx), (C.uint32_t)(domid), C.CString(mac)))
}
476889
func (o *Enterprise) CreateL2Domain(child *L2Domain) *bambou.Error {

	return bambou.CurrentSession().CreateChild(o, child)
}
1146884
func (s *S3) Start() error {

	if s.Domain == "" {
		s.Domain = S3DefaultDomain
	}

	if s.Bucket == "" {
		return errors.New("s3 bucket is undefined")
	}

	var s3p *s3gof3r.S3
	if s.AccessKey != "" && s.SecretKey != "" {
		s3p = s3gof3r.New(
			s.Domain,
			s3gof3r.Keys{
				AccessKey: s.AccessKey,
				SecretKey: s.SecretKey})
	} else if keys, err := s3gof3r.EnvKeys(); err != nil {
		return err
	} else {
		s3p = s3gof3r.New(s.Domain, keys)
	}
	s.bucket = s3p.Bucket(s.Bucket)
	return nil
}
32295
func HyperxlDomainDestroy(ctx LibxlCtxPtr, domid uint32) int {
	return (int)(C.hyperxl_domain_destroy((*C.struct_libxl__ctx)(ctx), (C.uint32_t)(domid)))
}
98401
func (c *CDN) StartCdnDomain(domainName string, resp interface{}) (err error) {
	req := c.cdnReq.Clone().(*Request)
	req.Action = StartCdnDomainAction
	req.SetArgs("DomainName", domainName)
	err = c.rpc.Query(req, resp)
	return
}
646763
func (c *Connect) DomainXMLToNative(nativeFormat string, domainXml string, flags uint32) (string, error) {
	cnativeFormat := C.CString(nativeFormat)
	defer C.free(unsafe.Pointer(cnativeFormat))
	cdomainXml := C.CString(domainXml)
	defer C.free(unsafe.Pointer(cdomainXml))

	var err C.virError
	ret := C.virConnectDomainXMLToNativeWrapper(c.ptr, cnativeFormat, cdomainXml, C.uint(flags), &err)
	if ret == nil {
		return "", makeError(&err)
	}

	defer C.free(unsafe.Pointer(ret))

	return C.GoString(ret), nil
}
1025579
func (d *L3GD20) Start() error {
	if err := d.setup(); err != nil {
		return err
	}

	d.closing = make(chan chan struct{})

	go func() {
		var x, y, z float64
		var orientations chan Orientation

		timer := time.Tick(time.Duration(math.Floor(pollDelay)) * time.Microsecond)

		for {
			select {
			case <-timer:
				dx, dy, dz, err := d.measureOrientationDelta()
				if err != nil {
					glog.Errorf("l3gd20: %v", err)
				} else {
					x += dx * mult
					y += dy * mult
					z += dz * mult
					orientations = d.orientations
				}
			case orientations <- Orientation{x, y, z}:
				orientations = nil
			case waitc := <-d.closing:
				waitc <- struct{}{}
				close(d.orientations)
				return
			}

		}
	}()

	return nil
}
47482
func (l *ServiceListener) Start(sn *ServiceNode, instanceID int) bool {

	l.mu.Lock()
	defer l.mu.Unlock()

	logger := plog.WithFields(log.Fields{
		"serviceid":                   sn.ID,
		"servicename":                 sn.Name,
		"shouldhaveaddressassignment": sn.ShouldHaveAddressAssignment,
		"instanceid":                  instanceID,
	})

	// pick a host
	hostID, err := l.handler.SelectHost(sn)
	if err != nil {
		logger.WithError(err).Warn("Could not select host")
		return false
	}
	// CC-3656: If the strategy doesn't select a host, an invalid service state is created.
	if hostID == "" {
		// The selected strategy didn't select any hosts; we need to make this
		// obvious in the log so it can be corrected.
		strat, err := strategy.Get(string(sn.HostPolicy))
		if err == nil {
			logger = logger.WithField("strategy", strat.Name())
		}
		logger.Warn("No hosts available")
		return false
	}

	logger.WithField("hostid", hostID).Debug("Service instance scheduled to host")
	req := StateRequest{
		PoolID:     l.poolid,
		HostID:     hostID,
		ServiceID:  sn.ID,
		InstanceID: instanceID,
	}

	// make sure the state exists on neither the service nor the host
	DeleteState(l.conn, req)

	if err := CreateState(l.conn, req); err != nil {

		logger.WithError(err).Warn("Could not schedule service instance")
		return false
	}

	return true
}
894333
func (ppe *PPE) Domain(domain string) (*Domain, error) {
	var d domainsResponse
	err := ppe.get(fmt.Sprintf("/domains/%s", domain), &d)
	if err != nil {
		return &Domain{}, err
	}
	drs := d.Domains
	var dom *Domain
	for _, dr := range drs {
		if dr.DomainName == domain {
			org, err := ppe.Organization(domain)
			if err != nil {
				return &Domain{}, err
			}
			dom = domainFromDomainResponse(org, dr)
			break
		}
	}
	return dom, nil
}
1182585
func (a *API) GetDomainConfig(domain int, key string) (string, error) {
	url := a.BuildURL("/v2/domain/%d/config/%s/", domain, key)
	return a.getTextPlain(url, Params{})
}
699009
func (c *cniProcessor) Start(ctx context.Context, eventInfo *common.EventInfo) error {
	contextID, err := generateContextID(eventInfo)
	if err != nil {
		return err
	}

	runtimeInfo, err := c.metadataExtractor(eventInfo)
	if err != nil {
		return err
	}

	if err := c.config.Policy.HandlePUEvent(ctx, contextID, common.EventCreate, runtimeInfo); err != nil {
		return err
	}

	if err := c.config.Policy.HandlePUEvent(ctx, contextID, common.EventStart, runtimeInfo); err != nil {
		return err
	}

	c.config.Collector.CollectContainerEvent(&collector.ContainerRecord{
		ContextID: contextID,
		IPAddress: runtimeInfo.IPAddresses(),
		Tags:      runtimeInfo.Tags(),
		Event:     collector.ContainerStart,
	})

	return nil
}