From 7fa6c2e2de621558794a59aabdd74d0077dac8d5 Mon Sep 17 00:00:00 2001 From: Jeff Carr Date: Fri, 1 Nov 2024 06:41:20 -0500 Subject: [PATCH] argh. still not working Signed-off-by: Jeff Carr --- importDomain.go | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/importDomain.go b/importDomain.go index 0f8432b..7ecaa89 100644 --- a/importDomain.go +++ b/importDomain.go @@ -7,6 +7,7 @@ import ( "time" pb "go.wit.com/lib/protobuf/virtbuf" + "go.wit.com/lib/virtigolib" "go.wit.com/log" "libvirt.org/go/libvirtxml" ) @@ -69,6 +70,19 @@ func importDomain(w http.ResponseWriter, r *http.Request) (string, error) { fmt.Fprintln(w, string(xml)) return "", err } + // func ImportXML(domcfg *libvirtxml.Domain) (*pb.Droplet, []*pb.Event, error) { + d, alle, err := virtigolib.ImportXML(domcfg) + if err != nil { + fmt.Fprintln(w, "ImportXML failed with", name, err) + return "", err + } + if d == nil { + fmt.Fprintln(w, "ImportXML d == nil for", name, err) + return "", err + } + for _, e := range alle { + me.cluster.AddEvent(e) + } result := fmt.Sprintln("marshal worked", domcfg.Name, domcfg.UUID) log.Log(WARN, result)