提交 5adbd9cb 编写于 作者: J Jim Meyering

maint: change "" in err ? err->message : "" to _("unknown error"), ...

These changes avoid false-positive syntax-check failure,
and also make the resulting diagnostics more comprehensible.
上级 cc21fd9a
...@@ -634,7 +634,7 @@ qemuAutostartDomain(void *payload, const char *name ATTRIBUTE_UNUSED, void *opaq ...@@ -634,7 +634,7 @@ qemuAutostartDomain(void *payload, const char *name ATTRIBUTE_UNUSED, void *opaq
virErrorPtr err = virGetLastError(); virErrorPtr err = virGetLastError();
VIR_ERROR(_("Failed to autostart VM '%s': %s"), VIR_ERROR(_("Failed to autostart VM '%s': %s"),
vm->def->name, vm->def->name,
err ? err->message : ""); err ? err->message : _("unknown error"));
} else { } else {
virDomainEventPtr event = virDomainEventPtr event =
virDomainEventNewFromObj(vm, virDomainEventNewFromObj(vm,
...@@ -2895,7 +2895,7 @@ qemudReattachManagedDevice(pciDevice *dev) ...@@ -2895,7 +2895,7 @@ qemudReattachManagedDevice(pciDevice *dev)
if (pciReAttachDevice(dev) < 0) { if (pciReAttachDevice(dev) < 0) {
virErrorPtr err = virGetLastError(); virErrorPtr err = virGetLastError();
VIR_ERROR(_("Failed to re-attach PCI device: %s"), VIR_ERROR(_("Failed to re-attach PCI device: %s"),
err ? err->message : ""); err ? err->message : _("unknown error"));
virResetError(err); virResetError(err);
} }
} }
...@@ -2914,7 +2914,7 @@ qemuDomainReAttachHostDevices(struct qemud_driver *driver, ...@@ -2914,7 +2914,7 @@ qemuDomainReAttachHostDevices(struct qemud_driver *driver,
if (!(pcidevs = qemuGetPciHostDeviceList(def))) { if (!(pcidevs = qemuGetPciHostDeviceList(def))) {
virErrorPtr err = virGetLastError(); virErrorPtr err = virGetLastError();
VIR_ERROR(_("Failed to allocate pciDeviceList: %s"), VIR_ERROR(_("Failed to allocate pciDeviceList: %s"),
err ? err->message : ""); err ? err->message : _("unknown error"));
virResetError(err); virResetError(err);
return; return;
} }
...@@ -2932,7 +2932,7 @@ qemuDomainReAttachHostDevices(struct qemud_driver *driver, ...@@ -2932,7 +2932,7 @@ qemuDomainReAttachHostDevices(struct qemud_driver *driver,
if (pciResetDevice(dev, driver->activePciHostdevs) < 0) { if (pciResetDevice(dev, driver->activePciHostdevs) < 0) {
virErrorPtr err = virGetLastError(); virErrorPtr err = virGetLastError();
VIR_ERROR(_("Failed to reset PCI device: %s"), VIR_ERROR(_("Failed to reset PCI device: %s"),
err ? err->message : ""); err ? err->message : _("unknown error"));
virResetError(err); virResetError(err);
} }
} }
......
/* /*
* secret_driver.c: local driver for secret manipulation API * secret_driver.c: local driver for secret manipulation API
* *
* Copyright (C) 2009 Red Hat, Inc. * Copyright (C) 2009-2010 Red Hat, Inc.
* *
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public * modify it under the terms of the GNU Lesser General Public
...@@ -499,7 +499,7 @@ loadSecrets(virSecretDriverStatePtr driver, ...@@ -499,7 +499,7 @@ loadSecrets(virSecretDriverStatePtr driver,
virErrorPtr err = virGetLastError(); virErrorPtr err = virGetLastError();
VIR_ERROR(_("Error reading secret: %s"), VIR_ERROR(_("Error reading secret: %s"),
err != NULL ? err->message: ""); err != NULL ? err->message: _("unknown error"));
virResetError(err); virResetError(err);
continue; continue;
} }
......
...@@ -157,7 +157,7 @@ umlAutostartDomain(void *payload, const char *name ATTRIBUTE_UNUSED, void *opaqu ...@@ -157,7 +157,7 @@ umlAutostartDomain(void *payload, const char *name ATTRIBUTE_UNUSED, void *opaqu
if (umlStartVMDaemon(data->conn, data->driver, vm) < 0) { if (umlStartVMDaemon(data->conn, data->driver, vm) < 0) {
virErrorPtr err = virGetLastError(); virErrorPtr err = virGetLastError();
VIR_ERROR(_("Failed to autostart VM '%s': %s"), VIR_ERROR(_("Failed to autostart VM '%s': %s"),
vm->def->name, err ? err->message : ""); vm->def->name, err ? err->message : _("unknown error"));
} }
} }
virDomainObjUnlock(vm); virDomainObjUnlock(vm);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册