lxd/db/storage_pools.go
func storagePoolVolumeReplicateIfCeph(tx *sql.Tx, volumeID int64, project, volumeName string, volumeType int, poolID int64, f func(int64) error) error {
	driver, err := storagePoolDriverGet(tx, poolID)
	if err != nil {
		return err
	}
	volumeIDs := []int64{volumeID}

	// If this is a ceph volume, we want to duplicate the change across the
	// the rows for all other nodes.
	if driver == "ceph" {
		volumeIDs, err = storageVolumeIDsGet(tx, project, volumeName, volumeType, poolID)
		if err != nil {
			return err
		}
	}

	for _, volumeID := range volumeIDs {
		err := f(volumeID)
		if err != nil {
			return err
		}
	}

	return nil
}
func storagePoolVolumeReplicateIfCeph(tx *sql.Tx, volumeID int64, project, volumeName string, volumeType int, poolID int64, f func(int64) error) error {
	driver, err := storagePoolDriverGet(tx, poolID)
	if err != nil {
		return err
	}
	volumeIDs := []int64{volumeID}

	// If this is a ceph volume, we want to duplicate the change across the
	// the rows for all other nodes.
	if driver == "ceph" {
		volumeIDs, err = storageVolumeIDsGet(tx, project, volumeName, volumeType, poolID)
		if err != nil {
			return err
		}
	}

	for _, volumeID := range volumeIDs {
		err := f(volumeID)
		if err != nil {
			return err
		}
	}

	return nil
}
func storagePoolVolumeReplicateIfCeph ( tx * sql . Tx , volumeID int64 , project , volumeName string , volumeType int , poolID int64 , f func ( int64 ) error ) error { driver , err := storagePoolDriverGet ( tx , poolID ) if err != nil { return err } volumeIDs := [ ] int64 { volumeID } // If this is a ceph volume, we want to duplicate the change across the // the rows for all other nodes. if driver == " " { volumeIDs , err = storageVolumeIDsGet ( tx , project , volumeName , volumeType , poolID ) if err != nil { return err } } for _ , volumeID := range volumeIDs { err := f ( volumeID ) if err != nil { return err } } return nil }
// This a convenience to replicate a certain volume change to all nodes if the
// underlying driver is ceph.
This a convenience to replicate a certain volume change to all nodes if the underlying driver is ceph .