+Thu Jun 25 10:32:22 BST 2009 Daniel P. Berrange <berrange@redhat.com>
+
+ Fix broken dominfo command when no security driver is implemented
+ * src/libvirt.c: Clarify semantics of return value for
+ virDomainGetSecurityLabel and virNodeGetSecurityModel
+ * src/remote_internal.c src/qemu_driver.c: memset seclabel
+ to zero
+ * src/virsh.c: Check VIR_ERR_NO_SUPPORT when querying security
+ labels in dominfo command.
+
Wed Jun 24 19:40:43 CEST 2009 Daniel Veillard <veillard@redhat.com>
* po/*: update a lot of translations, and regenerate the po* files
msgstr "প্রাপ্ত বাফারের মাপ অনুরোধ করা মাপের সমান নয়"
# comment from maintainer:
-# Peek is the operation of reading something in that context.
+# Peek is the operation of reading something in that context.
#: src/remote_internal.c:3225
#, c-format
msgid "memory peek request too large for remote protocol, %zi > %d"
* @domain: a domain object
* @seclabel: pointer to a virSecurityLabel structure
*
- * Extract security label of an active domain.
+ * Extract security label of an active domain. The 'label' field
+ * in the @seclabel argument will be initialized to the empty
+ * string if the domain is not running under a security model.
*
- * Returns 0 in case of success, -1 in case of failure, and -2
- * if the operation is not supported (caller decides if that's
- * an error).
+ * Returns 0 in case of success, -1 in case of failure
*/
int
virDomainGetSecurityLabel(virDomainPtr domain, virSecurityLabelPtr seclabel)
* @conn: a connection object
* @secmodel: pointer to a virSecurityModel structure
*
- * Extract the security model of a hypervisor.
+ * Extract the security model of a hypervisor. The 'model' field
+ * in the @secmodel argument may be initialized to the empty
+ * string if the driver has not activated a security model.
*
- * Returns 0 in case of success, -1 in case of failure, and -2 if the
- * operation is not supported (caller decides if that's an error).
+ * Returns 0 in case of success, -1 in case of failure
*/
int
virNodeGetSecurityModel(virConnectPtr conn, virSecurityModelPtr secmodel)
qemuDriverLock(driver);
vm = virDomainFindByUUID(&driver->domains, dom->uuid);
+ memset(seclabel, 0, sizeof(*seclabel));
+
if (!vm) {
char uuidstr[VIR_UUID_STRING_BUFLEN];
virUUIDFormat(dom->uuid, uuidstr);
qemuDriverLock(driver);
if (!driver->securityDriver) {
- ret = -2;
+ memset(secmodel, 0, sizeof (*secmodel));
goto cleanup;
}
make_nonnull_domain (&args.dom, domain);
memset (&ret, 0, sizeof ret);
+ memset (seclabel, 0, sizeof (*seclabel));
+
if (call (domain->conn, priv, 0, REMOTE_PROC_DOMAIN_GET_SECURITY_LABEL,
(xdrproc_t) xdr_remote_domain_get_security_label_args, (char *)&args,
(xdrproc_t) xdr_remote_domain_get_security_label_ret, (char *)&ret) == -1) {
remoteDriverLock(priv);
memset (&ret, 0, sizeof ret);
+ memset (secmodel, 0, sizeof (*secmodel));
+
if (call (conn, priv, 0, REMOTE_PROC_NODE_GET_SECURITY_MODEL,
(xdrproc_t) xdr_void, NULL,
(xdrproc_t) xdr_remote_node_get_security_model_ret, (char *)&ret) == -1) {
/* Security model and label information */
memset(&secmodel, 0, sizeof secmodel);
if (virNodeGetSecurityModel(ctl->conn, &secmodel) == -1) {
- virDomainFree(dom);
- return FALSE;
+ if (last_error->code != VIR_ERR_NO_SUPPORT) {
+ virDomainFree(dom);
+ return FALSE;
+ }
} else {
/* Only print something if a security model is active */
if (secmodel.model[0] != '\0') {