From a2ef003d870d614cfc9d75d95d11aed9a601461f Mon Sep 17 00:00:00 2001 From: Anthony Hinsinger Date: Thu, 16 Apr 2015 17:58:20 +0200 Subject: [PATCH 1/2] Fixed a bug in GetInterfaceStats --- src/domain.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/domain.cc b/src/domain.cc index 227ba14..842e3bd 100644 --- a/src/domain.cc +++ b/src/domain.cc @@ -964,7 +964,7 @@ NLV_WORKER_EXECUTE(Domain, GetInterfaceStats) { NLV_WORKER_ASSERT_DOMAIN(); int result = - virDomainInterfaceStats(Handle().ToDomain(), interface_.c_str(), &stats_, sizeof(&stats_)); + virDomainInterfaceStats(Handle().ToDomain(), interface_.c_str(), &stats_, sizeof(stats_)); if (result == -1) { SetVirError(virGetLastError()); return; From d1e54373317a57dde9bd5a09b1479f832b6c6d8c Mon Sep 17 00:00:00 2001 From: Anthony Hinsinger Date: Thu, 16 Apr 2015 17:59:05 +0200 Subject: [PATCH 2/2] Used Promise bind() function to set this --- lib/index.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/index.js b/lib/index.js index f29084d..89ae73b 100644 --- a/lib/index.js +++ b/lib/index.js @@ -19,20 +19,20 @@ Promise.promisifyAll(libvirt.StorageVolume.prototype); libvirt.Hypervisor.prototype.getAllDomains = function() { var defined; - return this.listDefinedDomainsAsync() + return this.listDefinedDomainsAsync().bind(this) .map(function(name) { return this.lookupDomainByNameAsync(name); - }.bind(this)) + }) .then(function(domains) { defined = domains; return this.listActiveDomainsAsync(); - }.bind(this)) + }) .map(function(id) { return this.lookupDomainByIdAsync(id); - }.bind(this)) + }) .then(function(domains) { return domains.concat(defined); - }) + }); } module.exports = {