提交 8d63d82e 编写于 作者: J Jim Meyering

maint: mark translatable string args of VIR_ERROR0

Run this:
  git grep -l 'VIR_ERROR0\s*("'|xargs perl -pi -e \
    's/(VIR_ERROR0)\s*\((".*?")\)/$1(_($2))/'
上级 5910472f
...@@ -3202,7 +3202,7 @@ int main(int argc, char **argv) { ...@@ -3202,7 +3202,7 @@ int main(int argc, char **argv) {
/* Start the event loop in a background thread, since /* Start the event loop in a background thread, since
* state initialization needs events to be being processed */ * state initialization needs events to be being processed */
if (qemudStartEventLoop(server) < 0) { if (qemudStartEventLoop(server) < 0) {
VIR_ERROR0("Event thread startup failed"); VIR_ERROR0(_("Event thread startup failed"));
goto error; goto error;
} }
...@@ -3211,14 +3211,14 @@ int main(int argc, char **argv) { ...@@ -3211,14 +3211,14 @@ int main(int argc, char **argv) {
* we're ready, since it can take a long time and this will * we're ready, since it can take a long time and this will
* seriously delay OS bootup process */ * seriously delay OS bootup process */
if (virStateInitialize(server->privileged) < 0) { if (virStateInitialize(server->privileged) < 0) {
VIR_ERROR0("Driver state initialization failed"); VIR_ERROR0(_("Driver state initialization failed"));
goto shutdown; goto shutdown;
} }
/* Start accepting new clients from network */ /* Start accepting new clients from network */
virMutexLock(&server->lock); virMutexLock(&server->lock);
if (qemudNetworkEnable(server) < 0) { if (qemudNetworkEnable(server) < 0) {
VIR_ERROR0("Network event loop enablement failed"); VIR_ERROR0(_("Network event loop enablement failed"));
goto shutdown; goto shutdown;
} }
virMutexUnlock(&server->lock); virMutexUnlock(&server->lock);
......
...@@ -1892,14 +1892,14 @@ esxDomainGetInfo(virDomainPtr domain, virDomainInfoPtr info) ...@@ -1892,14 +1892,14 @@ esxDomainGetInfo(virDomainPtr domain, virDomainInfoPtr info)
esxVI_PerfEntityMetric_DynamicCast(perfEntityMetricBase); esxVI_PerfEntityMetric_DynamicCast(perfEntityMetricBase);
if (perfMetricIntSeries == NULL) { if (perfMetricIntSeries == NULL) {
VIR_ERROR0("QueryPerf returned object with unexpected type"); VIR_ERROR0(_("QueryPerf returned object with unexpected type"));
} }
perfMetricIntSeries = perfMetricIntSeries =
esxVI_PerfMetricIntSeries_DynamicCast(perfEntityMetric->value); esxVI_PerfMetricIntSeries_DynamicCast(perfEntityMetric->value);
if (perfMetricIntSeries == NULL) { if (perfMetricIntSeries == NULL) {
VIR_ERROR0("QueryPerf returned object with unexpected type"); VIR_ERROR0(_("QueryPerf returned object with unexpected type"));
} }
for (; perfMetricIntSeries != NULL; for (; perfMetricIntSeries != NULL;
......
...@@ -718,22 +718,22 @@ static int halDeviceMonitorStartup(int privileged ATTRIBUTE_UNUSED) ...@@ -718,22 +718,22 @@ static int halDeviceMonitorStartup(int privileged ATTRIBUTE_UNUSED)
dbus_error_init(&err); dbus_error_init(&err);
hal_ctx = libhal_ctx_new(); hal_ctx = libhal_ctx_new();
if (hal_ctx == NULL) { if (hal_ctx == NULL) {
VIR_ERROR0("libhal_ctx_new returned NULL"); VIR_ERROR0(_("libhal_ctx_new returned NULL"));
goto failure; goto failure;
} }
dbus_conn = dbus_bus_get(DBUS_BUS_SYSTEM, &err); dbus_conn = dbus_bus_get(DBUS_BUS_SYSTEM, &err);
if (dbus_conn == NULL) { if (dbus_conn == NULL) {
VIR_ERROR0("dbus_bus_get failed"); VIR_ERROR0(_("dbus_bus_get failed"));
goto failure; goto failure;
} }
dbus_connection_set_exit_on_disconnect(dbus_conn, FALSE); dbus_connection_set_exit_on_disconnect(dbus_conn, FALSE);
if (!libhal_ctx_set_dbus_connection(hal_ctx, dbus_conn)) { if (!libhal_ctx_set_dbus_connection(hal_ctx, dbus_conn)) {
VIR_ERROR0("libhal_ctx_set_dbus_connection failed"); VIR_ERROR0(_("libhal_ctx_set_dbus_connection failed"));
goto failure; goto failure;
} }
if (!libhal_ctx_init(hal_ctx, &err)) { if (!libhal_ctx_init(hal_ctx, &err)) {
VIR_ERROR0("libhal_ctx_init failed, haldaemon is probably not running"); VIR_ERROR0(_("libhal_ctx_init failed, haldaemon is probably not running"));
/* We don't want to show a fatal error here, /* We don't want to show a fatal error here,
otherwise entire libvirtd shuts down when otherwise entire libvirtd shuts down when
hald isn't running */ hald isn't running */
...@@ -747,7 +747,7 @@ static int halDeviceMonitorStartup(int privileged ATTRIBUTE_UNUSED) ...@@ -747,7 +747,7 @@ static int halDeviceMonitorStartup(int privileged ATTRIBUTE_UNUSED)
remove_dbus_watch, remove_dbus_watch,
toggle_dbus_watch, toggle_dbus_watch,
NULL, NULL)) { NULL, NULL)) {
VIR_ERROR0("dbus_connection_set_watch_functions failed"); VIR_ERROR0(_("dbus_connection_set_watch_functions failed"));
goto failure; goto failure;
} }
...@@ -768,13 +768,13 @@ static int halDeviceMonitorStartup(int privileged ATTRIBUTE_UNUSED) ...@@ -768,13 +768,13 @@ static int halDeviceMonitorStartup(int privileged ATTRIBUTE_UNUSED)
!libhal_ctx_set_device_lost_capability(hal_ctx, device_cap_lost) || !libhal_ctx_set_device_lost_capability(hal_ctx, device_cap_lost) ||
!libhal_ctx_set_device_property_modified(hal_ctx, device_prop_modified) || !libhal_ctx_set_device_property_modified(hal_ctx, device_prop_modified) ||
!libhal_device_property_watch_all(hal_ctx, &err)) { !libhal_device_property_watch_all(hal_ctx, &err)) {
VIR_ERROR0("setting up HAL callbacks failed"); VIR_ERROR0(_("setting up HAL callbacks failed"));
goto failure; goto failure;
} }
udi = libhal_get_all_devices(hal_ctx, &num_devs, &err); udi = libhal_get_all_devices(hal_ctx, &num_devs, &err);
if (udi == NULL) { if (udi == NULL) {
VIR_ERROR0("libhal_get_all_devices failed"); VIR_ERROR0(_("libhal_get_all_devices failed"));
goto failure; goto failure;
} }
for (i = 0; i < num_devs; i++) { for (i = 0; i < num_devs; i++) {
...@@ -835,7 +835,7 @@ static int halDeviceMonitorReload(void) ...@@ -835,7 +835,7 @@ static int halDeviceMonitorReload(void)
dbus_error_init(&err); dbus_error_init(&err);
udi = libhal_get_all_devices(hal_ctx, &num_devs, &err); udi = libhal_get_all_devices(hal_ctx, &num_devs, &err);
if (udi == NULL) { if (udi == NULL) {
VIR_ERROR0("libhal_get_all_devices failed"); VIR_ERROR0(_("libhal_get_all_devices failed"));
return -1; return -1;
} }
for (i = 0; i < num_devs; i++) { for (i = 0; i < num_devs; i++) {
......
...@@ -272,7 +272,7 @@ static int get_sriov_function(const char *device_link, ...@@ -272,7 +272,7 @@ static int get_sriov_function(const char *device_link,
VIR_DEBUG("SR IOV device path is '%s'", device_path); VIR_DEBUG("SR IOV device path is '%s'", device_path);
config_address = basename(device_path); config_address = basename(device_path);
if (VIR_ALLOC(*bdf) != 0) { if (VIR_ALLOC(*bdf) != 0) {
VIR_ERROR0("Failed to allocate memory for PCI device name"); VIR_ERROR0(_("Failed to allocate memory for PCI device name"));
goto out; goto out;
} }
......
...@@ -368,7 +368,7 @@ static int udevTranslatePCIIds(unsigned int vendor, ...@@ -368,7 +368,7 @@ static int udevTranslatePCIIds(unsigned int vendor,
const char *vendor_name = NULL, *device_name = NULL; const char *vendor_name = NULL, *device_name = NULL;
if (pci_system_init() != 0) { if (pci_system_init() != 0) {
VIR_ERROR0("Failed to initialize libpciaccess"); VIR_ERROR0(_("Failed to initialize libpciaccess"));
goto out; goto out;
} }
...@@ -1408,7 +1408,7 @@ static void udevEventHandleCallback(int watch ATTRIBUTE_UNUSED, ...@@ -1408,7 +1408,7 @@ static void udevEventHandleCallback(int watch ATTRIBUTE_UNUSED,
device = udev_monitor_receive_device(udev_monitor); device = udev_monitor_receive_device(udev_monitor);
if (device == NULL) { if (device == NULL) {
VIR_ERROR0("udev_monitor_receive_device returned NULL"); VIR_ERROR0(_("udev_monitor_receive_device returned NULL"));
goto out; goto out;
} }
...@@ -1572,7 +1572,7 @@ static int udevDeviceMonitorStartup(int privileged ATTRIBUTE_UNUSED) ...@@ -1572,7 +1572,7 @@ static int udevDeviceMonitorStartup(int privileged ATTRIBUTE_UNUSED)
} }
if (virMutexInit(&driverState->lock) < 0) { if (virMutexInit(&driverState->lock) < 0) {
VIR_ERROR0("Failed to initialize mutex for driverState"); VIR_ERROR0(_("Failed to initialize mutex for driverState"));
VIR_FREE(priv); VIR_FREE(priv);
VIR_FREE(driverState); VIR_FREE(driverState);
ret = -1; ret = -1;
...@@ -1594,7 +1594,7 @@ static int udevDeviceMonitorStartup(int privileged ATTRIBUTE_UNUSED) ...@@ -1594,7 +1594,7 @@ static int udevDeviceMonitorStartup(int privileged ATTRIBUTE_UNUSED)
if (priv->udev_monitor == NULL) { if (priv->udev_monitor == NULL) {
VIR_FREE(priv); VIR_FREE(priv);
nodeDeviceUnlock(driverState); nodeDeviceUnlock(driverState);
VIR_ERROR0("udev_monitor_new_from_netlink returned NULL"); VIR_ERROR0(_("udev_monitor_new_from_netlink returned NULL"));
ret = -1; ret = -1;
goto out; goto out;
} }
......
...@@ -1233,30 +1233,30 @@ phypDomainDumpXML(virDomainPtr dom, int flags) ...@@ -1233,30 +1233,30 @@ phypDomainDumpXML(virDomainPtr dom, int flags)
dom->conn); dom->conn);
if (lpar_name == NULL) { if (lpar_name == NULL) {
VIR_ERROR0("Unable to determine domain's name."); VIR_ERROR0(_("Unable to determine domain's name."));
goto err; goto err;
} }
if (phypGetLparUUID(def.uuid, dom->id, dom->conn) == -1) { if (phypGetLparUUID(def.uuid, dom->id, dom->conn) == -1) {
VIR_ERROR0("Unable to generate random uuid."); VIR_ERROR0(_("Unable to generate random uuid."));
goto err; goto err;
} }
if ((def.maxmem = if ((def.maxmem =
phypGetLparMem(dom->conn, managed_system, dom->id, 0)) == 0) { phypGetLparMem(dom->conn, managed_system, dom->id, 0)) == 0) {
VIR_ERROR0("Unable to determine domain's max memory."); VIR_ERROR0(_("Unable to determine domain's max memory."));
goto err; goto err;
} }
if ((def.memory = if ((def.memory =
phypGetLparMem(dom->conn, managed_system, dom->id, 1)) == 0) { phypGetLparMem(dom->conn, managed_system, dom->id, 1)) == 0) {
VIR_ERROR0("Unable to determine domain's memory."); VIR_ERROR0(_("Unable to determine domain's memory."));
goto err; goto err;
} }
if ((def.vcpus = if ((def.vcpus =
phypGetLparCPU(dom->conn, managed_system, dom->id)) == 0) { phypGetLparCPU(dom->conn, managed_system, dom->id)) == 0) {
VIR_ERROR0("Unable to determine domain's CPU."); VIR_ERROR0(_("Unable to determine domain's CPU."));
goto err; goto err;
} }
...@@ -1695,7 +1695,7 @@ phypBuildLpar(virConnectPtr conn, virDomainDefPtr def) ...@@ -1695,7 +1695,7 @@ phypBuildLpar(virConnectPtr conn, virDomainDefPtr def)
} }
if (phypUUIDTable_AddLpar(conn, def->uuid, def->id) == -1) { if (phypUUIDTable_AddLpar(conn, def->uuid, def->id) == -1) {
VIR_ERROR0("Unable to add LPAR to the table"); VIR_ERROR0(_("Unable to add LPAR to the table"));
goto err; goto err;
} }
...@@ -1835,13 +1835,13 @@ phypUUIDTable_WriteFile(virConnectPtr conn) ...@@ -1835,13 +1835,13 @@ phypUUIDTable_WriteFile(virConnectPtr conn)
if (safewrite(fd, &uuid_table->lpars[i]->id, if (safewrite(fd, &uuid_table->lpars[i]->id,
sizeof(uuid_table->lpars[i]->id)) != sizeof(uuid_table->lpars[i]->id)) !=
sizeof(uuid_table->lpars[i]->id)) { sizeof(uuid_table->lpars[i]->id)) {
VIR_ERROR0("Unable to write information to local file."); VIR_ERROR0(_("Unable to write information to local file."));
goto err; goto err;
} }
if (safewrite(fd, uuid_table->lpars[i]->uuid, VIR_UUID_BUFLEN) != if (safewrite(fd, uuid_table->lpars[i]->uuid, VIR_UUID_BUFLEN) !=
VIR_UUID_BUFLEN) { VIR_UUID_BUFLEN) {
VIR_ERROR0("Unable to write information to local file."); VIR_ERROR0(_("Unable to write information to local file."));
goto err; goto err;
} }
} }
......
...@@ -184,7 +184,7 @@ static void qemuDomainObjPrivateFree(void *data) ...@@ -184,7 +184,7 @@ static void qemuDomainObjPrivateFree(void *data)
/* This should never be non-NULL if we get here, but just in case... */ /* This should never be non-NULL if we get here, but just in case... */
if (priv->mon) { if (priv->mon) {
VIR_ERROR0("Unexpected QEMU monitor still active during domain deletion"); VIR_ERROR0(_("Unexpected QEMU monitor still active during domain deletion"));
qemuMonitorClose(priv->mon); qemuMonitorClose(priv->mon);
} }
VIR_FREE(priv); VIR_FREE(priv);
...@@ -1392,7 +1392,7 @@ static void qemuDomainSnapshotLoad(void *payload, ...@@ -1392,7 +1392,7 @@ static void qemuDomainSnapshotLoad(void *payload,
VIR_INFO("Loading snapshot file '%s'", entry->d_name); VIR_INFO("Loading snapshot file '%s'", entry->d_name);
if (virAsprintf(&fullpath, "%s/%s", snapDir, entry->d_name) < 0) { if (virAsprintf(&fullpath, "%s/%s", snapDir, entry->d_name) < 0) {
VIR_ERROR0("Failed to allocate memory for path"); VIR_ERROR0(_("Failed to allocate memory for path"));
continue; continue;
} }
......
...@@ -780,7 +780,7 @@ static int umlCleanupTapDevices(virConnectPtr conn ATTRIBUTE_UNUSED, ...@@ -780,7 +780,7 @@ static int umlCleanupTapDevices(virConnectPtr conn ATTRIBUTE_UNUSED,
int err; int err;
int ret = 0; int ret = 0;
brControl *brctl = NULL; brControl *brctl = NULL;
VIR_ERROR0("Cleanup tap"); VIR_ERROR0(_("Cleanup tap"));
if (brInit(&brctl) < 0) if (brInit(&brctl) < 0)
return -1; return -1;
...@@ -798,7 +798,7 @@ static int umlCleanupTapDevices(virConnectPtr conn ATTRIBUTE_UNUSED, ...@@ -798,7 +798,7 @@ static int umlCleanupTapDevices(virConnectPtr conn ATTRIBUTE_UNUSED,
ret = -1; ret = -1;
} }
} }
VIR_ERROR0("Cleanup tap done"); VIR_ERROR0(_("Cleanup tap done"));
brShutdown(brctl); brShutdown(brctl);
return ret; return ret;
} }
......
...@@ -83,7 +83,7 @@ static int virCgroupDetectMounts(virCgroupPtr group) ...@@ -83,7 +83,7 @@ static int virCgroupDetectMounts(virCgroupPtr group)
mounts = fopen("/proc/mounts", "r"); mounts = fopen("/proc/mounts", "r");
if (mounts == NULL) { if (mounts == NULL) {
VIR_ERROR0("Unable to open /proc/mounts"); VIR_ERROR0(_("Unable to open /proc/mounts"));
return -ENOENT; return -ENOENT;
} }
...@@ -136,7 +136,7 @@ static int virCgroupDetectPlacement(virCgroupPtr group) ...@@ -136,7 +136,7 @@ static int virCgroupDetectPlacement(virCgroupPtr group)
mapping = fopen("/proc/self/cgroup", "r"); mapping = fopen("/proc/self/cgroup", "r");
if (mapping == NULL) { if (mapping == NULL) {
VIR_ERROR0("Unable to open /proc/self/cgroup"); VIR_ERROR0(_("Unable to open /proc/self/cgroup"));
return -ENOENT; return -ENOENT;
} }
......
...@@ -159,7 +159,7 @@ virProxyForkServer(void) ...@@ -159,7 +159,7 @@ virProxyForkServer(void)
if (virExecDaemonize(proxyarg, NULL, NULL, if (virExecDaemonize(proxyarg, NULL, NULL,
&pid, -1, NULL, NULL, 0, &pid, -1, NULL, NULL, 0,
NULL, NULL, NULL) < 0) NULL, NULL, NULL) < 0)
VIR_ERROR0("Failed to fork libvirt_proxy"); VIR_ERROR0(_("Failed to fork libvirt_proxy"));
return (0); return (0);
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册