diff --git a/argv.go b/argv.go index 0cf8037..8efa4d7 100644 --- a/argv.go +++ b/argv.go @@ -11,11 +11,12 @@ import "go.wit.com/log" var argv args type args struct { - Xml []string `arg:"--libvirt" help:"import qemu xml files: --libvirt /etc/libvirt/qemu/*.xml"` - Save bool `arg:"--save" default:"false" help:"save protobuf config after import"` - Config string `arg:"env:VIRTIGO_HOME" help:"defaults to ~/.config/virtigo/"` - Port int `arg:"--port" default:"8080" help:"allow droplet events via http"` - Daemon bool `arg:"--daemon" help:"run in daemon mode"` + Xml []string `arg:"--libvirt" help:"import qemu xml files: --libvirt /etc/libvirt/qemu/*.xml"` + IgnoreCpu bool `arg:"--xml-ignore-cpu" default:"true" help:"ignore non-standard libvirt xml cpus"` + Save bool `arg:"--save" default:"false" help:"save protobuf config after import"` + Config string `arg:"env:VIRTIGO_HOME" help:"defaults to ~/.config/virtigo/"` + Port int `arg:"--port" default:"8080" help:"allow droplet events via http"` + Daemon bool `arg:"--daemon" help:"run in daemon mode"` } // Uptime bool `arg:"--uptime" default:"true" help:"allow uptime checks for things like Kuma"` diff --git a/libvirtxml.go b/libvirtxml.go index b873583..64b6814 100644 --- a/libvirtxml.go +++ b/libvirtxml.go @@ -330,13 +330,14 @@ func dumpNonStandardXML(domcfg *libvirtxml.Domain) (string, error) { case "host-model": domcfg.CPU = nil case "custom": - fmt.Printf("custom CPU: %+v\n", domcfg.CPU) - fmt.Printf("custom CPU Model: %+v\n", domcfg.CPU.Model) - // domcfg.CPU = nil updatedXML, _ := xml.MarshalIndent(domcfg.CPU, "", " ") - log.Info("Non-Standard XML Start") + log.Info("Ignore custom CPU Start") fmt.Println(string(updatedXML)) - log.Info("Non-Standard XML End") + log.Info("Ignore custom CPU End") + log.Info("Add --xml-ignore-cpu to ignore this") + if argv.IgnoreCpu { + domcfg.CPU = nil + } default: fmt.Printf("unknown CPU: %+v\n", domcfg.CPU) fmt.Printf("unknown CPU Model: %+v\n", domcfg.CPU.Model) @@ -348,10 +349,6 @@ func dumpNonStandardXML(domcfg *libvirtxml.Domain) (string, error) { } } - // this goes away if SecLabel is zero'd out? - //if domcfg.Metadata != nil { - // fmt.Printf("? Metadata: %+v\n", domcfg.Metadata) - //} var secnormal bool = true if len(domcfg.SecLabel) != 0 { for _, sec := range domcfg.SecLabel { @@ -367,6 +364,7 @@ func dumpNonStandardXML(domcfg *libvirtxml.Domain) (string, error) { if secnormal { domcfg.SecLabel = nil } + // ignore Metadata // this is probably something about what kind of OS you might be running // todo: get this directly from the disk image