func RunPod(podConfig PodConfig) (VCPod, error) {
	p, err := createPodFromConfig(podConfig)
	if err != nil {
		return nil, err
	}
	lockFile, err := rwLockPod(p.id)
	if err != nil {
		return nil, err
	}
	defer unlockPod(lockFile)
	return startPod(p)
}
RunPod is the virtcontainers pod running entry point.
RunPod creates a pod and its containers and then it starts them.
package virtcontainers
import (
	"os"
	"runtime"
	"syscall"
	"github.com/sirupsen/logrus"
)
func init() {
	runtime.LockOSThread()
}
var virtLog = logrus.FieldLogger(logrus.New())
func SetLogger(logger logrus.FieldLogger) {
	fields := logrus.Fields{
		"source": "virtcontainers",
		"arch":   runtime.GOARCH,
	}
	virtLog = logger.WithFields(fields)
}
func CreatePod(podConfig PodConfig) (VCPod, error) {
	return createPodFromConfig(podConfig)
}
func createPodFromConfig(podConfig PodConfig) (*Pod, error) {
	p, err := createPod(podConfig)
	if err != nil {
		return nil, err
	}
	if err := p.createNetwork(); err != nil {
		return nil, err
	}
	if err := p.startVM(); err != nil {
		return nil, err
	}
	if err := p.createContainers(); err != nil {
		return nil, err
	}
	if err := p.storePod(); err != nil {
		return nil, err
	}
	return p, nil
}
func DeletePod(podID string) (VCPod, error) {
	if podID == "" {
		return nil, errNeedPodID
	}
	lockFile, err := rwLockPod(podID)
	if err != nil {
		return nil, err
	}
	defer unlockPod(lockFile)
	p, err := fetchPod(podID)
	if err != nil {
		return nil, err
	}
	if err := p.delete(); err != nil {
		return nil, err
	}
	return p, nil
}
func StartPod(podID string) (VCPod, error) {
	if podID == "" {
		return nil, errNeedPodID
	}
	lockFile, err := rwLockPod(podID)
	if err != nil {
		return nil, err
	}
	defer unlockPod(lockFile)
	p, err := fetchPod(podID)
	if err != nil {
		return nil, err
	}
	return startPod(p)
}
func startPod(p *Pod) (*Pod, error) {
	err := p.start()
	if err != nil {
		return nil, err
	}
	if err := p.config.Hooks.postStartHooks(); err != nil {
		return nil, err
	}
	return p, nil
}
func StopPod(podID string) (VCPod, error) {
	if podID == "" {
		return nil, errNeedPod
	}
	lockFile, err := rwLockPod(podID)
	if err != nil {
		return nil, err
	}
	defer unlockPod(lockFile)
	p, err := fetchPod(podID)
	if err != nil {
		return nil, err
	}
	err = p.stop()
	if err != nil {
		p.delete()
		return nil, err
	}
	if err := p.removeNetwork(); err != nil {
		return nil, err
	}
	if err := p.config.Hooks.postStopHooks(); err != nil {
		return nil, err
	}
	return p, nil
}