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
	}
	networkNS, err := p.storage.fetchPodNetwork(podID)
	if err != nil {
		return nil, err
	}
	if err := p.stopShims(); err != nil {
		return nil, err
	}
	err = p.stopVM()
	if err != nil {
		return nil, err
	}
	if networkNS.NetNsCreated {
		if err := p.network.remove(*p, networkNS); err != nil {
			return nil, err
		}
	}
	err = p.delete()
	if err != nil {
		return nil, err
	}
	if err := p.config.Hooks.postStopHooks(); err != nil {
		return nil, err
	}
	return p, nil
}
DeletePod is the virtcontainers pod deletion entry point.
DeletePod will stop an already running container and then delete it.
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) {
	virtLog = logger.WithField("source", "virtcontainers")
}
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
	}
	err = p.storePod()
	if err != nil {
		return nil, err
	}
	netNsPath, netNsCreated, err := p.network.init(p.config.NetworkConfig)
	if err != nil {
		return nil, err
	}
	err = p.network.run(netNsPath, func() error {
		return p.config.Hooks.preStartHooks()
	})
	if err != nil {
		return nil, err
	}
	networkNS, err := p.network.add(*p, p.config.NetworkConfig, netNsPath, netNsCreated)
	if err != nil {
		return nil, err
	}
	err = p.storage.storePodNetwork(p.id, networkNS)
	if err != nil {
		return nil, err
	}
	err = p.startVM(netNsPath)
	if err != nil {
		return nil, err
	}
	err = p.startProxy()
	if err != nil {
		return nil, err
	}
	if err := p.startShims(); err != nil {
		return nil, err
	}
	return p, nil
}