[libvirt] [PATCH] maint: mark xenapiSessionErrorHandler messages for translation
by Jim Meyering
This makes sure that all xenapiSessionErrorHandler diagnostics
are marked for translation.
>From c79adc5fb5efb7aa2fbeee20d41d1c765e90b022 Mon Sep 17 00:00:00 2001
From: Jim Meyering <meyering(a)redhat.com>
Date: Wed, 31 Mar 2010 12:24:25 +0200
Subject: [PATCH] maint: mark xenapiSessionErrorHandler messages for translation
* cfg.mk (msg_gen_function): Add xenapiSessionErrorHandler.
* po/POTFILES.in: Add src/xenapi/xenapi_driver.c
* src/xenapi/xenapi_driver.c: Mark strings for translation.
* src/xenapi/xenapi_utils.c (xenapiUtil_ParseQuery):
---
cfg.mk | 1 +
po/POTFILES.in | 1 +
src/xenapi/xenapi_driver.c | 138 +++++++++++++++++++++++++++-----------------
src/xenapi/xenapi_utils.c | 2 +-
4 files changed, 89 insertions(+), 53 deletions(-)
diff --git a/cfg.mk b/cfg.mk
index 9b8ee00..45da56a 100644
--- a/cfg.mk
+++ b/cfg.mk
@@ -215,6 +215,7 @@ msg_gen_function += virXenInotifyError
msg_gen_function += virXenStoreError
msg_gen_function += virXendError
msg_gen_function += vshCloseLogFile
+msg_gen_function += xenapiSessionErrorHandler
msg_gen_function += xenUnifiedError
msg_gen_function += xenXMError
diff --git a/po/POTFILES.in b/po/POTFILES.in
index 645c344..417bfa1 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -85,6 +85,7 @@ src/xen/xen_hypervisor.c
src/xen/xen_inotify.c
src/xen/xm_internal.c
src/xen/xs_internal.c
+src/xenapi/xenapi_driver.c
src/xenapi/xenapi_utils.c
tools/console.c
tools/virsh.c
diff --git a/src/xenapi/xenapi_driver.c b/src/xenapi/xenapi_driver.c
index 6e1183d..d48bb4d 100644
--- a/src/xenapi/xenapi_driver.c
+++ b/src/xenapi/xenapi_driver.c
@@ -95,13 +95,13 @@ xenapiOpen (virConnectPtr conn, virConnectAuthPtr auth, int flags ATTRIBUTE_UNUS
if (conn->uri->server == NULL) {
xenapiSessionErrorHandler(conn, VIR_ERR_AUTH_FAILED,
- "Server name not in URI");
+ _("Server name not in URI"));
goto error;
}
if (auth == NULL) {
xenapiSessionErrorHandler(conn, VIR_ERR_AUTH_FAILED,
- "Authentication Credentials not found");
+ _("Authentication Credentials not found"));
goto error;
}
@@ -117,7 +117,7 @@ xenapiOpen (virConnectPtr conn, virConnectAuthPtr auth, int flags ATTRIBUTE_UNUS
if (username == NULL) {
xenapiSessionErrorHandler(conn, VIR_ERR_AUTH_FAILED,
- "Username request failed");
+ _("Username request failed"));
goto error;
}
}
@@ -126,7 +126,7 @@ xenapiOpen (virConnectPtr conn, virConnectAuthPtr auth, int flags ATTRIBUTE_UNUS
if (password == NULL) {
xenapiSessionErrorHandler(conn, VIR_ERR_AUTH_FAILED,
- "Password request failed");
+ _("Password request failed"));
goto error;
}
@@ -145,7 +145,7 @@ xenapiOpen (virConnectPtr conn, virConnectAuthPtr auth, int flags ATTRIBUTE_UNUS
if (!(privP->caps = getCapsObject())) {
xenapiSessionErrorHandler(conn, VIR_ERR_INTERNAL_ERROR,
- "Capabilities not found");
+ _("Capabilities not found"));
goto error;
}
@@ -166,7 +166,7 @@ xenapiOpen (virConnectPtr conn, virConnectAuthPtr auth, int flags ATTRIBUTE_UNUS
return VIR_DRV_OPEN_SUCCESS;
}
- xenapiSessionErrorHandler(conn, VIR_ERR_AUTH_FAILED, "");
+ xenapiSessionErrorHandler(conn, VIR_ERR_AUTH_FAILED, NULL);
error:
VIR_FREE(username);
@@ -279,7 +279,8 @@ xenapiGetVersion (virConnectPtr conn, unsigned long *hvVer)
}
if (version) {
if (sscanf(version, "%ld.%ld.%ld", &major, &minor, &release) != 3) {
- xenapiSessionErrorHandler(conn, VIR_ERR_INTERNAL_ERROR, "Couldn't get version info");
+ xenapiSessionErrorHandler(conn, VIR_ERR_INTERNAL_ERROR,
+ _("Couldn't get version info"));
xen_string_string_map_free(result);
VIR_FREE(version);
return -1;
@@ -356,7 +357,8 @@ xenapiNodeGetInfo (virConnectPtr conn, virNodeInfoPtr info)
info->memory = (unsigned long)(memory / 1024);
xen_host_metrics_set_free(xen_met_set);
} else {
- xenapiSessionErrorHandler(conn, VIR_ERR_INTERNAL_ERROR, "Unable to get host metric Information");
+ xenapiSessionErrorHandler(conn, VIR_ERR_INTERNAL_ERROR,
+ _("Unable to get host metric Information"));
return -1;
}
if (xen_host_cpu_get_all(session, &host_cpu_set)) {
@@ -377,7 +379,8 @@ xenapiNodeGetInfo (virConnectPtr conn, virNodeInfoPtr info)
VIR_FREE(modelname);
return 0;
}
- xenapiSessionErrorHandler(conn, VIR_ERR_INTERNAL_ERROR, "Unable to get Host CPU set");
+ xenapiSessionErrorHandler(conn, VIR_ERR_INTERNAL_ERROR,
+ _("Unable to get Host CPU set"));
return -1;
}
@@ -397,7 +400,8 @@ xenapiGetCapabilities (virConnectPtr conn)
return xml;
}
cleanup:
- xenapiSessionErrorHandler(conn, VIR_ERR_INTERNAL_ERROR, "Capabilities not available");
+ xenapiSessionErrorHandler(conn, VIR_ERR_INTERNAL_ERROR,
+ _("Capabilities not available"));
return NULL;
}
@@ -426,7 +430,8 @@ xenapiListDomains (virConnectPtr conn, int *ids, int maxids)
for (i = 0; (i < (result->size)) && (i < maxids); i++) {
xen_vm_get_domid(session, &t0, result->contents[i]);
if (t0 > (int64_t)INT_MAX || t0 < (int64_t)INT_MIN) {
- xenapiSessionErrorHandler(conn, VIR_ERR_INTERNAL_ERROR, "DomainID can't fit in 32 bits");
+ xenapiSessionErrorHandler(conn, VIR_ERR_INTERNAL_ERROR,
+ _("DomainID can't fit in 32 bits"));
xen_vm_set_free(result);
return -1;
}
@@ -497,7 +502,8 @@ xenapiDomainCreateXML (virConnectPtr conn,
domP = virGetDomain(conn, record->name_label, raw_uuid);
if (!domP) {
xen_vm_record_free(record);
- xenapiSessionErrorHandler(conn, VIR_ERR_INTERNAL_ERROR, "Domain Pointer is invalid");
+ xenapiSessionErrorHandler(conn, VIR_ERR_INTERNAL_ERROR,
+ _("Domain Pointer is invalid"));
return domP;
}
domP->id = record->domid;
@@ -549,7 +555,8 @@ xenapiDomainLookupByID (virConnectPtr conn, int id)
xen_vm_get_domid(session, &domid, result->contents[i]);
domP->id = domid;
} else {
- xenapiSessionErrorHandler(conn, VIR_ERR_INTERNAL_ERROR, "Domain Pointer not valid");
+ xenapiSessionErrorHandler(conn, VIR_ERR_INTERNAL_ERROR,
+ _("Domain Pointer not valid"));
domP = NULL;
}
xen_uuid_free(uuid);
@@ -590,7 +597,8 @@ xenapiDomainLookupByUUID (virConnectPtr conn,
if (record != NULL) {
domP = virGetDomain(conn, record->name_label, uuid);
if (!domP) {
- xenapiSessionErrorHandler(conn, VIR_ERR_INTERNAL_ERROR, "Domain Pointer not valid");
+ xenapiSessionErrorHandler(conn, VIR_ERR_INTERNAL_ERROR,
+ _("Domain Pointer not valid"));
domP = NULL;
} else {
domP->id = record->domid;
@@ -624,7 +632,8 @@ xenapiDomainLookupByName (virConnectPtr conn,
xen_session *session = ((struct _xenapiPrivate *)(conn->privateData))->session;
if (xen_vm_get_by_name_label(session, &vms, (char *)name) && vms->size > 0) {
if (vms->size != 1) {
- xenapiSessionErrorHandler(conn, VIR_ERR_INTERNAL_ERROR, "Domain name is not unique");
+ xenapiSessionErrorHandler(conn, VIR_ERR_INTERNAL_ERROR,
+ _("Domain name is not unique"));
xen_vm_set_free(vms);
return NULL;
}
@@ -644,13 +653,14 @@ xenapiDomainLookupByName (virConnectPtr conn,
xen_uuid_free(uuid);
xen_vm_set_free(vms);
if (!session->ok)
- xenapiSessionErrorHandler(conn, VIR_ERR_INTERNAL_ERROR, "Couldn't get the Domain Pointer");
+ xenapiSessionErrorHandler(conn, VIR_ERR_INTERNAL_ERROR,
+ _("Couldn't get the Domain Pointer"));
return NULL;
}
}
}
if (vms) xen_vm_set_free(vms);
- xenapiSessionErrorHandler(conn, VIR_ERR_NO_DOMAIN, "");
+ xenapiSessionErrorHandler(conn, VIR_ERR_NO_DOMAIN, NULL);
return NULL;
}
@@ -669,7 +679,8 @@ xenapiDomainSuspend (virDomainPtr dom)
xen_session *session = ((struct _xenapiPrivate *)(dom->conn->privateData))->session;
if (xen_vm_get_by_name_label(session, &vms, dom->name) && vms->size > 0) {
if (vms->size != 1) {
- xenapiSessionErrorHandler(dom->conn, VIR_ERR_INTERNAL_ERROR, "Domain name is not unique");
+ xenapiSessionErrorHandler(dom->conn, VIR_ERR_INTERNAL_ERROR,
+ _("Domain name is not unique"));
xen_vm_set_free(vms);
return -1;
} else {
@@ -684,7 +695,7 @@ xenapiDomainSuspend (virDomainPtr dom)
}
}
if (vms) xen_vm_set_free(vms);
- xenapiSessionErrorHandler(dom->conn, VIR_ERR_NO_DOMAIN, "");
+ xenapiSessionErrorHandler(dom->conn, VIR_ERR_NO_DOMAIN, NULL);
return -1;
}
@@ -703,7 +714,8 @@ xenapiDomainResume (virDomainPtr dom)
xen_session *session = ((struct _xenapiPrivate *)(dom->conn->privateData))->session;
if (xen_vm_get_by_name_label(session, &vms, dom->name) && vms->size > 0) {
if (vms->size != 1) {
- xenapiSessionErrorHandler(dom->conn, VIR_ERR_INTERNAL_ERROR, "Domain name is not unique");
+ xenapiSessionErrorHandler(dom->conn, VIR_ERR_INTERNAL_ERROR,
+ _("Domain name is not unique"));
xen_vm_set_free(vms);
return -1;
} else {
@@ -718,7 +730,7 @@ xenapiDomainResume (virDomainPtr dom)
}
}
if (vms) xen_vm_set_free(vms);
- xenapiSessionErrorHandler(dom->conn, VIR_ERR_NO_DOMAIN, "");
+ xenapiSessionErrorHandler(dom->conn, VIR_ERR_NO_DOMAIN, NULL);
return -1;
}
@@ -737,7 +749,8 @@ xenapiDomainShutdown (virDomainPtr dom)
xen_session *session = ((struct _xenapiPrivate *)(dom->conn->privateData))->session;
if (xen_vm_get_by_name_label(session, &vms, dom->name) && vms->size > 0) {
if (vms->size != 1) {
- xenapiSessionErrorHandler(dom->conn, VIR_ERR_INTERNAL_ERROR, "Domain name is not unique");
+ xenapiSessionErrorHandler(dom->conn, VIR_ERR_INTERNAL_ERROR,
+ _("Domain name is not unique"));
xen_vm_set_free(vms);
return -1;
} else {
@@ -752,7 +765,7 @@ xenapiDomainShutdown (virDomainPtr dom)
}
}
if (vms) xen_vm_set_free(vms);
- xenapiSessionErrorHandler(dom->conn, VIR_ERR_NO_DOMAIN, "");
+ xenapiSessionErrorHandler(dom->conn, VIR_ERR_NO_DOMAIN, NULL);
return -1;
}
@@ -771,7 +784,8 @@ xenapiDomainReboot (virDomainPtr dom, unsigned int flags ATTRIBUTE_UNUSED)
xen_session *session = ((struct _xenapiPrivate *)(dom->conn->privateData))->session;
if (xen_vm_get_by_name_label(session, &vms, dom->name) && vms->size > 0) {
if (vms->size != 1) {
- xenapiSessionErrorHandler(dom->conn, VIR_ERR_INTERNAL_ERROR, "Domain name is not unique");
+ xenapiSessionErrorHandler(dom->conn, VIR_ERR_INTERNAL_ERROR,
+ _("Domain name is not unique"));
xen_vm_set_free(vms);
return -1;
}
@@ -785,7 +799,7 @@ xenapiDomainReboot (virDomainPtr dom, unsigned int flags ATTRIBUTE_UNUSED)
return 0;
}
if (vms) xen_vm_set_free(vms);
- xenapiSessionErrorHandler(dom->conn, VIR_ERR_NO_DOMAIN, "");
+ xenapiSessionErrorHandler(dom->conn, VIR_ERR_NO_DOMAIN, NULL);
return -1;
}
@@ -804,7 +818,8 @@ xenapiDomainDestroy (virDomainPtr dom)
xen_session *session = ((struct _xenapiPrivate *)(dom->conn->privateData))->session;
if (xen_vm_get_by_name_label(session, &vms, dom->name) && vms->size > 0) {
if (vms->size != 1) {
- xenapiSessionErrorHandler(dom->conn, VIR_ERR_INTERNAL_ERROR, "Domain name is not unique");
+ xenapiSessionErrorHandler(dom->conn, VIR_ERR_INTERNAL_ERROR,
+ _("Domain name is not unique"));
xen_vm_set_free(vms);
return -1;
}
@@ -818,7 +833,7 @@ xenapiDomainDestroy (virDomainPtr dom)
return 0;
}
if (vms) xen_vm_set_free(vms);
- xenapiSessionErrorHandler(dom->conn, VIR_ERR_NO_DOMAIN, "");
+ xenapiSessionErrorHandler(dom->conn, VIR_ERR_NO_DOMAIN, NULL);
return -1;
}
@@ -839,7 +854,8 @@ xenapiDomainGetOSType (virDomainPtr dom)
if (xen_vm_get_by_name_label(session, &vms, dom->name) && vms->size > 0) {
if (vms->size != 1) {
- xenapiSessionErrorHandler(dom->conn, VIR_ERR_INTERNAL_ERROR, "Domain name is not unique");
+ xenapiSessionErrorHandler(dom->conn, VIR_ERR_INTERNAL_ERROR,
+ _("Domain name is not unique"));
xen_vm_set_free(vms);
return NULL;
}
@@ -852,7 +868,7 @@ xenapiDomainGetOSType (virDomainPtr dom)
virReportOOMError();
VIR_FREE(boot_policy);
} else
- xenapiSessionErrorHandler(dom->conn, VIR_ERR_NO_DOMAIN, "");
+ xenapiSessionErrorHandler(dom->conn, VIR_ERR_NO_DOMAIN, NULL);
cleanup:
if (vms) xen_vm_set_free(vms);
@@ -873,7 +889,8 @@ xenapiDomainGetMaxMemory (virDomainPtr dom)
xen_session *session = ((struct _xenapiPrivate *)(dom->conn->privateData))->session;
if (xen_vm_get_by_name_label(session, &vms, dom->name) && vms->size > 0) {
if (vms->size != 1) {
- xenapiSessionErrorHandler(dom->conn, VIR_ERR_INTERNAL_ERROR, "Domain name is not unique");
+ xenapiSessionErrorHandler(dom->conn, VIR_ERR_INTERNAL_ERROR,
+ _("Domain name is not unique"));
xen_vm_set_free(vms);
return 0;
}
@@ -903,7 +920,8 @@ xenapiDomainSetMaxMemory (virDomainPtr dom, unsigned long memory)
xen_session *session = ((struct _xenapiPrivate *)(dom->conn->privateData))->session;
if (xen_vm_get_by_name_label(session, &vms, dom->name) && vms->size > 0) {
if (vms->size != 1) {
- xenapiSessionErrorHandler(dom->conn, VIR_ERR_INTERNAL_ERROR, "Domain name is not unique");
+ xenapiSessionErrorHandler(dom->conn, VIR_ERR_INTERNAL_ERROR,
+ _("Domain name is not unique"));
xen_vm_set_free(vms);
return -1;
}
@@ -939,7 +957,8 @@ xenapiDomainGetInfo (virDomainPtr dom, virDomainInfoPtr info)
info->cpuTime = 0; /* CPU time is not advertised */
if (xen_vm_get_by_name_label(session, &vms, dom->name) && vms->size > 0) {
if (vms->size != 1) {
- xenapiSessionErrorHandler(dom->conn, VIR_ERR_INTERNAL_ERROR, "Domain name is not unique");
+ xenapiSessionErrorHandler(dom->conn, VIR_ERR_INTERNAL_ERROR,
+ _("Domain name is not unique"));
xen_vm_set_free(vms);
return -1;
}
@@ -982,7 +1001,8 @@ xenapiDomainSetVcpus (virDomainPtr dom, unsigned int nvcpus)
xen_session *session = ((struct _xenapiPrivate *)(dom->conn->privateData))->session;
if (xen_vm_get_by_name_label(session, &vms, dom->name) && vms->size > 0) {
if (vms->size != 1) {
- xenapiSessionErrorHandler(dom->conn, VIR_ERR_INTERNAL_ERROR, "Domain name is not unique");
+ xenapiSessionErrorHandler(dom->conn, VIR_ERR_INTERNAL_ERROR,
+ _("Domain name is not unique"));
xen_vm_set_free(vms);
return -1;
}
@@ -1013,7 +1033,8 @@ xenapiDomainPinVcpu (virDomainPtr dom, unsigned int vcpu ATTRIBUTE_UNUSED,
xen_session *session = ((struct _xenapiPrivate *)(dom->conn->privateData))->session;
if (xen_vm_get_by_name_label(session, &vms, dom->name) && vms->size > 0) {
if (vms->size != 1) {
- xenapiSessionErrorHandler(dom->conn, VIR_ERR_INTERNAL_ERROR, "Domain name is not unique");
+ xenapiSessionErrorHandler(dom->conn, VIR_ERR_INTERNAL_ERROR,
+ _("Domain name is not unique"));
xen_vm_set_free(vms);
return -1;
}
@@ -1063,13 +1084,15 @@ xenapiDomainGetVcpus (virDomainPtr dom,
if (xenapiDomainGetInfo(dom, &domInfo) == 0) {
nvcpus = domInfo.nrVirtCpu;
} else {
- xenapiSessionErrorHandler(dom->conn, VIR_ERR_INTERNAL_ERROR, "Couldn't fetch Domain Information");
+ xenapiSessionErrorHandler(dom->conn, VIR_ERR_INTERNAL_ERROR,
+ _("Couldn't fetch Domain Information"));
return -1;
}
if (xenapiNodeGetInfo(dom->conn, &nodeInfo) == 0)
cpus = nodeInfo.cpus;
else {
- xenapiSessionErrorHandler(dom->conn, VIR_ERR_INTERNAL_ERROR, "Couldn't fetch Node Information");
+ xenapiSessionErrorHandler(dom->conn, VIR_ERR_INTERNAL_ERROR,
+ _("Couldn't fetch Node Information"));
return -1;
}
if (nvcpus > maxinfo)
@@ -1079,7 +1102,8 @@ xenapiDomainGetVcpus (virDomainPtr dom,
if (!xen_vm_get_by_name_label(session, &vms, dom->name))
return -1;
if (vms->size != 1) {
- xenapiSessionErrorHandler(dom->conn, VIR_ERR_INTERNAL_ERROR, "Domain name is not unique");
+ xenapiSessionErrorHandler(dom->conn, VIR_ERR_INTERNAL_ERROR,
+ _("Domain name is not unique"));
xen_vm_set_free(vms);
return -1;
}
@@ -1130,7 +1154,8 @@ xenapiDomainGetMaxVcpus (virDomainPtr dom)
xen_session *session = ((struct _xenapiPrivate *)(dom->conn->privateData))->session;
if (xen_vm_get_by_name_label(session, &vms, dom->name) && vms->size > 0) {
if (vms->size != 1) {
- xenapiSessionErrorHandler(dom->conn, VIR_ERR_INTERNAL_ERROR, "Domain name is not unique");
+ xenapiSessionErrorHandler(dom->conn, VIR_ERR_INTERNAL_ERROR,
+ _("Domain name is not unique"));
xen_vm_set_free(vms);
return -1;
}
@@ -1166,7 +1191,8 @@ xenapiDomainDumpXML (virDomainPtr dom, int flags ATTRIBUTE_UNUSED)
if (!xen_vm_get_by_name_label(session, &vms, dom->name)) return NULL;
if (vms->size != 1) {
- xenapiSessionErrorHandler(dom->conn, VIR_ERR_INTERNAL_ERROR, "Domain name is not unique");
+ xenapiSessionErrorHandler(dom->conn, VIR_ERR_INTERNAL_ERROR,
+ _("Domain name is not unique"));
xen_vm_set_free(vms);
return NULL;
}
@@ -1322,7 +1348,7 @@ xenapiDomainDumpXML (virDomainPtr dom, int flags ATTRIBUTE_UNUSED)
if (vif_rec != NULL) {
if (virParseMacAddr((const char *)vif_rec->mac,defPtr->nets[i]->mac) < 0)
xenapiSessionErrorHandler(dom->conn, VIR_ERR_INTERNAL_ERROR,
- "Unable to parse given mac address");
+ _("Unable to parse given mac address"));
xen_vif_record_free(vif_rec);
}
}
@@ -1373,7 +1399,8 @@ xenapiListDefinedDomains (virConnectPtr conn, char **const names,
}
xen_vm_record_free(record);
} else {
- xenapiSessionErrorHandler(conn, VIR_ERR_INTERNAL_ERROR, "Couldn't get VM record");
+ xenapiSessionErrorHandler(conn, VIR_ERR_INTERNAL_ERROR,
+ _("Couldn't get VM record"));
xen_vm_set_free(result);
while (--j >= 0) VIR_FREE(names[j]);
return -1;
@@ -1434,7 +1461,8 @@ xenapiDomainCreate (virDomainPtr dom)
xen_session *session = ((struct _xenapiPrivate *)(dom->conn->privateData))->session;
if (xen_vm_get_by_name_label(session, &vms, dom->name) && vms->size > 0) {
if (vms->size != 1) {
- xenapiSessionErrorHandler(dom->conn, VIR_ERR_INTERNAL_ERROR, "Domain name is not unique");
+ xenapiSessionErrorHandler(dom->conn, VIR_ERR_INTERNAL_ERROR,
+ _("Domain name is not unique"));
xen_vm_set_free(vms);
return -1;
}
@@ -1476,7 +1504,8 @@ xenapiDomainDefineXML (virConnectPtr conn, const char *xml)
if (!session->ok)
xenapiSessionErrorHandler(conn, VIR_ERR_INTERNAL_ERROR, NULL);
else
- xenapiSessionErrorHandler(conn, VIR_ERR_INTERNAL_ERROR, "Couldn't get VM information from XML");
+ xenapiSessionErrorHandler(conn, VIR_ERR_INTERNAL_ERROR,
+ _("Couldn't get VM information from XML"));
virDomainDefFree(defPtr);
return NULL;
}
@@ -1508,7 +1537,8 @@ xenapiDomainUndefine (virDomainPtr dom)
xen_session *session = ((struct _xenapiPrivate *)(dom->conn->privateData))->session;
if (xen_vm_get_by_name_label(session, &vms, dom->name) && vms->size > 0) {
if (vms->size != 1) {
- xenapiSessionErrorHandler(dom->conn, VIR_ERR_INTERNAL_ERROR, "Domain name is not unique");
+ xenapiSessionErrorHandler(dom->conn, VIR_ERR_INTERNAL_ERROR,
+ _("Domain name is not unique"));
xen_vm_set_free(vms);
return -1;
}
@@ -1522,7 +1552,7 @@ xenapiDomainUndefine (virDomainPtr dom)
return 0;
}
if (vms) xen_vm_set_free(vms);
- xenapiSessionErrorHandler(dom->conn, VIR_ERR_NO_DOMAIN, "");
+ xenapiSessionErrorHandler(dom->conn, VIR_ERR_NO_DOMAIN, NULL);
return -1;
}
@@ -1543,7 +1573,8 @@ xenapiDomainGetAutostart (virDomainPtr dom, int *autostart)
xen_session *session = ((struct _xenapiPrivate *)(dom->conn->privateData))->session;
if (xen_vm_get_by_name_label(session, &vms, dom->name) && vms->size > 0) {
if (vms->size != 1) {
- xenapiSessionErrorHandler(dom->conn, VIR_ERR_INTERNAL_ERROR, "Domain name is not unique");
+ xenapiSessionErrorHandler(dom->conn, VIR_ERR_INTERNAL_ERROR,
+ _("Domain name is not unique"));
xen_vm_set_free(vms);
return -1;
}
@@ -1569,7 +1600,7 @@ xenapiDomainGetAutostart (virDomainPtr dom, int *autostart)
return 0;
}
if (vms) xen_vm_set_free(vms);
- xenapiSessionErrorHandler(dom->conn, VIR_ERR_NO_DOMAIN, "");
+ xenapiSessionErrorHandler(dom->conn, VIR_ERR_NO_DOMAIN, NULL);
return -1;
}
@@ -1588,7 +1619,8 @@ xenapiDomainSetAutostart (virDomainPtr dom, int autostart)
xen_session *session = ((struct _xenapiPrivate *)(dom->conn->privateData))->session;
if (xen_vm_get_by_name_label(session, &vms, dom->name) && vms->size > 0) {
if (vms->size != 1) {
- xenapiSessionErrorHandler(dom->conn, VIR_ERR_INTERNAL_ERROR, "Domain name is not unique");
+ xenapiSessionErrorHandler(dom->conn, VIR_ERR_INTERNAL_ERROR,
+ _("Domain name is not unique"));
xen_vm_set_free(vms);
return -1;
}
@@ -1607,7 +1639,7 @@ xenapiDomainSetAutostart (virDomainPtr dom, int autostart)
return 0;
}
if (vms) xen_vm_set_free(vms);
- xenapiSessionErrorHandler(dom->conn, VIR_ERR_NO_DOMAIN, "");
+ xenapiSessionErrorHandler(dom->conn, VIR_ERR_NO_DOMAIN, NULL);
return -1;
}
@@ -1636,12 +1668,14 @@ xenapiNodeGetFreeMemory (virConnectPtr conn)
xen_host_metrics_get_all(session, &xen_met_set);
if (xen_met_set != NULL) {
if (!xen_host_metrics_get_memory_free(session, (int64_t *)&freeMem, xen_met_set->contents[0])) {
- xenapiSessionErrorHandler(conn, VIR_ERR_INTERNAL_ERROR, "Couldn't get host metrics - memory information");
+ xenapiSessionErrorHandler(conn, VIR_ERR_INTERNAL_ERROR,
+ _("Couldn't get host metrics - memory information"));
freeMem = 0;
}
xen_host_metrics_set_free(xen_met_set);
} else {
- xenapiSessionErrorHandler(conn, VIR_ERR_INTERNAL_ERROR, "Couldn't get host metrics");
+ xenapiSessionErrorHandler(conn, VIR_ERR_INTERNAL_ERROR,
+ _("Couldn't get host metrics"));
}
return freeMem;
}
@@ -1657,7 +1691,7 @@ xenapiNodeGetCellsFreeMemory (virConnectPtr conn, unsigned long long *freeMems,
int startCell, int maxCells)
{
if (maxCells > 1 && startCell > 0) {
- xenapiSessionErrorHandler(conn, VIR_ERR_NO_SUPPORT, "");
+ xenapiSessionErrorHandler(conn, VIR_ERR_NO_SUPPORT, NULL);
return -1;
} else {
freeMems[0] = xenapiNodeGetFreeMemory(conn);
diff --git a/src/xenapi/xenapi_utils.c b/src/xenapi/xenapi_utils.c
index 697ad39..60e3c8d 100644
--- a/src/xenapi/xenapi_utils.c
+++ b/src/xenapi/xenapi_utils.c
@@ -119,7 +119,7 @@ xenapiUtil_ParseQuery(virConnectPtr conn, xmlURIPtr uri, int *noVerify)
if (virStrToLong_i(queryParam->value, NULL, 10, noVerify) < 0 ||
(*noVerify != 0 && *noVerify != 1)) {
xenapiSessionErrorHandler(conn, VIR_ERR_INVALID_ARG,
- "Query parameter 'no_verify' has unexpected value (should be 0 or 1)");
+ _("Query parameter 'no_verify' has unexpected value (should be 0 or 1)"));
goto failure;
}
}
--
1.7.0.3.513.gc8ed0
14 years, 7 months
[libvirt] [PATCH v2] Blank out invalid interface names with escaped letters etc.
by Stefan Berger
Check that interface names only contain valid characters. Blank them out
otherwise.
Valid characters in this code are currently a-z,A-Z,0-9, '-' and '_'.
Signed-off-by: Stefan Berger <stefanb(a)us.ibm.com>
---
src/conf/domain_conf.c | 9 ++++++++-
src/conf/domain_conf.h | 3 +++
2 files changed, 11 insertions(+), 1 deletion(-)
Index: libvirt-acl/src/conf/domain_conf.c
===================================================================
--- libvirt-acl.orig/src/conf/domain_conf.c
+++ libvirt-acl/src/conf/domain_conf.c
@@ -1776,6 +1776,11 @@ cleanup:
}
+static bool
+isValidIfname(const char *ifname) {
+ return strspn(ifname, VALID_IFNAME_CHARS) == strlen(ifname);
+}
+
/* Parse the XML definition for a network interface
* @param node XML nodeset to parse for net definition
@@ -1859,8 +1864,10 @@ virDomainNetDefParseXML(virCapsPtr caps,
xmlStrEqual(cur->name, BAD_CAST "target")) {
ifname = virXMLPropString(cur, "dev");
if ((ifname != NULL) &&
- (STRPREFIX((const char*)ifname, "vnet"))) {
+ ((STRPREFIX((const char*)ifname, "vnet")) ||
+ (!isValidIfname(ifname)))) {
/* An auto-generated target name, blank it out */
+ /* blank out invalid interface names */
VIR_FREE(ifname);
}
} else if ((script == NULL) &&
Index: libvirt-acl/src/conf/domain_conf.h
===================================================================
--- libvirt-acl.orig/src/conf/domain_conf.h
+++ libvirt-acl/src/conf/domain_conf.h
@@ -297,6 +297,9 @@ struct _virDomainNetDef {
virNWFilterHashTablePtr filterparams;
};
+#define VALID_IFNAME_CHARS \
+ "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-_"
+
enum virDomainChrTargetType {
VIR_DOMAIN_CHR_TARGET_TYPE_NULL = 0,
VIR_DOMAIN_CHR_TARGET_TYPE_MONITOR,
14 years, 7 months
[libvirt] [PATCH] Keep track of guest paused state after disk IO / watchdog events
by Daniel P. Berrange
When a watchdog/IO error occurs, one of the possible actions that
QEMU might take is to pause the guest. In this scenario libvirt
needs to update its internal state for the VM, and emit a
lifecycle event:
VIR_DOMAIN_EVENT_SUSPENDED
with a detail being one of:
VIR_DOMAIN_EVENT_SUSPENDED_IOERROR
VIR_DOMAIN_EVENT_SUSPENDED_WATCHDOG
To future proof against possible QEMU support for multiple monitor
consoles, this patch also hooks into the 'STOPPED' event in QEMU
and emits a generic VIR_DOMAIN_EVENT_SUSPENDED_PAUSED event
* include/libvirt/libvirt.h.in: Add VIR_DOMAIN_EVENT_SUSPENDED_IOERROR
* src/qemu/qemu_driver.c: Update VM state to paused when IO error
or watchdog events occurrs
* src/qemu/qemu_monitor_json.c: Fix typo in disk IO event name
---
include/libvirt/libvirt.h.in | 2 +
src/qemu/qemu_driver.c | 83 ++++++++++++++++++++++++++++++++++++++----
src/qemu/qemu_monitor_json.c | 2 +-
3 files changed, 78 insertions(+), 9 deletions(-)
diff --git a/include/libvirt/libvirt.h.in b/include/libvirt/libvirt.h.in
index 6d8552f..7cb483e 100644
--- a/include/libvirt/libvirt.h.in
+++ b/include/libvirt/libvirt.h.in
@@ -1384,6 +1384,8 @@ typedef enum {
typedef enum {
VIR_DOMAIN_EVENT_SUSPENDED_PAUSED = 0, /* Normal suspend due to admin pause */
VIR_DOMAIN_EVENT_SUSPENDED_MIGRATED = 1, /* Suspended for offline migration */
+ VIR_DOMAIN_EVENT_SUSPENDED_IOERROR = 2, /* Suspended due to a disk I/O error */
+ VIR_DOMAIN_EVENT_SUSPENDED_WATCHDOG = 3, /* Suspended due to a watchdog firing */
} virDomainEventSuspendedDetailType;
/**
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index 9ee5da7..4291bc7 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -909,6 +909,38 @@ qemuHandleDomainReset(qemuMonitorPtr mon ATTRIBUTE_UNUSED,
static int
+qemuHandleDomainStop(qemuMonitorPtr mon ATTRIBUTE_UNUSED,
+ virDomainObjPtr vm)
+{
+ struct qemud_driver *driver = qemu_driver;
+ virDomainEventPtr event = NULL;
+
+ virDomainObjLock(vm);
+ if (vm->state == VIR_DOMAIN_RUNNING) {
+ VIR_DEBUG("Transitioned guest %s to paused state due to unknown event", vm->def->name);
+
+ vm->state = VIR_DOMAIN_PAUSED;
+ event = virDomainEventNewFromObj(vm,
+ VIR_DOMAIN_EVENT_SUSPENDED,
+ VIR_DOMAIN_EVENT_SUSPENDED_PAUSED);
+
+ if (virDomainSaveStatus(driver->caps, driver->stateDir, vm) < 0)
+ VIR_WARN("Unable to save status on vm %s after IO error", vm->def->name);
+ }
+ virDomainObjUnlock(vm);
+
+ if (event) {
+ qemuDriverLock(driver);
+ if (event)
+ qemuDomainEventQueue(driver, event);
+ qemuDriverUnlock(driver);
+ }
+
+ return 0;
+}
+
+
+static int
qemuHandleDomainRTCChange(qemuMonitorPtr mon ATTRIBUTE_UNUSED,
virDomainObjPtr vm,
long long offset)
@@ -943,15 +975,32 @@ qemuHandleDomainWatchdog(qemuMonitorPtr mon ATTRIBUTE_UNUSED,
int action)
{
struct qemud_driver *driver = qemu_driver;
- virDomainEventPtr event;
+ virDomainEventPtr watchdogEvent = NULL;
+ virDomainEventPtr lifecycleEvent = NULL;
virDomainObjLock(vm);
- event = virDomainEventWatchdogNewFromObj(vm, action);
+ watchdogEvent = virDomainEventWatchdogNewFromObj(vm, action);
+
+ if (action == VIR_DOMAIN_EVENT_WATCHDOG_PAUSE &&
+ vm->state == VIR_DOMAIN_RUNNING) {
+ VIR_DEBUG("Transitioned guest %s to paused state due to watchdog", vm->def->name);
+
+ vm->state = VIR_DOMAIN_PAUSED;
+ lifecycleEvent = virDomainEventNewFromObj(vm,
+ VIR_DOMAIN_EVENT_SUSPENDED,
+ VIR_DOMAIN_EVENT_SUSPENDED_WATCHDOG);
+
+ if (virDomainSaveStatus(driver->caps, driver->stateDir, vm) < 0)
+ VIR_WARN("Unable to save status on vm %s after IO error", vm->def->name);
+ }
virDomainObjUnlock(vm);
- if (event) {
+ if (watchdogEvent || lifecycleEvent) {
qemuDriverLock(driver);
- qemuDomainEventQueue(driver, event);
+ if (watchdogEvent)
+ qemuDomainEventQueue(driver, watchdogEvent);
+ if (lifecycleEvent)
+ qemuDomainEventQueue(driver, lifecycleEvent);
qemuDriverUnlock(driver);
}
@@ -966,7 +1015,8 @@ qemuHandleDomainIOError(qemuMonitorPtr mon ATTRIBUTE_UNUSED,
int action)
{
struct qemud_driver *driver = qemu_driver;
- virDomainEventPtr event;
+ virDomainEventPtr ioErrorEvent = NULL;
+ virDomainEventPtr lifecycleEvent = NULL;
const char *srcPath;
const char *devAlias;
virDomainDiskDefPtr disk;
@@ -982,12 +1032,28 @@ qemuHandleDomainIOError(qemuMonitorPtr mon ATTRIBUTE_UNUSED,
devAlias = "";
}
- event = virDomainEventIOErrorNewFromObj(vm, srcPath, devAlias, action);
+ ioErrorEvent = virDomainEventIOErrorNewFromObj(vm, srcPath, devAlias, action);
+
+ if (action == VIR_DOMAIN_EVENT_IO_ERROR_PAUSE &&
+ vm->state == VIR_DOMAIN_RUNNING) {
+ VIR_DEBUG("Transitioned guest %s to paused state due to IO error", vm->def->name);
+
+ vm->state = VIR_DOMAIN_PAUSED;
+ lifecycleEvent = virDomainEventNewFromObj(vm,
+ VIR_DOMAIN_EVENT_SUSPENDED,
+ VIR_DOMAIN_EVENT_SUSPENDED_IOERROR);
+
+ if (virDomainSaveStatus(driver->caps, driver->stateDir, vm) < 0)
+ VIR_WARN("Unable to save status on vm %s after IO error", vm->def->name);
+ }
virDomainObjUnlock(vm);
- if (event) {
+ if (ioErrorEvent || lifecycleEvent) {
qemuDriverLock(driver);
- qemuDomainEventQueue(driver, event);
+ if (ioErrorEvent)
+ qemuDomainEventQueue(driver, ioErrorEvent);
+ if (lifecycleEvent)
+ qemuDomainEventQueue(driver, lifecycleEvent);
qemuDriverUnlock(driver);
}
@@ -1090,6 +1156,7 @@ no_memory:
static qemuMonitorCallbacks monitorCallbacks = {
.eofNotify = qemuHandleMonitorEOF,
.diskSecretLookup = findVolumeQcowPassphrase,
+ .domainStop = qemuHandleDomainStop,
.domainReset = qemuHandleDomainReset,
.domainRTCChange = qemuHandleDomainRTCChange,
.domainWatchdog = qemuHandleDomainWatchdog,
diff --git a/src/qemu/qemu_monitor_json.c b/src/qemu/qemu_monitor_json.c
index 3901d46..eac3aca 100644
--- a/src/qemu/qemu_monitor_json.c
+++ b/src/qemu/qemu_monitor_json.c
@@ -66,7 +66,7 @@ struct {
{ "STOP", qemuMonitorJSONHandleStop, },
{ "RTC_CHANGE", qemuMonitorJSONHandleRTCChange, },
{ "WATCHDOG", qemuMonitorJSONHandleWatchdog, },
- { "DISK_IO_ERROR", qemuMonitorJSONHandleIOError, },
+ { "BLOCK_IO_ERROR", qemuMonitorJSONHandleIOError, },
{ "VNC_CONNECTED", qemuMonitorJSONHandleVNCConnect, },
{ "VNC_INITIALIZED", qemuMonitorJSONHandleVNCInitialize, },
{ "VNC_DISCONNECTED", qemuMonitorJSONHandleVNCDisconnect, },
--
1.6.2.5
14 years, 7 months
[libvirt] [PATCH] Keep build quiet for generated file
by Daniel P. Berrange
Adds $(AM_V_GEN) to many more manual makefile.am rules that
were generating files
---
daemon/Makefile.am | 28 ++++++++++++++--------------
src/Makefile.am | 18 +++++++++---------
tools/Makefile.am | 40 ++++++++++++++++++++--------------------
3 files changed, 43 insertions(+), 43 deletions(-)
diff --git a/daemon/Makefile.am b/daemon/Makefile.am
index e117b97..a82e9a9 100644
--- a/daemon/Makefile.am
+++ b/daemon/Makefile.am
@@ -172,16 +172,16 @@ remote.c: remote_dispatch_prototypes.h \
REMOTE_PROTOCOL = $(top_srcdir)/src/remote/remote_protocol.x
remote_dispatch_prototypes.h: $(srcdir)/remote_generate_stubs.pl $(REMOTE_PROTOCOL)
- perl -w $(srcdir)/remote_generate_stubs.pl -p $(REMOTE_PROTOCOL) > $@
+ $(AM_V_GEN)perl -w $(srcdir)/remote_generate_stubs.pl -p $(REMOTE_PROTOCOL) > $@
remote_dispatch_table.h: $(srcdir)/remote_generate_stubs.pl $(REMOTE_PROTOCOL)
- perl -w $(srcdir)/remote_generate_stubs.pl -t $(REMOTE_PROTOCOL) > $@
+ $(AM_V_GEN)perl -w $(srcdir)/remote_generate_stubs.pl -t $(REMOTE_PROTOCOL) > $@
remote_dispatch_args.h: $(srcdir)/remote_generate_stubs.pl $(REMOTE_PROTOCOL)
- perl -w $(srcdir)/remote_generate_stubs.pl -a $(REMOTE_PROTOCOL) > $@
+ $(AM_V_GEN)perl -w $(srcdir)/remote_generate_stubs.pl -a $(REMOTE_PROTOCOL) > $@
remote_dispatch_ret.h: $(srcdir)/remote_generate_stubs.pl $(REMOTE_PROTOCOL)
- perl -w $(srcdir)/remote_generate_stubs.pl -r $(REMOTE_PROTOCOL) > $@
+ $(AM_V_GEN)perl -w $(srcdir)/remote_generate_stubs.pl -r $(REMOTE_PROTOCOL) > $@
LOGROTATE_CONFS = libvirtd.qemu.logrotate libvirtd.lxc.logrotate \
libvirtd.uml.logrotate
@@ -195,16 +195,16 @@ libvirtd.qemu.logrotate: libvirtd.qemu.logrotate.in
mv $@-t $@
libvirtd.lxc.logrotate: libvirtd.lxc.logrotate.in
- sed \
+ $(AM_V_GEN)sed \
-e 's![@]localstatedir[@]!$(localstatedir)!g' \
- < $< > $@-t
- mv $@-t $@
+ < $< > $@-t && \
+ mv $@-t $@
libvirtd.uml.logrotate: libvirtd.uml.logrotate.in
- sed \
+ $(AM_V_GEN)sed \
-e 's![@]localstatedir[@]!$(localstatedir)!g' \
- < $< > $@-t
- mv $@-t $@
+ < $< > $@-t && \
+ mv $@-t $@
install-logrotate: $(LOGROTATE_CONFS)
mkdir -p $(DESTDIR)$(localstatedir)/log/libvirt/qemu/
@@ -231,13 +231,13 @@ uninstall-init:
BUILT_SOURCES += libvirtd.init
libvirtd.init: libvirtd.init.in
- sed \
+ $(AM_V_GEN)sed \
-e s!\@localstatedir\@!@localstatedir@!g \
-e s!\@sbindir\@!@sbindir@!g \
-e s!\@sysconfdir\@!@sysconfdir@!g \
- < $< > $@-t
- chmod a+x $@-t
- mv $@-t $@
+ < $< > $@-t && \
+ chmod a+x $@-t && \
+ mv $@-t $@
check-local:
test -x '$(AUGPARSE)' \
diff --git a/src/Makefile.am b/src/Makefile.am
index c661a5c..cc0a7d6 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -870,17 +870,17 @@ EXTRA_DIST += \
BUILT_SOURCES = libvirt.syms
libvirt.syms: libvirt_public.syms $(USED_SYM_FILES)
- rm -f $@-tmp $@
- printf '# WARNING: generated from the following:\n# $^\n\n' >$@-tmp
- cat $(srcdir)/libvirt_public.syms >>$@-tmp
- printf '\n\n# Private symbols\n\n' >>$@-tmp
- printf 'LIBVIRT_PRIVATE_$(VERSION) {\n\n' >>$@-tmp
- printf 'global:\n\n' >>$@-tmp
+ $(AM_V_GEN)rm -f $@-tmp $@ ; \
+ printf '# WARNING: generated from the following:\n# $^\n\n' >$@-tmp && \
+ cat $(srcdir)/libvirt_public.syms >>$@-tmp && \
+ printf '\n\n# Private symbols\n\n' >>$@-tmp && \
+ printf 'LIBVIRT_PRIVATE_$(VERSION) {\n\n' >>$@-tmp && \
+ printf 'global:\n\n' >>$@-tmp && \
for file in $(USED_SYM_FILES); do \
cat $(srcdir)/$$file >>$@-tmp; \
- done
- printf '\n\nlocal:\n*;\n\n};' >>$@-tmp
- chmod a-w $@-tmp
+ done && \
+ printf '\n\nlocal:\n*;\n\n};' >>$@-tmp && \
+ chmod a-w $@-tmp && \
mv $@-tmp libvirt.syms
# Empty source list - it merely links a bunch of convenience libs together
diff --git a/tools/Makefile.am b/tools/Makefile.am
index 46107f6..33a3216 100644
--- a/tools/Makefile.am
+++ b/tools/Makefile.am
@@ -17,18 +17,18 @@ man1_MANS = virt-xml-validate.1 virt-pki-validate.1 virsh.1
virt-xml-validate: virt-xml-validate.in Makefile
- sed -e 's,@SCHEMADIR@,$(pkgdatadir)/schemas,' < $< > $@ || (rm $@ && exit 1)
- chmod +x $@
+ $(AM_V_GEN)sed -e 's,@SCHEMADIR@,$(pkgdatadir)/schemas,' < $< > $@ \
+ || (rm $@ && exit 1) && chmod +x $@
virt-xml-validate.1: virt-xml-validate
- $(POD2MAN) $< $@
+ $(AM_V_GEN)$(POD2MAN) $< $@
virt-pki-validate: virt-pki-validate.in Makefile
- sed -e 's,@SYSCONFDIR@,$(sysconfdir),' < $< > $@ || (rm $@ && exit 1)
- chmod +x $@
+ $(AM_V_GEN)sed -e 's,@SYSCONFDIR@,$(sysconfdir),' < $< > $@ \
+ || (rm $@ && exit 1) && chmod +x $@
virt-pki-validate.1: virt-pki-validate
- $(POD2MAN) $< $@
+ $(AM_V_GEN)$(POD2MAN) $< $@
virsh_SOURCES = \
console.c console.h \
@@ -55,24 +55,24 @@ virsh_CFLAGS = \
BUILT_SOURCES = virsh-net-edit.c virsh-pool-edit.c
virsh-net-edit.c: virsh.c Makefile.am
- rm -f $@-tmp
- echo '/* Automatically generated from: $^ */' > $@-tmp
- echo 'static int' >> $@-tmp
+ $(AM_V_GEN)rm -f $@-tmp && \
+ echo '/* Automatically generated from: $^ */' > $@-tmp && \
+ echo 'static int' >> $@-tmp && \
awk '/^cmdEdit/, /^}/' $< \
| sed -e 's/domain/network/g' \
-e 's/Domain/Network/g' \
-e 's/cmdEdit/cmdNetworkEdit/g' \
-e 's/dom/network/g' \
-e 's/int flags.*/int flags = 0;/g' \
- >> $@-tmp
- chmod a-w $@-tmp
- rm -f $@
+ >> $@-tmp && \
+ chmod a-w $@-tmp && \
+ rm -f $@ && \
mv $@-tmp $@
virsh-pool-edit.c: virsh.c Makefile.am
- rm -f $@-tmp
- echo '/* Automatically generated from: $^ */' > $@-tmp
- echo 'static int' >> $@-tmp
+ $(AM_V_GEN)rm -f $@-tmp && \
+ echo '/* Automatically generated from: $^ */' > $@-tmp && \
+ echo 'static int' >> $@-tmp && \
awk '/^cmdEdit/, /^}/' $< \
| sed -e 's/domain/pool/g' \
-e 's/vshCommandOptDomain/vshCommandOptPool/g' \
@@ -83,9 +83,9 @@ virsh-pool-edit.c: virsh.c Makefile.am
-e 's/\(virStoragePoolDefineXML.*\));/\1, 0);/' \
-e 's/dom/pool/g' \
-e 's/int flags.*/int flags = 0;/g' \
- >> $@-tmp
- chmod a-w $@-tmp
- rm -f $@
+ >> $@-tmp && \
+ chmod a-w $@-tmp && \
+ rm -f $@ && \
mv $@-tmp $@
@@ -110,13 +110,13 @@ virsh_LDADD += virsh_win_icon.$(OBJEXT)
# information is needed in this area.
virsh_win_icon.$(OBJEXT): virsh_win_icon.rc
- $(WINDRES) \
+ $(AM_V_GEN)$(WINDRES) \
--input-format rc --input $< \
--output-format coff --output $@
endif
virsh.1: virsh.pod
- $(POD2MAN) $< $@
+ $(AM_V_GEN)$(POD2MAN) $< $@
CLEANFILES = $(bin_SCRIPTS) $(man1_MANS)
--
1.6.2.5
14 years, 7 months
[libvirt] failed to connect to the hypervisor
by Ameya Pandit
Hi,
I have KVM qemu installed on Fedora 12 host server.
My VMs are marked to autostart. When I reboot my host server the
virtual machines starts but halts on its bios display screen.
If I login mannually destroy the VMs and start again, it just works
without any errors.
Can someone please help me with this issue ?
error logs I found are this :
Starting libvirtd daemon: [ OK ]
error: unable to connect to '/var/run/libvirt/libvirt-sock': No such
file or directory
error: failed to connect to the hypervisor
some more info :
virsh capabilities
<capabilities>
<host>
<cpu>
<arch>i686</arch>
</cpu>
<migration_features>
<live/>
<uri_transports>
<uri_transport>tcp</uri_transport>
</uri_transports>
</migration_features>
</host>
<guest>
<os_type>hvm</os_type>
<arch name='i686'>
<wordsize>32</wordsize>
<emulator>/usr/bin/qemu</emulator>
<machine>pc-0.11</machine>
<machine canonical='pc-0.11'>pc</machine>
<machine>pc-0.10</machine>
<machine>isapc</machine>
<domain type='qemu'>
</domain>
<domain type='kvm'>
<emulator>/usr/bin/qemu-kvm</emulator>
<machine>pc-0.11</machine>
<machine canonical='pc-0.11'>pc</machine>
<machine>pc-0.10</machine>
<machine>isapc</machine>
</domain>
</arch>
<features>
<pae/>
<nonpae/>
<acpi default='on' toggle='yes'/>
<apic default='on' toggle='no'/>
</features>
</guest>
<guest>
<os_type>hvm</os_type>
<arch name='x86_64'>
<wordsize>64</wordsize>
<emulator>/usr/bin/qemu-system-x86_64</emulator>
<machine>pc-0.11</machine>
<machine canonical='pc-0.11'>pc</machine>
<machine>pc-0.10</machine>
<machine>isapc</machine>
<domain type='qemu'>
</domain>
</arch>
<features>
<acpi default='on' toggle='yes'/>
<apic default='on' toggle='no'/>
</features>
</guest>
</capabilities>
Kindly let me know if any more information required inorder to fix this issue.
--
Regards,
Ameya Pandit
Buzz: 90040 27390 | www.ameyapandit.com
14 years, 7 months
[libvirt] [PATCH] Add virt-aa-helper and secaatest to .gitignore
by Matthias Bolte
---
src/.gitignore | 1 +
tests/.gitignore | 1 +
2 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/src/.gitignore b/src/.gitignore
index 26b8689..e407dcb 100644
--- a/src/.gitignore
+++ b/src/.gitignore
@@ -15,3 +15,4 @@ libvirt_lxc
libvirt.syms
*.i
*.s
+virt-aa-helper
diff --git a/tests/.gitignore b/tests/.gitignore
index 399baee..387a924 100644
--- a/tests/.gitignore
+++ b/tests/.gitignore
@@ -33,3 +33,4 @@ object-locking-files.txt
esxutilstest
vmx2xmltest
xml2vmxtest
+secaatest
--
1.6.3.3
14 years, 7 months
[libvirt] Vserver support in Libvirt
by Chaitra Gorantla
Hi all,
I am using libvirt for managing KVM. I would also like to manage Vserver using libvirt.
Is there any patch available for vserver ? When will libvirt release official patch for vserver?
Thanks,
Chaitra
Regards,
Chaitra GN
"I don't think anything is unrealistic if you believe you can do it"
________________________________
This Email may contain confidential or privileged information for the intended recipient (s) If you are not the intended recipient, please do not use or disseminate the information, notify the sender and delete it from your system.
______________________________________________________________________
14 years, 7 months
[libvirt] Vserver patch for Libvirt
by Chaitra Gorantla
Hi all,
I am using libvirt for managing KVM. I would also like to manage Vserver also using libvirt.
Is there any patch available for vserver ? When will libvirt relase official patch for vserver?
Thanks,
Chaitra
________________________________
This Email may contain confidential or privileged information for the intended recipient (s) If you are not the intended recipient, please do not use or disseminate the information, notify the sender and delete it from your system.
______________________________________________________________________
14 years, 7 months
[libvirt] [PATCH] nwfilter: fix some make dist/built/rpm issues
by Daniel Veillard
Here is a couple of patches related to make dist, then build from
resulting tarball and rpm building.
The first one adds a few missing header files in the associated file
variables, it's needed otherwise the missing headers would break
compilation from a distribution tarball
The second one handles the xml filter files, first they need to be
added to EXTRA_DIST from their Makefile.am otherwise they are missing
from the tarball, and second that set of file in /etc/ need to be
listed in the rpm spec file, associated with the main libvirt rpm
(i.e. where the daemon resides as it's useless with just the client).
I think those are fairly uncontroversial and are needed to not
break the distribution, but I will probably commit those tomorrow,
in case someone points out something stupid :-)
Daniel
--
Daniel Veillard | libxml Gnome XML XSLT toolkit http://xmlsoft.org/
daniel(a)veillard.com | Rpmfind RPM search engine http://rpmfind.net/
http://veillard.com/ | virtualization library http://libvirt.org/
14 years, 7 months
[libvirt] [PATCH] nwfilter: Make entries in a int-2-string map more readable
by Stefan Berger
A cosmetic change that makes the entries in the int-2-string maps look
more readable. Add some missing entries.
Signed-off-by: Stefan Berger <stefanb(a)us.ibm.com>
---
src/conf/nwfilter_conf.c | 97 +++++++++++++----------------------------------
1 file changed, 28 insertions(+), 69 deletions(-)
Index: libvirt-acl/src/conf/nwfilter_conf.c
===================================================================
--- libvirt-acl.orig/src/conf/nwfilter_conf.c
+++ libvirt-acl/src/conf/nwfilter_conf.c
@@ -105,6 +105,9 @@ struct int_map {
const char *val;
};
+#define INTMAP_ENTRY(ATT, VAL) { .attr = ATT, .val = VAL }
+#define INTMAP_ENTRY_LAST { .val = NULL }
+
/*
* only one filter update allowed
@@ -388,18 +391,10 @@ struct _virXMLAttr2Struct
static const struct int_map macProtoMap[] = {
- {
- .attr = ETHERTYPE_ARP,
- .val = "arp",
- }, {
- .attr = ETHERTYPE_IP,
- .val = "ipv4",
- }, {
- .attr = ETHERTYPE_IPV6,
- .val = "ipv6",
- }, {
- .val = NULL,
- }
+ INTMAP_ENTRY(ETHERTYPE_ARP , "arp"),
+ INTMAP_ENTRY(ETHERTYPE_IP , "ipv4"),
+ INTMAP_ENTRY(ETHERTYPE_IPV6, "ipv6"),
+ INTMAP_ENTRY_LAST
};
@@ -486,36 +481,16 @@ checkMACMask(enum attrDatatype datatype
* supported arp opcode -- see 'ebtables -h arp' for the naming
*/
static const struct int_map arpOpcodeMap[] = {
- {
- .attr = 1,
- .val = "Request",
- } , {
- .attr = 2,
- .val = "Reply",
- } , {
- .attr = 3,
- .val = "Request_Reverse",
- } , {
- .attr = 4,
- .val = "Reply_Reverse",
- } , {
- .attr = 5,
- .val = "DRARP_Request",
- } , {
- .attr = 6,
- .val = "DRARP_Reply",
- } , {
- .attr = 7,
- .val = "DRARP_Error",
- } , {
- .attr = 8,
- .val = "InARP_Request",
- } , {
- .attr = 9,
- .val = "ARP_NAK",
- } , {
- .val = NULL,
- }
+ INTMAP_ENTRY(1, "Request"),
+ INTMAP_ENTRY(2, "Reply"),
+ INTMAP_ENTRY(3, "Request_Reverse"),
+ INTMAP_ENTRY(4, "Reply_Reverse"),
+ INTMAP_ENTRY(5, "DRARP_Request"),
+ INTMAP_ENTRY(6, "DRARP_Reply"),
+ INTMAP_ENTRY(7, "DRARP_Error"),
+ INTMAP_ENTRY(8, "InARP_Request"),
+ INTMAP_ENTRY(9, "ARP_NAK"),
+ INTMAP_ENTRY_LAST
};
@@ -562,37 +537,21 @@ arpOpcodeFormatter(virBufferPtr buf,
static const struct int_map ipProtoMap[] = {
- {
- .attr = IPPROTO_TCP,
- .val = "tcp",
- } , {
- .attr = IPPROTO_UDP,
- .val = "udp",
+ INTMAP_ENTRY(IPPROTO_TCP, "tcp"),
+ INTMAP_ENTRY(IPPROTO_UDP, "udp"),
#ifdef IPPROTO_UDPLITE
- } , {
- .attr = IPPROTO_UDPLITE,
- .val = "udplite",
+ INTMAP_ENTRY(IPPROTO_UDPLITE, "udplite"),
#endif
- } , {
- .attr = IPPROTO_ESP,
- .val = "esp",
- } , {
- .attr = IPPROTO_AH,
- .val = "ah",
- } , {
- .attr = IPPROTO_ICMP,
- .val = "icmp",
- } , {
- .attr = IPPROTO_IGMP,
- .val = "igmp",
+ INTMAP_ENTRY(IPPROTO_ESP, "esp"),
+ INTMAP_ENTRY(IPPROTO_AH, "ah"),
+ INTMAP_ENTRY(IPPROTO_ICMP, "icmp"),
+ INTMAP_ENTRY(IPPROTO_IGMP, "igmp"),
#ifdef IPPROTO_SCTP
- } , {
- .attr = IPPROTO_SCTP,
- .val = "sctp",
+ INTMAP_ENTRY(IPPROTO_SCTP, "sctp"),
#endif
- } , {
- .val = NULL,
- }
+ INTMAP_ENTRY(IPPROTO_IPV6, "ipv6"),
+ INTMAP_ENTRY(IPPROTO_ICMPV6, "icmpv6"),
+ INTMAP_ENTRY_LAST
};
14 years, 8 months