mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-22 04:25:18 +00:00
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))/'
This commit is contained in:
parent
5910472fa5
commit
8d63d82e5c
@ -3202,7 +3202,7 @@ int main(int argc, char **argv) {
|
||||
/* Start the event loop in a background thread, since
|
||||
* state initialization needs events to be being processed */
|
||||
if (qemudStartEventLoop(server) < 0) {
|
||||
VIR_ERROR0("Event thread startup failed");
|
||||
VIR_ERROR0(_("Event thread startup failed"));
|
||||
goto error;
|
||||
}
|
||||
|
||||
@ -3211,14 +3211,14 @@ int main(int argc, char **argv) {
|
||||
* we're ready, since it can take a long time and this will
|
||||
* seriously delay OS bootup process */
|
||||
if (virStateInitialize(server->privileged) < 0) {
|
||||
VIR_ERROR0("Driver state initialization failed");
|
||||
VIR_ERROR0(_("Driver state initialization failed"));
|
||||
goto shutdown;
|
||||
}
|
||||
|
||||
/* Start accepting new clients from network */
|
||||
virMutexLock(&server->lock);
|
||||
if (qemudNetworkEnable(server) < 0) {
|
||||
VIR_ERROR0("Network event loop enablement failed");
|
||||
VIR_ERROR0(_("Network event loop enablement failed"));
|
||||
goto shutdown;
|
||||
}
|
||||
virMutexUnlock(&server->lock);
|
||||
|
@ -1892,14 +1892,14 @@ esxDomainGetInfo(virDomainPtr domain, virDomainInfoPtr info)
|
||||
esxVI_PerfEntityMetric_DynamicCast(perfEntityMetricBase);
|
||||
|
||||
if (perfMetricIntSeries == NULL) {
|
||||
VIR_ERROR0("QueryPerf returned object with unexpected type");
|
||||
VIR_ERROR0(_("QueryPerf returned object with unexpected type"));
|
||||
}
|
||||
|
||||
perfMetricIntSeries =
|
||||
esxVI_PerfMetricIntSeries_DynamicCast(perfEntityMetric->value);
|
||||
|
||||
if (perfMetricIntSeries == NULL) {
|
||||
VIR_ERROR0("QueryPerf returned object with unexpected type");
|
||||
VIR_ERROR0(_("QueryPerf returned object with unexpected type"));
|
||||
}
|
||||
|
||||
for (; perfMetricIntSeries != NULL;
|
||||
|
@ -718,22 +718,22 @@ static int halDeviceMonitorStartup(int privileged ATTRIBUTE_UNUSED)
|
||||
dbus_error_init(&err);
|
||||
hal_ctx = libhal_ctx_new();
|
||||
if (hal_ctx == NULL) {
|
||||
VIR_ERROR0("libhal_ctx_new returned NULL");
|
||||
VIR_ERROR0(_("libhal_ctx_new returned NULL"));
|
||||
goto failure;
|
||||
}
|
||||
dbus_conn = dbus_bus_get(DBUS_BUS_SYSTEM, &err);
|
||||
if (dbus_conn == NULL) {
|
||||
VIR_ERROR0("dbus_bus_get failed");
|
||||
VIR_ERROR0(_("dbus_bus_get failed"));
|
||||
goto failure;
|
||||
}
|
||||
dbus_connection_set_exit_on_disconnect(dbus_conn, FALSE);
|
||||
|
||||
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;
|
||||
}
|
||||
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,
|
||||
otherwise entire libvirtd shuts down when
|
||||
hald isn't running */
|
||||
@ -747,7 +747,7 @@ static int halDeviceMonitorStartup(int privileged ATTRIBUTE_UNUSED)
|
||||
remove_dbus_watch,
|
||||
toggle_dbus_watch,
|
||||
NULL, NULL)) {
|
||||
VIR_ERROR0("dbus_connection_set_watch_functions failed");
|
||||
VIR_ERROR0(_("dbus_connection_set_watch_functions failed"));
|
||||
goto failure;
|
||||
}
|
||||
|
||||
@ -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_property_modified(hal_ctx, device_prop_modified) ||
|
||||
!libhal_device_property_watch_all(hal_ctx, &err)) {
|
||||
VIR_ERROR0("setting up HAL callbacks failed");
|
||||
VIR_ERROR0(_("setting up HAL callbacks failed"));
|
||||
goto failure;
|
||||
}
|
||||
|
||||
udi = libhal_get_all_devices(hal_ctx, &num_devs, &err);
|
||||
if (udi == NULL) {
|
||||
VIR_ERROR0("libhal_get_all_devices failed");
|
||||
VIR_ERROR0(_("libhal_get_all_devices failed"));
|
||||
goto failure;
|
||||
}
|
||||
for (i = 0; i < num_devs; i++) {
|
||||
@ -835,7 +835,7 @@ static int halDeviceMonitorReload(void)
|
||||
dbus_error_init(&err);
|
||||
udi = libhal_get_all_devices(hal_ctx, &num_devs, &err);
|
||||
if (udi == NULL) {
|
||||
VIR_ERROR0("libhal_get_all_devices failed");
|
||||
VIR_ERROR0(_("libhal_get_all_devices failed"));
|
||||
return -1;
|
||||
}
|
||||
for (i = 0; i < num_devs; i++) {
|
||||
|
@ -272,7 +272,7 @@ static int get_sriov_function(const char *device_link,
|
||||
VIR_DEBUG("SR IOV device path is '%s'", device_path);
|
||||
config_address = basename(device_path);
|
||||
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;
|
||||
}
|
||||
|
||||
|
@ -368,7 +368,7 @@ static int udevTranslatePCIIds(unsigned int vendor,
|
||||
const char *vendor_name = NULL, *device_name = NULL;
|
||||
|
||||
if (pci_system_init() != 0) {
|
||||
VIR_ERROR0("Failed to initialize libpciaccess");
|
||||
VIR_ERROR0(_("Failed to initialize libpciaccess"));
|
||||
goto out;
|
||||
}
|
||||
|
||||
@ -1408,7 +1408,7 @@ static void udevEventHandleCallback(int watch ATTRIBUTE_UNUSED,
|
||||
|
||||
device = udev_monitor_receive_device(udev_monitor);
|
||||
if (device == NULL) {
|
||||
VIR_ERROR0("udev_monitor_receive_device returned NULL");
|
||||
VIR_ERROR0(_("udev_monitor_receive_device returned NULL"));
|
||||
goto out;
|
||||
}
|
||||
|
||||
@ -1572,7 +1572,7 @@ static int udevDeviceMonitorStartup(int privileged ATTRIBUTE_UNUSED)
|
||||
}
|
||||
|
||||
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(driverState);
|
||||
ret = -1;
|
||||
@ -1594,7 +1594,7 @@ static int udevDeviceMonitorStartup(int privileged ATTRIBUTE_UNUSED)
|
||||
if (priv->udev_monitor == NULL) {
|
||||
VIR_FREE(priv);
|
||||
nodeDeviceUnlock(driverState);
|
||||
VIR_ERROR0("udev_monitor_new_from_netlink returned NULL");
|
||||
VIR_ERROR0(_("udev_monitor_new_from_netlink returned NULL"));
|
||||
ret = -1;
|
||||
goto out;
|
||||
}
|
||||
|
@ -1233,30 +1233,30 @@ phypDomainDumpXML(virDomainPtr dom, int flags)
|
||||
dom->conn);
|
||||
|
||||
if (lpar_name == NULL) {
|
||||
VIR_ERROR0("Unable to determine domain's name.");
|
||||
VIR_ERROR0(_("Unable to determine domain's name."));
|
||||
goto err;
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
if ((def.maxmem =
|
||||
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;
|
||||
}
|
||||
|
||||
if ((def.memory =
|
||||
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;
|
||||
}
|
||||
|
||||
if ((def.vcpus =
|
||||
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;
|
||||
}
|
||||
|
||||
@ -1695,7 +1695,7 @@ phypBuildLpar(virConnectPtr conn, virDomainDefPtr def)
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
@ -1835,13 +1835,13 @@ phypUUIDTable_WriteFile(virConnectPtr conn)
|
||||
if (safewrite(fd, &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;
|
||||
}
|
||||
|
||||
if (safewrite(fd, uuid_table->lpars[i]->uuid, 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;
|
||||
}
|
||||
}
|
||||
|
@ -184,7 +184,7 @@ static void qemuDomainObjPrivateFree(void *data)
|
||||
|
||||
/* This should never be non-NULL if we get here, but just in case... */
|
||||
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);
|
||||
}
|
||||
VIR_FREE(priv);
|
||||
@ -1392,7 +1392,7 @@ static void qemuDomainSnapshotLoad(void *payload,
|
||||
VIR_INFO("Loading snapshot file '%s'", entry->d_name);
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
|
@ -780,7 +780,7 @@ static int umlCleanupTapDevices(virConnectPtr conn ATTRIBUTE_UNUSED,
|
||||
int err;
|
||||
int ret = 0;
|
||||
brControl *brctl = NULL;
|
||||
VIR_ERROR0("Cleanup tap");
|
||||
VIR_ERROR0(_("Cleanup tap"));
|
||||
if (brInit(&brctl) < 0)
|
||||
return -1;
|
||||
|
||||
@ -798,7 +798,7 @@ static int umlCleanupTapDevices(virConnectPtr conn ATTRIBUTE_UNUSED,
|
||||
ret = -1;
|
||||
}
|
||||
}
|
||||
VIR_ERROR0("Cleanup tap done");
|
||||
VIR_ERROR0(_("Cleanup tap done"));
|
||||
brShutdown(brctl);
|
||||
return ret;
|
||||
}
|
||||
|
@ -83,7 +83,7 @@ static int virCgroupDetectMounts(virCgroupPtr group)
|
||||
|
||||
mounts = fopen("/proc/mounts", "r");
|
||||
if (mounts == NULL) {
|
||||
VIR_ERROR0("Unable to open /proc/mounts");
|
||||
VIR_ERROR0(_("Unable to open /proc/mounts"));
|
||||
return -ENOENT;
|
||||
}
|
||||
|
||||
@ -136,7 +136,7 @@ static int virCgroupDetectPlacement(virCgroupPtr group)
|
||||
|
||||
mapping = fopen("/proc/self/cgroup", "r");
|
||||
if (mapping == NULL) {
|
||||
VIR_ERROR0("Unable to open /proc/self/cgroup");
|
||||
VIR_ERROR0(_("Unable to open /proc/self/cgroup"));
|
||||
return -ENOENT;
|
||||
}
|
||||
|
||||
|
@ -159,7 +159,7 @@ virProxyForkServer(void)
|
||||
if (virExecDaemonize(proxyarg, NULL, NULL,
|
||||
&pid, -1, NULL, NULL, 0,
|
||||
NULL, NULL, NULL) < 0)
|
||||
VIR_ERROR0("Failed to fork libvirt_proxy");
|
||||
VIR_ERROR0(_("Failed to fork libvirt_proxy"));
|
||||
|
||||
return (0);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user