parent
62bb5dbb9f
commit
4a9c0c7e6a
28
http.go
28
http.go
|
@ -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 '/'
|
||||
|
@ -42,7 +43,7 @@ func okHandler(w http.ResponseWriter, r *http.Request) {
|
|||
domname := r.URL.Query().Get("domain")
|
||||
fmt.Fprint(w, "import domain:", domname)
|
||||
|
||||
xmldoc, err := virshDumpXML( domname)
|
||||
xmldoc, err := virshDumpXML(domname)
|
||||
|
||||
domcfg := &libvirtxml.Domain{}
|
||||
fmt.Fprintln(w, "domcfg.Unmarshal()")
|
||||
|
@ -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
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue