[libvirt] [PATCH go-xml] Add reconnect support for vhost-user interfaces

Introduced in libvirt commit 614be3b88276. Signed-off-by: Andrea Bolognani <abologna@redhat.com> --- Does this look like Go to you? Because I have no idea what I'm doing. domain.go | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/domain.go b/domain.go index 429e61b..4f7725a 100644 --- a/domain.go +++ b/domain.go @@ -392,9 +392,10 @@ type DomainInterfaceSourceEthernet struct { } type DomainInterfaceSourceVHostUser struct { - Type string `xml:"type,attr"` - Path string `xml:"path,attr,omitempty"` - Mode string `xml:"mode,attr,omitempty"` + Type string `xml:"type,attr"` + Path string `xml:"path,attr,omitempty"` + Mode string `xml:"mode,attr,omitempty"` + Reconnect *DomainInterfaceSourceReconnect `xml:"reconnect"` } type DomainInterfaceSourceServer struct { @@ -449,6 +450,11 @@ type DomainInterfaceSourceLocal struct { Port uint `xml:"port,attr,omitempty"` } +type DomainInterfaceSourceReconnect struct { + Enabled string `xml:"enabled,attr"` + Timeout *uint `xml:"timeout,attr"` +} + type DomainInterfaceTarget struct { Dev string `xml:"dev,attr"` } -- 2.14.3

On Wed, Jan 31, 2018 at 02:20:42PM +0100, Andrea Bolognani wrote:
Introduced in libvirt commit 614be3b88276.
Signed-off-by: Andrea Bolognani <abologna@redhat.com> --- Does this look like Go to you? Because I have no idea what I'm doing.
The Go code is fine, but the root cause bug is a mistake I made earlier, which has a nicer fix. I should have just referenced the DomainChardevSource element directly since vhostuser <source> follows the chardev schema. So I've pushed an alternative fix.
domain.go | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-)
diff --git a/domain.go b/domain.go index 429e61b..4f7725a 100644 --- a/domain.go +++ b/domain.go @@ -392,9 +392,10 @@ type DomainInterfaceSourceEthernet struct { }
type DomainInterfaceSourceVHostUser struct { - Type string `xml:"type,attr"` - Path string `xml:"path,attr,omitempty"` - Mode string `xml:"mode,attr,omitempty"` + Type string `xml:"type,attr"` + Path string `xml:"path,attr,omitempty"` + Mode string `xml:"mode,attr,omitempty"` + Reconnect *DomainInterfaceSourceReconnect `xml:"reconnect"` }
type DomainInterfaceSourceServer struct { @@ -449,6 +450,11 @@ type DomainInterfaceSourceLocal struct { Port uint `xml:"port,attr,omitempty"` }
+type DomainInterfaceSourceReconnect struct { + Enabled string `xml:"enabled,attr"` + Timeout *uint `xml:"timeout,attr"` +} + type DomainInterfaceTarget struct { Dev string `xml:"dev,attr"` } -- 2.14.3
-- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list
Regards, Daniel -- |: https://berrange.com -o- https://www.flickr.com/photos/dberrange :| |: https://libvirt.org -o- https://fstop138.berrange.com :| |: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|
participants (2)
-
Andrea Bolognani
-
Daniel P. Berrangé