diff --git a/go.mod b/go.mod index caffa2bbf6..f44e153f4d 100644 --- a/go.mod +++ b/go.mod @@ -65,7 +65,7 @@ require ( k8s.io/api v0.29.3 k8s.io/apimachinery v0.29.3 k8s.io/client-go v0.29.3 - libvirt.org/go/libvirtxml v1.10009.0 + libvirt.org/go/libvirtxml v1.10010.0 ) require ( diff --git a/go.sum b/go.sum index fdabeafee5..4704250590 100644 --- a/go.sum +++ b/go.sum @@ -568,8 +568,8 @@ k8s.io/kube-openapi v0.0.0-20231010175941-2dd684a91f00 h1:aVUu9fTY98ivBPKR9Y5w/A k8s.io/kube-openapi v0.0.0-20231010175941-2dd684a91f00/go.mod h1:AsvuZPBlUDVuCdzJ87iajxtXuR9oktsTctW/R9wwouA= k8s.io/utils v0.0.0-20230726121419-3b25d923346b h1:sgn3ZU783SCgtaSJjpcVVlRqd6GSnlTLKgpAAttJvpI= k8s.io/utils v0.0.0-20230726121419-3b25d923346b/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0= -libvirt.org/go/libvirtxml v1.10009.0 h1:y60vA65jOAZSJedRoil1s2myVIy0NOfz0E6zhmYiN2g= -libvirt.org/go/libvirtxml v1.10009.0/go.mod h1:7Oq2BLDstLr/XtoQD8Fr3mfDNrzlI3utYKySXF2xkng= +libvirt.org/go/libvirtxml v1.10010.0 h1:htg6LO41eWDoA1fih0KpyWLC8Yks4GQNV014vlfXcJ4= +libvirt.org/go/libvirtxml v1.10010.0/go.mod h1:7Oq2BLDstLr/XtoQD8Fr3mfDNrzlI3utYKySXF2xkng= sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd h1:EDPBXCAspyGV4jQlpZSudPeMmr1bNJefnuqLsRAsHZo= sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd/go.mod h1:B8JuhiUyNFVKdsE8h686QcCxMaH6HrOAZj4vswFpcB0= sigs.k8s.io/structured-merge-diff/v4 v4.4.1 h1:150L+0vs/8DA78h1u02ooW1/fFq/Lwr+sGiqlzvrtq4= diff --git a/vendor/libvirt.org/go/libvirtxml/domain.go b/vendor/libvirt.org/go/libvirtxml/domain.go index ccf3ca90d9..7b3e676eb4 100644 --- a/vendor/libvirt.org/go/libvirtxml/domain.go +++ b/vendor/libvirt.org/go/libvirtxml/domain.go @@ -170,6 +170,12 @@ type DomainDiskSource struct { Cookies *DomainDiskCookies `xml:"cookies"` Readahead *DomainDiskSourceReadahead `xml:"readahead"` Timeout *DomainDiskSourceTimeout `xml:"timeout"` + DataStore *DomainDiskDataStore `xml:"dataStore"` +} + +type DomainDiskDataStore struct { + Format *DomainDiskFormat `xml:"format"` + Source *DomainDiskSource `xml:"source"` } type DomainDiskSlices struct { @@ -2058,6 +2064,27 @@ type DomainTPMBackendEmulator struct { PersistentState string `xml:"persistent_state,attr,omitempty"` Debug uint `xml:"debug,attr,omitempty"` ActivePCRBanks *DomainTPMBackendPCRBanks `xml:"active_pcr_banks"` + Source *DomainTPMBackendSource `xml:"source"` + Profile *DomainTPMBackendProfile `xml:"profile"` +} + +type DomainTPMBackendProfile struct { + Source string `xml:"source,attr,omitempty"` + RemoveDisabled string `xml:"removeDisabled,attr,omitempty"` + Name string `xml:"name,attr,omitempty"` +} + +type DomainTPMBackendSource struct { + File *DomainTPMBackendSourceFile `xml:"-"` + Dir *DomainTPMBackendSourceDir `xml:"-"` +} + +type DomainTPMBackendSourceFile struct { + Path string `xml:"path,attr,omitempty"` +} + +type DomainTPMBackendSourceDir struct { + Path string `xml:"path,attr,omitempty"` } type DomainTPMBackendPCRBanks struct { @@ -2255,10 +2282,11 @@ type DomainSMBios struct { } type DomainNVRam struct { - NVRam string `xml:",chardata"` - Source *DomainDiskSource `xml:"source"` - Template string `xml:"template,attr,omitempty"` - Format string `xml:"format,attr,omitempty"` + NVRam string `xml:",chardata"` + Source *DomainDiskSource `xml:"source"` + Template string `xml:"template,attr,omitempty"` + Format string `xml:"format,attr,omitempty"` + TemplateFormat string `xml:"templateFormat,attr,omitempty"` } type DomainBootDevice struct { @@ -3715,6 +3743,78 @@ func (a *DomainDiskBackingStore) UnmarshalXML(d *xml.Decoder, start xml.StartEle return nil } +type domainDiskDataStore DomainDiskDataStore + +func (a *DomainDiskDataStore) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + start.Name.Local = "dataStore" + if a.Source != nil { + if a.Source.File != nil { + start.Attr = append(start.Attr, xml.Attr{ + xml.Name{Local: "type"}, "file", + }) + } else if a.Source.Block != nil { + start.Attr = append(start.Attr, xml.Attr{ + xml.Name{Local: "type"}, "block", + }) + } else if a.Source.Dir != nil { + start.Attr = append(start.Attr, xml.Attr{ + xml.Name{Local: "type"}, "dir", + }) + } else if a.Source.Network != nil { + start.Attr = append(start.Attr, xml.Attr{ + xml.Name{Local: "type"}, "network", + }) + } else if a.Source.Volume != nil { + start.Attr = append(start.Attr, xml.Attr{ + xml.Name{Local: "type"}, "volume", + }) + } else if a.Source.VHostUser != nil { + start.Attr = append(start.Attr, xml.Attr{ + xml.Name{Local: "type"}, "vhostuser", + }) + } else if a.Source.VHostVDPA != nil { + start.Attr = append(start.Attr, xml.Attr{ + xml.Name{Local: "type"}, "vhostvdpa", + }) + } + } + disk := domainDiskDataStore(*a) + return e.EncodeElement(disk, start) +} + +func (a *DomainDiskDataStore) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + typ, ok := getAttr(start.Attr, "type") + if !ok { + typ = "file" + } + a.Source = &DomainDiskSource{} + if typ == "file" { + a.Source.File = &DomainDiskSourceFile{} + } else if typ == "block" { + a.Source.Block = &DomainDiskSourceBlock{} + } else if typ == "network" { + a.Source.Network = &DomainDiskSourceNetwork{} + } else if typ == "dir" { + a.Source.Dir = &DomainDiskSourceDir{} + } else if typ == "volume" { + a.Source.Volume = &DomainDiskSourceVolume{} + } else if typ == "vhostuser" { + a.Source.VHostUser = &DomainDiskSourceVHostUser{} + } else if typ == "vhostvdpa" { + a.Source.VHostVDPA = &DomainDiskSourceVHostVDPA{} + } + disk := domainDiskDataStore(*a) + err := d.DecodeElement(&disk, &start) + if err != nil { + return err + } + *a = DomainDiskDataStore(disk) + if !ok && a.Source.File.File == "" { + a.Source.File = nil + } + return nil +} + type domainDiskMirror DomainDiskMirror func (a *DomainDiskMirror) MarshalXML(e *xml.Encoder, start xml.StartElement) error { @@ -4617,6 +4717,51 @@ func (a *DomainTPMBackend) UnmarshalXML(d *xml.Decoder, start xml.StartElement) return nil } +func (a *DomainTPMBackendSource) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + start.Name.Local = "source" + if a.File != nil { + start.Attr = append(start.Attr, xml.Attr{ + xml.Name{Local: "type"}, "file", + }) + err := e.EncodeElement(a.File, start) + if err != nil { + return err + } + } else if a.Dir != nil { + start.Attr = append(start.Attr, xml.Attr{ + xml.Name{Local: "type"}, "dir", + }) + err := e.EncodeElement(a.Dir, start) + if err != nil { + return err + } + } + return nil +} + +func (a *DomainTPMBackendSource) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + typ, ok := getAttr(start.Attr, "type") + if !ok { + return fmt.Errorf("Missing TPM source type") + } + if typ == "file" { + a.File = &DomainTPMBackendSourceFile{} + err := d.DecodeElement(a.File, &start) + if err != nil { + return err + } + } else if typ == "dir" { + a.Dir = &DomainTPMBackendSourceDir{} + err := d.DecodeElement(a.Dir, &start) + if err != nil { + return err + } + } else { + d.Skip() + } + return nil +} + func (d *DomainTPM) Unmarshal(doc string) error { return xml.Unmarshal([]byte(doc), d) } diff --git a/vendor/libvirt.org/go/libvirtxml/domain_capabilities.go b/vendor/libvirt.org/go/libvirtxml/domain_capabilities.go index 5b1cb0548e..60b83676eb 100644 --- a/vendor/libvirt.org/go/libvirtxml/domain_capabilities.go +++ b/vendor/libvirt.org/go/libvirtxml/domain_capabilities.go @@ -90,6 +90,7 @@ type DomainCapsCPUModel struct { Fallback string `xml:"fallback,attr,omitempty"` Deprecated string `xml:"deprecated,attr,omitempty"` Vendor string `xml:"vendor,attr,omitempty"` + Canonical string `xml:"canonical,attr,omitempty"` } type DomainCapsCPUFeature struct { @@ -128,6 +129,7 @@ type DomainCapsDevices struct { Channel *DomainCapsDevice `xml:"channel"` Crypto *DomainCapsDevice `xml:"crypto"` Interface *DomainCapsDevice `xml:"interface"` + Panic *DomainCapsDevice `xml:"panic"` } type DomainCapsDevice struct { diff --git a/vendor/modules.txt b/vendor/modules.txt index a33cdfdbdc..7e74faf3ef 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -1347,7 +1347,7 @@ k8s.io/utils/integer k8s.io/utils/internal/third_party/forked/golang/net k8s.io/utils/net k8s.io/utils/strings/slices -# libvirt.org/go/libvirtxml v1.10009.0 +# libvirt.org/go/libvirtxml v1.10010.0 ## explicit; go 1.11 libvirt.org/go/libvirtxml # sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd