提交 ccef7d78 编写于 作者: P Peter Krempa

apparmor: Fix build after split of disk source metadata

Commit 4f202266 breaks build with
AppArmor enabled as it missed the refactor to the new accessors.
上级 4f202266
...@@ -688,7 +688,7 @@ AppArmorRestoreSecurityImageLabel(virSecurityManagerPtr mgr, ...@@ -688,7 +688,7 @@ AppArmorRestoreSecurityImageLabel(virSecurityManagerPtr mgr,
virDomainDefPtr def, virDomainDefPtr def,
virDomainDiskDefPtr disk) virDomainDiskDefPtr disk)
{ {
if (disk->type == VIR_DOMAIN_DISK_TYPE_NETWORK) if (virDomainDiskGetType(disk) == VIR_DOMAIN_DISK_TYPE_NETWORK)
return 0; return 0;
return reload_profile(mgr, def, NULL, false); return reload_profile(mgr, def, NULL, false);
...@@ -710,14 +710,16 @@ AppArmorSetSecurityImageLabel(virSecurityManagerPtr mgr, ...@@ -710,14 +710,16 @@ AppArmorSetSecurityImageLabel(virSecurityManagerPtr mgr,
if (secdef->norelabel) if (secdef->norelabel)
return 0; return 0;
if (!disk->src || disk->type == VIR_DOMAIN_DISK_TYPE_NETWORK) if (!virDomainDiskGetSource(disk) ||
virDomainDiskGetType(disk) == VIR_DOMAIN_DISK_TYPE_NETWORK)
return 0; return 0;
if (secdef->imagelabel) { if (secdef->imagelabel) {
/* if the device doesn't exist, error out */ /* if the device doesn't exist, error out */
if (!virFileExists(disk->src)) { if (!virFileExists(virDomainDiskGetSource(disk))) {
virReportError(VIR_ERR_INTERNAL_ERROR, virReportError(VIR_ERR_INTERNAL_ERROR,
_("\'%s\' does not exist"), disk->src); _("\'%s\' does not exist"),
virDomainDiskGetSource(disk));
return rc; return rc;
} }
...@@ -726,7 +728,8 @@ AppArmorSetSecurityImageLabel(virSecurityManagerPtr mgr, ...@@ -726,7 +728,8 @@ AppArmorSetSecurityImageLabel(virSecurityManagerPtr mgr,
/* update the profile only if it is loaded */ /* update the profile only if it is loaded */
if (profile_loaded(secdef->imagelabel) >= 0) { if (profile_loaded(secdef->imagelabel) >= 0) {
if (load_profile(mgr, secdef->imagelabel, def, disk->src, if (load_profile(mgr, secdef->imagelabel, def,
virDomainDiskGetSource(disk),
false) < 0) { false) < 0) {
virReportError(VIR_ERR_INTERNAL_ERROR, virReportError(VIR_ERR_INTERNAL_ERROR,
_("cannot update AppArmor profile " _("cannot update AppArmor profile "
......
...@@ -948,8 +948,8 @@ get_files(vahControl * ctl) ...@@ -948,8 +948,8 @@ get_files(vahControl * ctl)
*/ */
if (!disk->backingChain) { if (!disk->backingChain) {
bool probe = ctl->allowDiskFormatProbing; bool probe = ctl->allowDiskFormatProbing;
disk->backingChain = virStorageFileGetMetadata(disk->src, disk->backingChain = virStorageFileGetMetadata(virDomainDiskGetSource(disk),
disk->format, virDomainDiskGetFormat(disk),
-1, -1, probe); -1, -1, probe);
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册