Refactor in preperation for non-Debian support

I dunno why anyone would ever use non-Debian but I guess some people do
This commit is contained in:
Finn 2024-12-08 19:17:56 -08:00
parent 6ccb983f10
commit 5e3a83e585
6 changed files with 386 additions and 20 deletions

View file

@ -6,8 +6,6 @@ package pools
import (
"libvirt.org/go/libvirt"
"libvirt.org/go/libvirtxml"
"mkvm/config"
)
type StoragePoolType string
@ -29,8 +27,8 @@ type StoragePool interface {
var drivers = map[string]func(*libvirt.StoragePool) (StoragePool, error){}
// GetPool retrieves the configured Storage Pool from libvirt
func GetPool(conn *libvirt.Connect) (StoragePool, error) {
pool, err := conn.LookupStoragePoolByName(config.C.StoragePool)
func GetPool(conn *libvirt.Connect, name string) (StoragePool, error) {
pool, err := conn.LookupStoragePoolByName(name)
if err != nil {
return nil, err
}