Skip to content

Commit

Permalink
Merge pull request kubevirt#2791 from rmohr/agent-nil
Browse files Browse the repository at this point in the history
Fix nil exception when agent polling can't reach libvirt
  • Loading branch information
rmohr authored Oct 9, 2019
2 parents d88ac23 + 5f9cb75 commit cedc575
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions pkg/virt-launcher/virtwrap/cli/libvirt.go
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,13 @@ func (l *LibvirtConnection) ListAllDomains(flags libvirt.ConnectListAllDomainsFl
// command - the qemu command, for example this gets the interfaces: {"execute":"guest-network-get-interfaces"}
// domainName - the qemu domain name
func (l *LibvirtConnection) QemuAgentCommand(command string, domainName string) (string, error) {
if err := l.reconnectIfNecessary(); err != nil {
return "", err
}
domain, err := l.Connect.LookupDomainByName(domainName)
if err != nil {
return "", err
}
result, err := domain.QemuAgentCommand(command, libvirt.DOMAIN_QEMU_AGENT_COMMAND_DEFAULT, uint32(0))
return result, err
}
Expand Down

0 comments on commit cedc575

Please sign in to comment.