[libvirt] [PATCH] qemu: error message should show uri instead of (null)

Fix pointer for error message uri if domain migration fails. BZ# 730244 --- src/qemu/qemu_migration.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c index 4d0e062..d900020 100644 --- a/src/qemu/qemu_migration.c +++ b/src/qemu/qemu_migration.c @@ -2079,7 +2079,7 @@ static int doPeer2PeerMigrate(struct qemud_driver *driver, qemuDomainObjExitRemoteWithDriver(driver, vm); if (dconn == NULL) { qemuReportError(VIR_ERR_OPERATION_FAILED, - _("Failed to connect to remote libvirt URI %s"), uri); + _("Failed to connect to remote libvirt URI %s"), dconnuri); return -1; } -- 1.7.3.4

On Mon, Aug 15, 2011 at 14:58:47 +0200, Peter Krempa wrote:
Fix pointer for error message uri if domain migration fails.
BZ# 730244 --- src/qemu/qemu_migration.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c index 4d0e062..d900020 100644 --- a/src/qemu/qemu_migration.c +++ b/src/qemu/qemu_migration.c @@ -2079,7 +2079,7 @@ static int doPeer2PeerMigrate(struct qemud_driver *driver, qemuDomainObjExitRemoteWithDriver(driver, vm); if (dconn == NULL) { qemuReportError(VIR_ERR_OPERATION_FAILED, - _("Failed to connect to remote libvirt URI %s"), uri); + _("Failed to connect to remote libvirt URI %s"), dconnuri); return -1; }
Oops, ACK and pushed. Jirka

On Mon, Aug 15, 2011 at 02:58:47PM +0200, Peter Krempa wrote:
Fix pointer for error message uri if domain migration fails.
BZ# 730244 --- src/qemu/qemu_migration.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c index 4d0e062..d900020 100644 --- a/src/qemu/qemu_migration.c +++ b/src/qemu/qemu_migration.c @@ -2079,7 +2079,7 @@ static int doPeer2PeerMigrate(struct qemud_driver *driver, qemuDomainObjExitRemoteWithDriver(driver, vm); if (dconn == NULL) { qemuReportError(VIR_ERR_OPERATION_FAILED, - _("Failed to connect to remote libvirt URI %s"), uri); + _("Failed to connect to remote libvirt URI %s"), dconnuri); return -1; }
Seems to me that if dconnuri was NULL we would certainly hit dconn == NULL as a result. That said we were printing the wrong URL so that's still an improvement :-) maybe use (dconnuri ? dconnuri : "NULL") or test and make 2 spearate messages, but that probably excessive :-) 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/

On 08/15/2011 07:43 AM, Daniel Veillard wrote:
qemuReportError(VIR_ERR_OPERATION_FAILED, - _("Failed to connect to remote libvirt URI %s"), uri); + _("Failed to connect to remote libvirt URI %s"), dconnuri); return -1; }
Seems to me that if dconnuri was NULL we would certainly hit dconn == NULL as a result. That said we were printing the wrong URL so that's still an improvement :-)
maybe use (dconnuri ? dconnuri : "NULL")
We already have a macro for that: NULLSTR(dconnuri).
or test and make 2 spearate messages, but that probably excessive :-)
Agree that 2 messages is overkill in this case. -- Eric Blake eblake@redhat.com +1-801-349-2682 Libvirt virtualization library http://libvirt.org

于 2011年08月15日 21:43, Daniel Veillard 写道:
On Mon, Aug 15, 2011 at 02:58:47PM +0200, Peter Krempa wrote:
Fix pointer for error message uri if domain migration fails.
BZ# 730244 --- src/qemu/qemu_migration.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c index 4d0e062..d900020 100644 --- a/src/qemu/qemu_migration.c +++ b/src/qemu/qemu_migration.c @@ -2079,7 +2079,7 @@ static int doPeer2PeerMigrate(struct qemud_driver *driver, qemuDomainObjExitRemoteWithDriver(driver, vm); if (dconn == NULL) { qemuReportError(VIR_ERR_OPERATION_FAILED, - _("Failed to connect to remote libvirt URI %s"), uri); + _("Failed to connect to remote libvirt URI %s"), dconnuri); return -1; }
Seems to me that if dconnuri was NULL we would certainly hit dconn == NULL as a result. That said we were printing the wrong URL so that's still an improvement :-)
maybe use (dconnuri ? dconnuri : "NULL")
This should be NULLSTR(dconnuri).
or test and make 2 spearate messages, but that probably excessive :-)
Daniel
participants (5)
-
Daniel Veillard
-
Eric Blake
-
Jiri Denemark
-
Osier Yang
-
Peter Krempa