[libvirt] [libvirt-snmp][PATCH v2] Remove the hard coded connection URI.

So now we rely on libvirt LIBVIRT_DEFAULT_URI environment variable. --- src/libvirtSnmp.c | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git a/src/libvirtSnmp.c b/src/libvirtSnmp.c index ce21369..39b74bd 100644 --- a/src/libvirtSnmp.c +++ b/src/libvirtSnmp.c @@ -180,7 +180,8 @@ int libvirtSnmpInit(void) /* virConnectOpenAuth is called here with all default parameters, * except, possibly, the URI of the hypervisor. */ /* TODO: configure the URI */ - conn = virConnectOpenAuth("qemu:///system", virConnectAuthPtrDefault, 0); + /* Use libvirt env variable LIBVIRT_DEFAULT_URI by default*/ + conn = virConnectOpenAuth("", virConnectAuthPtrDefault, 0); if (NULL == conn) { printf("No connection to hypervisor\n"); -- 1.7.3.5

On Thu, Feb 10, 2011 at 10:02:35AM +0100, Michal Privoznik wrote:
So now we rely on libvirt LIBVIRT_DEFAULT_URI environment variable. --- src/libvirtSnmp.c | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/src/libvirtSnmp.c b/src/libvirtSnmp.c index ce21369..39b74bd 100644 --- a/src/libvirtSnmp.c +++ b/src/libvirtSnmp.c @@ -180,7 +180,8 @@ int libvirtSnmpInit(void) /* virConnectOpenAuth is called here with all default parameters, * except, possibly, the URI of the hypervisor. */ /* TODO: configure the URI */ - conn = virConnectOpenAuth("qemu:///system", virConnectAuthPtrDefault, 0); + /* Use libvirt env variable LIBVIRT_DEFAULT_URI by default*/ + conn = virConnectOpenAuth("", virConnectAuthPtrDefault, 0);
It needs to be NULL, rather than "". Regards, Daniel -- |: http://berrange.com -o- http://www.flickr.com/photos/dberrange/ :| |: http://libvirt.org -o- http://virt-manager.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: http://entangle-photo.org -o- http://live.gnome.org/gtk-vnc :|

On Thu, Feb 10, 2011 at 10:20:04AM +0000, Daniel P. Berrange wrote:
On Thu, Feb 10, 2011 at 10:02:35AM +0100, Michal Privoznik wrote:
So now we rely on libvirt LIBVIRT_DEFAULT_URI environment variable. --- src/libvirtSnmp.c | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/src/libvirtSnmp.c b/src/libvirtSnmp.c index ce21369..39b74bd 100644 --- a/src/libvirtSnmp.c +++ b/src/libvirtSnmp.c @@ -180,7 +180,8 @@ int libvirtSnmpInit(void) /* virConnectOpenAuth is called here with all default parameters, * except, possibly, the URI of the hypervisor. */ /* TODO: configure the URI */ - conn = virConnectOpenAuth("qemu:///system", virConnectAuthPtrDefault, 0); + /* Use libvirt env variable LIBVIRT_DEFAULT_URI by default*/ + conn = virConnectOpenAuth("", virConnectAuthPtrDefault, 0);
It needs to be NULL, rather than "".
ACK for a version with NULL :-) Daniel -- Daniel Veillard | libxml Gnome XML XSLT toolkit http://xmlsoft.org/ daniel@veillard.com | Rpmfind RPM search engine http://rpmfind.net/ http://veillard.com/ | virtualization library http://libvirt.org/
participants (3)
-
Daniel P. Berrange
-
Daniel Veillard
-
Michal Privoznik