compiles again

Signed-off-by: Jeff Carr <jcarr@wit.com>
This commit is contained in:
Jeff Carr 2024-11-01 10:23:32 -05:00
parent 62bb5dbb9f
commit 4a9c0c7e6a
2 changed files with 31 additions and 33 deletions

26
http.go
View File

@ -8,11 +8,12 @@ import (
"os"
"strings"
"libvirt.org/go/libvirtxml"
"go.wit.com/lib/gui/shell"
"go.wit.com/lib/virtigolib"
pb "go.wit.com/lib/protobuf/virtbuf"
"go.wit.com/log"
"libvirt.org/go/libvirtxml"
"go.wit.com/lib/virtigolib"
)
// remove '?' part and trailing '/'
@ -55,17 +56,7 @@ func okHandler(w http.ResponseWriter, r *http.Request) {
fmt.Fprintln(w, "error =", err)
return
}
fmt.Fprintln(w, "About to virtigolib.ImportXML(domcfg)")
fmt.Fprintln(w, "About to virtigolib.ImportXML(domcfg)")
fmt.Fprintln(w, "About to virtigolib.ImportXML(domcfg)")
log.Warn("About to virtigolib.ImportXML(domcfg)")
log.Warn("domcfg.Uuid", domcfg.UUID)
log.Warn("domcfg.Name", domcfg.Name)
d, _, err := virtigolib.ImportXML(domcfg)
fmt.Fprintln(w, "Finished virtigolib.ImportXML(domcfg)")
fmt.Fprintln(w, "Finished virtigolib.ImportXML(domcfg)")
fmt.Fprintln(w, "Finished virtigolib.ImportXML(domcfg)")
log.Warn("Finished virtigolib.ImportXML(domcfg)")
d, err := virtigolib.TestLibvirtDomain(domcfg)
if err != nil {
fmt.Fprintln(w, "ImportXML failed for", domname, err)
return
@ -76,7 +67,6 @@ func okHandler(w http.ResponseWriter, r *http.Request) {
}
fmt.Fprintln(w, "ImportXML worked for", domname)
fmt.Fprintln(w, "should send the protobuf to virtigo here", domname)
d.Current.FullXml = xmldoc
log.Warn("About to DumpDroplet()")
d.DumpDroplet(w, r)
fmt.Fprintln(w, "DUMP DOMAIN DONE OK FOR", domname)
@ -108,7 +98,14 @@ func okHandler(w http.ResponseWriter, r *http.Request) {
// fmt.Fprint(w, "import domain:", domname)
xmldoc, err := virshDumpXML(domname)
if err != nil {
fmt.Fprintln(w, err)
return
}
fmt.Fprintln(w, xmldoc)
return
/*
domcfg := &libvirtxml.Domain{}
err = domcfg.Unmarshal(xmldoc)
if err != nil {
@ -126,6 +123,7 @@ func okHandler(w http.ResponseWriter, r *http.Request) {
log.Warn("ImportXML worked for", domname)
fmt.Fprintln(w, xml)
// d.Current.FullXml = xmldoc
*/
return
}