diff options
author | Thomas Hipp <thipp@suse.de> | 2017-02-22 13:20:09 +0100 |
---|---|---|
committer | Thomas Hipp <thipp@suse.de> | 2017-03-15 13:59:59 +0100 |
commit | d6174cad42eef4d8d08bddb4d316620ae0a75f9b (patch) | |
tree | 1061566017c02c6d1aa31b7834914139ee246332 /libvirt/domain_def.go | |
parent | 7bcecfecfe90390ea14d27c324111a1224b86280 (diff) | |
download | terraform-provider-libvirt-d6174cad42eef4d8d08bddb4d316620ae0a75f9b.tar terraform-provider-libvirt-d6174cad42eef4d8d08bddb4d316620ae0a75f9b.tar.gz |
Exclude `graphics` block on s390x and ppc64
Since the `graphics` and `video` devices cause problems on s390x and
ppc64, they are ignored when creating a domain.
Signed-off-by: Thomas Hipp <thipp@suse.de>
Diffstat (limited to 'libvirt/domain_def.go')
-rw-r--r-- | libvirt/domain_def.go | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/libvirt/domain_def.go b/libvirt/domain_def.go index 3920c979..f41a88bd 100644 --- a/libvirt/domain_def.go +++ b/libvirt/domain_def.go @@ -25,13 +25,7 @@ type defDomain struct { Disks []defDisk `xml:"disk"` NetworkInterfaces []defNetworkInterface `xml:"interface"` Console []defConsole `xml:"console"` - Graphics struct { - Type string `xml:"type,attr"` - Autoport string `xml:"autoport,attr"` - Listen struct { - Type string `xml:"type,attr"` - } `xml:"listen"` - } `xml:"graphics"` + Graphics *defGraphics `xml:"graphics,omitempty"` // QEMU guest agent channel QemuGAChannel struct { Type string `xml:"type,attr"` @@ -56,6 +50,14 @@ type defDomain struct { } } +type defGraphics struct { + Type string `xml:"type,attr"` + Autoport string `xml:"autoport,attr"` + Listen struct { + Type string `xml:"type,attr"` + } `xml:"listen"` +} + type defMetadata struct { XMLName xml.Name `xml:"http://github.com/dmacvicar/terraform-provider-libvirt/ user_data"` Xml string `xml:",cdata"` @@ -130,6 +132,7 @@ func newDomainDef() defDomain { domainDef.VCpu.Placement = "static" domainDef.VCpu.Amount = 1 + domainDef.Devices.Graphics = &defGraphics{} domainDef.Devices.Graphics.Type = "spice" domainDef.Devices.Graphics.Autoport = "yes" domainDef.Devices.Graphics.Listen.Type = "none" |