From 1ec99abbc84f839163d08ce899a0aefcb23e983a055e5b418c62f3ab57552a87 Mon Sep 17 00:00:00 2001 From: James Fehlig Date: Fri, 25 Oct 2013 19:29:19 +0000 Subject: [PATCH] - libxl driver: fix initialization of VNC and SDL info for HVM domains libxl-hvm-vnc.patch bnc#847566 - Allow libvirtd apparmor profile to access /etc/xen/scripts/* OBS-URL: https://build.opensuse.org/package/show/Virtualization/libvirt?expand=0&rev=320 --- install-apparmor-profiles.patch | 3 ++- libvirt.changes | 9 +++++++ libvirt.spec | 2 ++ libxl-hvm-vnc.patch | 45 +++++++++++++++++++++++++++++++++ 4 files changed, 58 insertions(+), 1 deletion(-) create mode 100644 libxl-hvm-vnc.patch diff --git a/install-apparmor-profiles.patch b/install-apparmor-profiles.patch index b3a7bcb..e29b641 100644 --- a/install-apparmor-profiles.patch +++ b/install-apparmor-profiles.patch @@ -203,7 +203,7 @@ Index: libvirt-1.1.2/examples/apparmor/usr.sbin.libvirtd.in =================================================================== --- /dev/null +++ libvirt-1.1.2/examples/apparmor/usr.sbin.libvirtd.in -@@ -0,0 +1,59 @@ +@@ -0,0 +1,60 @@ +# Last Modified: Fri Aug 19 11:20:36 2011 +#include +@{LIBVIRT}="libvirt" @@ -255,6 +255,7 @@ Index: libvirt-1.1.2/examples/apparmor/usr.sbin.libvirtd.in + audit deny /sys/kernel/security/apparmor/matching rwxl, + audit deny /sys/kernel/security/apparmor/.* rwxl, + /sys/kernel/security/apparmor/profiles r, ++ /etc/xen/scripts/* r, + @libdir@/libvirt/* Pxr, + @libdir@/libvirt/libvirt_parthelper Ux, + @libdir@/libvirt/libvirt_iohelper Ux, diff --git a/libvirt.changes b/libvirt.changes index c8e51d8..787e7ef 100644 --- a/libvirt.changes +++ b/libvirt.changes @@ -1,3 +1,12 @@ +------------------------------------------------------------------- +Fri Oct 25 13:10:27 MDT 2013 - jfehlig@suse.com + +- libxl driver: fix initialization of VNC and SDL info for + HVM domains + libxl-hvm-vnc.patch + bnc#847566 +- Allow libvirtd apparmor profile to access /etc/xen/scripts/* + ------------------------------------------------------------------- Tue Oct 22 21:37:08 MDT 2013 - jfehlig@suse.com diff --git a/libvirt.spec b/libvirt.spec index 6cb823a..58a6d58 100644 --- a/libvirt.spec +++ b/libvirt.spec @@ -425,6 +425,7 @@ Patch17: e350826c-python-fix-fd-passing.patch Patch100: xen-name-for-devid.patch Patch101: clone.patch Patch102: xen-pv-cdrom.patch +Patch103: libxl-hvm-vnc.patch # Our patches Patch200: libvirtd-defaults.patch Patch201: libvirtd-init-script.patch @@ -953,6 +954,7 @@ of recent versions of Linux (and other OSes). %patch100 -p1 %patch101 %patch102 -p1 +%patch103 -p1 %patch200 -p1 %patch201 -p1 %patch202 -p1 diff --git a/libxl-hvm-vnc.patch b/libxl-hvm-vnc.patch new file mode 100644 index 0000000..f6809ff --- /dev/null +++ b/libxl-hvm-vnc.patch @@ -0,0 +1,45 @@ +Index: libvirt-1.1.2/src/libxl/libxl_conf.c +=================================================================== +--- libvirt-1.1.2.orig/src/libxl/libxl_conf.c ++++ libvirt-1.1.2/src/libxl/libxl_conf.c +@@ -524,6 +524,30 @@ libxlMakeChrdevStr(virDomainChrDefPtr de + } + + static int ++libxlFixupDomBuildInfo(virDomainDefPtr def, libxl_domain_config *d_config) ++{ ++ libxl_domain_build_info *b_info = &d_config->b_info; ++ int hvm = STREQ(def->os.type, "hvm"); ++ libxl_device_vfb vfb; ++ ++ if (!hvm) ++ return 0; ++ ++ if (d_config->num_vfbs) { ++ vfb = d_config->vfbs[0]; ++ if (libxl_defbool_val(vfb.vnc.enable)) ++ memcpy(&b_info->u.hvm.vnc, &vfb.vnc, sizeof(libxl_vnc_info)); ++ else if (libxl_defbool_val(vfb.sdl.enable)) ++ memcpy(&b_info->u.hvm.sdl, &vfb.sdl, sizeof(libxl_sdl_info)); ++ else ++ return -1; ++ } ++ ++ return 0; ++} ++ ++ ++static int + libxlMakeDomBuildInfo(virDomainObjPtr vm, libxl_domain_config *d_config) + { + virDomainDefPtr def = vm->def; +@@ -1025,6 +1049,9 @@ libxlBuildDomainConfig(libxlDriverPrivat + if (libxlMakeVfbList(driver, def, d_config) < 0) + return -1; + ++ if (libxlFixupDomBuildInfo(def, d_config) < 0) ++ return -1; ++ + d_config->on_reboot = def->onReboot; + d_config->on_poweroff = def->onPoweroff; + d_config->on_crash = def->onCrash;