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.
This commit is contained in:
Jim Meyering 2010-05-20 08:44:27 +02:00
parent cc21fd9a91
commit 5adbd9cb4c
3 changed files with 7 additions and 7 deletions

View File

@ -634,7 +634,7 @@ qemuAutostartDomain(void *payload, const char *name ATTRIBUTE_UNUSED, void *opaq
virErrorPtr err = virGetLastError();
VIR_ERROR(_("Failed to autostart VM '%s': %s"),
vm->def->name,
err ? err->message : "");
err ? err->message : _("unknown error"));
} else {
virDomainEventPtr event =
virDomainEventNewFromObj(vm,
@ -2895,7 +2895,7 @@ qemudReattachManagedDevice(pciDevice *dev)
if (pciReAttachDevice(dev) < 0) {
virErrorPtr err = virGetLastError();
VIR_ERROR(_("Failed to re-attach PCI device: %s"),
err ? err->message : "");
err ? err->message : _("unknown error"));
virResetError(err);
}
}
@ -2914,7 +2914,7 @@ qemuDomainReAttachHostDevices(struct qemud_driver *driver,
if (!(pcidevs = qemuGetPciHostDeviceList(def))) {
virErrorPtr err = virGetLastError();
VIR_ERROR(_("Failed to allocate pciDeviceList: %s"),
err ? err->message : "");
err ? err->message : _("unknown error"));
virResetError(err);
return;
}
@ -2932,7 +2932,7 @@ qemuDomainReAttachHostDevices(struct qemud_driver *driver,
if (pciResetDevice(dev, driver->activePciHostdevs) < 0) {
virErrorPtr err = virGetLastError();
VIR_ERROR(_("Failed to reset PCI device: %s"),
err ? err->message : "");
err ? err->message : _("unknown error"));
virResetError(err);
}
}

View File

@ -1,7 +1,7 @@
/*
* 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
* modify it under the terms of the GNU Lesser General Public
@ -499,7 +499,7 @@ loadSecrets(virSecretDriverStatePtr driver,
virErrorPtr err = virGetLastError();
VIR_ERROR(_("Error reading secret: %s"),
err != NULL ? err->message: "");
err != NULL ? err->message: _("unknown error"));
virResetError(err);
continue;
}

View File

@ -157,7 +157,7 @@ umlAutostartDomain(void *payload, const char *name ATTRIBUTE_UNUSED, void *opaqu
if (umlStartVMDaemon(data->conn, data->driver, vm) < 0) {
virErrorPtr err = virGetLastError();
VIR_ERROR(_("Failed to autostart VM '%s': %s"),
vm->def->name, err ? err->message : "");
vm->def->name, err ? err->message : _("unknown error"));
}
}
virDomainObjUnlock(vm);