func (s *storageDir) StoragePoolVolumeCreate() error {
	logger.Infof("Creating DIR storage volume \"%s\" on storage pool \"%s\"", s.volume.Name, s.pool.Name)

	_, err := s.StoragePoolMount()
	if err != nil {
		return err
	}

	source := s.pool.Config["source"]
	if source == "" {
		return fmt.Errorf("no \"source\" property found for the storage pool")
	}

	isSnapshot := shared.IsSnapshot(s.volume.Name)

	var storageVolumePath string

	if isSnapshot {
		storageVolumePath = getStoragePoolVolumeSnapshotMountPoint(s.pool.Name, s.volume.Name)
	} else {
		storageVolumePath = getStoragePoolVolumeMountPoint(s.pool.Name, s.volume.Name)
	}

	err = os.MkdirAll(storageVolumePath, 0711)
	if err != nil {
		return err
	}

	err = s.initQuota(storageVolumePath, s.volumeID)
	if err != nil {
		return err
	}

	logger.Infof("Created DIR storage volume \"%s\" on storage pool \"%s\"", s.volume.Name, s.pool.Name)
	return nil
}
func (s *storageDir) StoragePoolVolumeCreate() error {
	logger.Infof("Creating DIR storage volume \"%s\" on storage pool \"%s\"", s.volume.Name, s.pool.Name)

	_, err := s.StoragePoolMount()
	if err != nil {
		return err
	}

	source := s.pool.Config["source"]
	if source == "" {
		return fmt.Errorf("no \"source\" property found for the storage pool")
	}

	isSnapshot := shared.IsSnapshot(s.volume.Name)

	var storageVolumePath string

	if isSnapshot {
		storageVolumePath = getStoragePoolVolumeSnapshotMountPoint(s.pool.Name, s.volume.Name)
	} else {
		storageVolumePath = getStoragePoolVolumeMountPoint(s.pool.Name, s.volume.Name)
	}

	err = os.MkdirAll(storageVolumePath, 0711)
	if err != nil {
		return err
	}

	err = s.initQuota(storageVolumePath, s.volumeID)
	if err != nil {
		return err
	}

	logger.Infof("Created DIR storage volume \"%s\" on storage pool \"%s\"", s.volume.Name, s.pool.Name)
	return nil
}
// Functions dealing with storage pools.