提交 aa2c9726 编写于 作者: D Daniel P. Berrange

virsh additions for sVirt support (James Morris & Dan Walsh)

上级 8bd1604c
Tue Mar 3 09:55:13 GMT 2009 Daniel P. Berrange <berrange@redhat.com>
virsh additions for sVirt support (James Morris & Dan Walsh)
* src/virsh.c: Include security model / label information
in the 'dominfo' output
Tue Mar 3 09:40:13 GMT 2009 Daniel P. Berrange <berrange@redhat.com>
Core internal driver stub for sVirt support (Jams Morris & Dan Walsh)
Core internal driver stub for sVirt support (James Morris & Dan Walsh)
* Makefile.maint: Add virSecurityReportError as a msggen
function
* docs/schemas/capability.rng: Add <secmodel> element
......
......@@ -1539,6 +1539,8 @@ cmdDominfo(vshControl *ctl, const vshCmd *cmd)
{
virDomainInfo info;
virDomainPtr dom;
virSecurityModel secmodel;
virSecurityLabel seclabel;
int ret = TRUE, autostart;
unsigned int id;
char *str, uuid[VIR_UUID_STRING_BUFLEN];
......@@ -1597,6 +1599,29 @@ cmdDominfo(vshControl *ctl, const vshCmd *cmd)
autostart ? _("enable") : _("disable") );
}
/* Security model and label information */
memset(&secmodel, 0, sizeof secmodel);
if (virNodeGetSecurityModel(ctl->conn, &secmodel) == -1) {
virDomainFree(dom);
return FALSE;
} else {
/* Only print something if a security model is active */
if (secmodel.model[0] != '\0') {
vshPrint(ctl, "%-15s %s\n", _("Security model:"), secmodel.model);
vshPrint(ctl, "%-15s %s\n", _("Security DOI:"), secmodel.doi);
/* Security labels are only valid for active domains */
memset(&seclabel, 0, sizeof seclabel);
if (virDomainGetSecurityLabel(dom, &seclabel) == -1) {
virDomainFree(dom);
return FALSE;
} else {
if (seclabel.label[0] != '\0')
vshPrint(ctl, "%-15s %s (%s)\n", _("Security label:"),
seclabel.label, seclabel.enforcing ? "enforcing" : "permissive");
}
}
}
virDomainFree(dom);
return ret;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册