working but not working yet
Signed-off-by: Jeff Carr <jcarr@wit.com>
This commit is contained in:
parent
37a053dae9
commit
d13ac244ed
2
Makefile
2
Makefile
|
@ -7,7 +7,7 @@ REDOMOD = $(shell if [ -e go.sum ]; then echo go.sum exists; else GO111MODULE=
|
||||||
all:
|
all:
|
||||||
GO111MODULE=off go build -v -ldflags "-X main.Version=${VERSION} -X gui.GUIVERSION=${VERSION}"
|
GO111MODULE=off go build -v -ldflags "-X main.Version=${VERSION} -X gui.GUIVERSION=${VERSION}"
|
||||||
./virtigo --version
|
./virtigo --version
|
||||||
./virtigo
|
./virtigo --help
|
||||||
|
|
||||||
xml-add:
|
xml-add:
|
||||||
./virtigo --add-xml /home/nfs3/xml/*.xml
|
./virtigo --add-xml /home/nfs3/xml/*.xml
|
||||||
|
|
|
@ -258,6 +258,10 @@ func updateDisk(d *DropletT, domcfg *libvirtxml.Domain) bool {
|
||||||
for _, disk := range domcfg.Devices.Disks {
|
for _, disk := range domcfg.Devices.Disks {
|
||||||
var t *libvirtxml.DomainDiskSourceFile
|
var t *libvirtxml.DomainDiskSourceFile
|
||||||
t = disk.Source.File
|
t = disk.Source.File
|
||||||
|
if t == nil {
|
||||||
|
fmt.Println("disk.Source.File == nil")
|
||||||
|
continue
|
||||||
|
}
|
||||||
filename := t.File
|
filename := t.File
|
||||||
if filename == "" {
|
if filename == "" {
|
||||||
fmt.Println("No disk source file found.")
|
fmt.Println("No disk source file found.")
|
||||||
|
|
20
xml.go
20
xml.go
|
@ -289,8 +289,10 @@ func dumpNonStandardXML(domcfg *libvirtxml.Domain) {
|
||||||
featurematch = false
|
featurematch = false
|
||||||
}
|
}
|
||||||
// what is VMPort anyway?
|
// what is VMPort anyway?
|
||||||
|
if domcfg.Features.VMPort != nil {
|
||||||
if domcfg.Features.VMPort.State == "off" {
|
if domcfg.Features.VMPort.State == "off" {
|
||||||
domcfg.Features.VMPort = nil
|
domcfg.Features.VMPort = nil
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
featurematch = false
|
featurematch = false
|
||||||
}
|
}
|
||||||
|
@ -318,6 +320,9 @@ func dumpNonStandardXML(domcfg *libvirtxml.Domain) {
|
||||||
domcfg.Memory = nil
|
domcfg.Memory = nil
|
||||||
domcfg.CurrentMemory = nil
|
domcfg.CurrentMemory = nil
|
||||||
domcfg.VCPU = nil
|
domcfg.VCPU = nil
|
||||||
|
// is this always "host-passthrough" and "host-model"?
|
||||||
|
// only Fabrice knows :)
|
||||||
|
if domcfg.CPU != nil {
|
||||||
switch domcfg.CPU.Mode {
|
switch domcfg.CPU.Mode {
|
||||||
case "host-passthrough":
|
case "host-passthrough":
|
||||||
domcfg.CPU = nil
|
domcfg.CPU = nil
|
||||||
|
@ -326,6 +331,7 @@ func dumpNonStandardXML(domcfg *libvirtxml.Domain) {
|
||||||
default:
|
default:
|
||||||
fmt.Printf("? CPU Mode: %+v\n", domcfg.CPU.Mode)
|
fmt.Printf("? CPU Mode: %+v\n", domcfg.CPU.Mode)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// this goes away if SecLabel is zero'd out?
|
// this goes away if SecLabel is zero'd out?
|
||||||
//if domcfg.Metadata != nil {
|
//if domcfg.Metadata != nil {
|
||||||
|
@ -388,6 +394,7 @@ func dumpNonStandardXML(domcfg *libvirtxml.Domain) {
|
||||||
case "usb":
|
case "usb":
|
||||||
switch controller.Model {
|
switch controller.Model {
|
||||||
case "ich9-ehci1":
|
case "ich9-ehci1":
|
||||||
|
case "piix3-uhci":
|
||||||
case "qemu-xhci":
|
case "qemu-xhci":
|
||||||
// fmt.Printf("OK USB: %s, %d\n", controller.Model, *controller.Index)
|
// fmt.Printf("OK USB: %s, %d\n", controller.Model, *controller.Index)
|
||||||
case "ich9-uhci1":
|
case "ich9-uhci1":
|
||||||
|
@ -420,18 +427,21 @@ func dumpNonStandardXML(domcfg *libvirtxml.Domain) {
|
||||||
normalPCI = false
|
normalPCI = false
|
||||||
}
|
}
|
||||||
case "pci":
|
case "pci":
|
||||||
|
// these are the strings I've found so far
|
||||||
switch controller.Model {
|
switch controller.Model {
|
||||||
|
case "pci-root":
|
||||||
case "pcie-root":
|
case "pcie-root":
|
||||||
// pcie-root
|
|
||||||
case "pcie-root-port":
|
case "pcie-root-port":
|
||||||
// pcie-root
|
|
||||||
case "pcie-to-pci-bridge":
|
case "pcie-to-pci-bridge":
|
||||||
// pcie-root
|
|
||||||
default:
|
default:
|
||||||
fmt.Printf("PCI: %s, %d\n", controller.Model, *controller.Index)
|
fmt.Printf("PCI: %s, %d\n", controller.Model, *controller.Index)
|
||||||
// Domain:0xc0002d2760 Bus:0xc0002d2768 Slot:0xc0002d2770 Function:0xc0002d2778 MultiFunction:
|
// Domain:0xc0002d2760 Bus:0xc0002d2768 Slot:0xc0002d2770 Function:0xc0002d2778 MultiFunction:
|
||||||
|
if controller.Address == nil {
|
||||||
|
fmt.Printf("PCI: controller.Address = nil\n")
|
||||||
|
} else {
|
||||||
pci := controller.Address.PCI
|
pci := controller.Address.PCI
|
||||||
fmt.Printf("PCI: Domain: %+v Slot %d Function %d\n", *pci.Domain, *pci.Slot, *pci.Function)
|
fmt.Printf("PCI: Domain: %+v Slot %d Function %d\n", *pci.Domain, *pci.Slot, *pci.Function)
|
||||||
|
}
|
||||||
normalPCI = false
|
normalPCI = false
|
||||||
keepPCI = append(keepPCI, controller)
|
keepPCI = append(keepPCI, controller)
|
||||||
}
|
}
|
||||||
|
@ -558,7 +568,8 @@ func dumpNonStandardXML(domcfg *libvirtxml.Domain) {
|
||||||
domcfg.Devices.RNGs = nil
|
domcfg.Devices.RNGs = nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// this is probably for spice to have keyboard and mouse input
|
// don't copy this over here yet.
|
||||||
|
// probably most domU's don't really use/need it set to what is in the XML
|
||||||
var normalVideo bool = true
|
var normalVideo bool = true
|
||||||
if domcfg.Devices.Videos != nil {
|
if domcfg.Devices.Videos != nil {
|
||||||
for _, v := range domcfg.Devices.Videos {
|
for _, v := range domcfg.Devices.Videos {
|
||||||
|
@ -571,6 +582,7 @@ func dumpNonStandardXML(domcfg *libvirtxml.Domain) {
|
||||||
fmt.Printf("? Video Model: %+v\n", v.Model)
|
fmt.Printf("? Video Model: %+v\n", v.Model)
|
||||||
normalVideo = false
|
normalVideo = false
|
||||||
}
|
}
|
||||||
|
case "cirrus":
|
||||||
case "virtio":
|
case "virtio":
|
||||||
// this should always be standard
|
// this should always be standard
|
||||||
//fmt.Printf("? Video: %+v\n", v)
|
//fmt.Printf("? Video: %+v\n", v)
|
||||||
|
|
Loading…
Reference in New Issue