diff options
| author | Jeff Carr <[email protected]> | 2024-10-23 20:17:33 -0500 |
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2024-10-23 20:17:33 -0500 |
| commit | d13ac244ed0143006d9e0ac6f47fcb0543696325 (patch) | |
| tree | b774d992dd5203bf0256a758e689504e1b77123a /xml.go | |
| parent | 37a053dae99e7efb8858ffcc27b19a7b319136ad (diff) | |
working but not working yet
Signed-off-by: Jeff Carr <[email protected]>
Diffstat (limited to 'xml.go')
| -rw-r--r-- | xml.go | 42 |
1 files changed, 27 insertions, 15 deletions
@@ -289,8 +289,10 @@ func dumpNonStandardXML(domcfg *libvirtxml.Domain) { featurematch = false } // what is VMPort anyway? - if domcfg.Features.VMPort.State == "off" { - domcfg.Features.VMPort = nil + if domcfg.Features.VMPort != nil { + if domcfg.Features.VMPort.State == "off" { + domcfg.Features.VMPort = nil + } } else { featurematch = false } @@ -318,13 +320,17 @@ func dumpNonStandardXML(domcfg *libvirtxml.Domain) { domcfg.Memory = nil domcfg.CurrentMemory = nil domcfg.VCPU = nil - switch domcfg.CPU.Mode { - case "host-passthrough": - domcfg.CPU = nil - case "host-model": - domcfg.CPU = nil - default: - fmt.Printf("? CPU Mode: %+v\n", domcfg.CPU.Mode) + // is this always "host-passthrough" and "host-model"? + // only Fabrice knows :) + if domcfg.CPU != nil { + switch domcfg.CPU.Mode { + case "host-passthrough": + domcfg.CPU = nil + case "host-model": + domcfg.CPU = nil + default: + fmt.Printf("? CPU Mode: %+v\n", domcfg.CPU.Mode) + } } // this goes away if SecLabel is zero'd out? @@ -388,6 +394,7 @@ func dumpNonStandardXML(domcfg *libvirtxml.Domain) { case "usb": switch controller.Model { case "ich9-ehci1": + case "piix3-uhci": case "qemu-xhci": // fmt.Printf("OK USB: %s, %d\n", controller.Model, *controller.Index) case "ich9-uhci1": @@ -420,18 +427,21 @@ func dumpNonStandardXML(domcfg *libvirtxml.Domain) { normalPCI = false } case "pci": + // these are the strings I've found so far switch controller.Model { + case "pci-root": case "pcie-root": - // pcie-root case "pcie-root-port": - // pcie-root case "pcie-to-pci-bridge": - // pcie-root default: fmt.Printf("PCI: %s, %d\n", controller.Model, *controller.Index) // Domain:0xc0002d2760 Bus:0xc0002d2768 Slot:0xc0002d2770 Function:0xc0002d2778 MultiFunction: - pci := controller.Address.PCI - fmt.Printf("PCI: Domain: %+v Slot %d Function %d\n", *pci.Domain, *pci.Slot, *pci.Function) + if controller.Address == nil { + fmt.Printf("PCI: controller.Address = nil\n") + } else { + pci := controller.Address.PCI + fmt.Printf("PCI: Domain: %+v Slot %d Function %d\n", *pci.Domain, *pci.Slot, *pci.Function) + } normalPCI = false keepPCI = append(keepPCI, controller) } @@ -558,7 +568,8 @@ func dumpNonStandardXML(domcfg *libvirtxml.Domain) { 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 if domcfg.Devices.Videos != nil { for _, v := range domcfg.Devices.Videos { @@ -571,6 +582,7 @@ func dumpNonStandardXML(domcfg *libvirtxml.Domain) { fmt.Printf("? Video Model: %+v\n", v.Model) normalVideo = false } + case "cirrus": case "virtio": // this should always be standard //fmt.Printf("? Video: %+v\n", v) |
