diff options
author | Flavio Castelli <flavio@castelli.name> | 2017-03-15 14:44:57 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-03-15 14:44:57 +0100 |
commit | 68630335a6c23ab544661b8ef9c6692df886fd7d (patch) | |
tree | 48f112dc8e1dd890d14db88a9d70f35490486b82 /libvirt/domain_def.go | |
parent | 7238954130c9168fa67ff279970c75ab9f13ea81 (diff) | |
parent | e406fb5ff2e228264a93520d91d586e4ff9824b3 (diff) | |
download | terraform-provider-libvirt-68630335a6c23ab544661b8ef9c6692df886fd7d.tar terraform-provider-libvirt-68630335a6c23ab544661b8ef9c6692df886fd7d.tar.gz |
Merge pull request #103 from monstermunchkin/graphics-device
create domain without graphics device
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 f26b549c..306286ed 100644 --- a/libvirt/domain_def.go +++ b/libvirt/domain_def.go @@ -26,13 +26,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"` @@ -57,6 +51,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"` @@ -135,6 +137,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" |