diff --git a/libvirt/domain.go b/libvirt/domain.go index 674476e31..b9cbec0a3 100644 --- a/libvirt/domain.go +++ b/libvirt/domain.go @@ -463,6 +463,19 @@ func setConsoles(d *schema.ResourceData, domainDef *libvirtxml.Domain) error { console.Protocol = &libvirtxml.DomainChardevProtocol{ Type: "telnet", } + case "udp": + sourceHost := d.Get(prefix + ".source_host") + sourceService := d.Get(prefix + ".source_service") + connectHost := d.Get(prefix + ".connect_host") + connectService := d.Get(prefix + ".connect_service") + console.Source = &libvirtxml.DomainChardevSource{ + UDP: &libvirtxml.DomainChardevSourceUDP{ + BindHost: sourceHost.(string), + BindService: sourceService.(string), + ConnectHost: connectHost.(string), + ConnectService: connectService.(string), + }, + } case "pty": if sourcePath, ok := d.GetOk(prefix + ".source_path"); ok { console.Source = &libvirtxml.DomainChardevSource{ @@ -471,6 +484,15 @@ func setConsoles(d *schema.ResourceData, domainDef *libvirtxml.Domain) error { }, } } + case "file": + if sourcePath, ok := d.GetOk(prefix + ".source_path"); ok { + console.Source = &libvirtxml.DomainChardevSource{ + File: &libvirtxml.DomainChardevSourceFile{ + Path: sourcePath.(string), + Append: "on", + }, + } + } default: if sourcePath, ok := d.GetOk(prefix + ".source_path"); ok { console.Source = &libvirtxml.DomainChardevSource{ diff --git a/libvirt/resource_libvirt_domain.go b/libvirt/resource_libvirt_domain.go index 413a58485..2e4725cd0 100644 --- a/libvirt/resource_libvirt_domain.go +++ b/libvirt/resource_libvirt_domain.go @@ -337,6 +337,16 @@ func resourceLibvirtDomain() *schema.Resource { Optional: true, ForceNew: true, }, + "connect_host": { + Type: schema.TypeString, + Required: true, + ForceNew: true, + }, + "connect_service": { + Type: schema.TypeString, + Optional: true, + ForceNew: true, + }, }, }, },