Hello community, here is the log from the commit of package virt-sandbox for openSUSE:Factory checked in at 2017-12-14 11:00:22 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/virt-sandbox (Old) and /work/SRC/openSUSE:Factory/.virt-sandbox.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "virt-sandbox" Thu Dec 14 11:00:22 2017 rev:15 rq:556525 version:0.6.0 Changes: -------- --- /work/SRC/openSUSE:Factory/virt-sandbox/virt-sandbox.changes 2017-12-05 01:30:54.427840249 +0100 +++ /work/SRC/openSUSE:Factory/.virt-sandbox.new/virt-sandbox.changes 2017-12-14 11:01:20.412443262 +0100 @@ -1,0 +2,9 @@ +Fri Dec 12 14:39:22 UTC 2017 - [email protected] + +- Rename upstreamed patch: + python3.patch -> 35d13f92-python3.patch +- Don't unmount filesystem for container machines to avoid 'normal' + unmount denial errors in stderr and audit.log. (bsc#1072402) + no-unmount-for-lxc-machines.patch + +------------------------------------------------------------------- Old: ---- python3.patch New: ---- 35d13f92-python3.patch no-unmount-for-lxc-machines.patch ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ virt-sandbox.spec ++++++ --- /var/tmp/diff_new_pack.JUOG5c/_old 2017-12-14 11:01:23.612288792 +0100 +++ /var/tmp/diff_new_pack.JUOG5c/_new 2017-12-14 11:01:23.612288792 +0100 @@ -33,11 +33,12 @@ Patch0: dhcp-fix.patch Patch1: 559b54d-load-ext4.patch Patch2: f24d003b-sync-unmount-shutdown.patch +Patch3: 35d13f92-python3.patch # Patches pending upstream review +Patch100: no-unmount-for-lxc-machines.patch # Need to go upstream -Patch150: python3.patch # Our patches Patch200: no-libexec.patch @@ -102,9 +103,12 @@ %patch0 -p1 %patch1 -p1 %patch2 -p1 -%patch150 -p1 +%patch3 -p1 +%patch100 -p1 %patch200 -p1 +sed -i -e 's:/usr/bin/python:/usr/bin/python3:' bin/virt-sandbox-service + %build # We may have a more recent version of automake when building # than the one used to autoconfigure the project for the distribution ++++++ 35d13f92-python3.patch ++++++ >From 35d13f924626aa44a5fa2d6926c205491db9b5af Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Bosdonnat?= <[email protected]> Date: Mon, 4 Dec 2017 13:01:12 +0100 Subject: [sandbox] Convert to python3 Python2 is going to die soon, convert to python3. --- bin/virt-sandbox-service | 56 +++++++++++++++------------------ libvirt-sandbox/image/cli.py | 18 +++++------ libvirt-sandbox/image/sources/docker.py | 41 ++++++++++++------------ libvirt-sandbox/image/template.py | 8 ++--- 4 files changed, 59 insertions(+), 64 deletions(-) diff --git a/bin/virt-sandbox-service b/bin/virt-sandbox-service index c34c6f3..42a0c40 100755 --- a/bin/virt-sandbox-service +++ b/bin/virt-sandbox-service @@ -30,7 +30,6 @@ from gi.repository import GLib import gi import re import os, sys, shutil, errno, stat -import exceptions import rpm from subprocess import Popen, PIPE, STDOUT import gettext @@ -49,7 +48,6 @@ gettext.textdomain("libvirt-sandbox") try: gettext.install("libvirt-sandbox", localedir="/usr/share/locale", - unicode=False, codeset = 'utf-8') except IOError: import __builtin__ @@ -235,7 +233,7 @@ class Container: path = "%s%s" % (self.dest, f) os.chown(path, s.st_uid, s.st_gid) os.chmod(path, s.st_mode) - except OSError, e: + except OSError as e: if not e.errno == errno.ENOENT: raise @@ -253,7 +251,7 @@ class Container: try: path = "%s%s" % (self.dest, d) os.makedirs(path) - except OSError, e: + except OSError as e: if not e.errno == errno.EEXIST: raise @@ -263,7 +261,7 @@ class Container: path = "%s%s" % (self.dest, f) fd=open(path, "w") fd.close() - except OSError, e: + except OSError as e: if not e.errno == errno.EEXIST: raise @@ -404,10 +402,10 @@ class GenericContainer(Container): def create(self): try: self.create_generic() - except Exception, e: + except Exception as e: try: self.delete() - except Exception, e2: + except Exception as e2: pass raise e @@ -581,8 +579,8 @@ WantedBy=multi-user.target def get_rpm_for_unit(self, unitfile): mi = self.ts.dbMatch(rpm.RPMTAG_BASENAMES, unitfile) try: - h = mi.next(); - except exceptions.StopIteration: + h = next(mi); + except StopIteration: return None return h['name'] @@ -590,8 +588,8 @@ WantedBy=multi-user.target def extract_rpm(self, rpm_name): mi = self.ts.dbMatch('name', rpm_name) try: - h = mi.next(); - except exceptions.StopIteration: + h = next(mi); + except StopIteration: raise ValueError([_("Cannot find package named %s") % rpm_name]) for fentry in h.fiFromHeader(): @@ -602,16 +600,16 @@ WantedBy=multi-user.target if os.path.isfile(fname): self.add_file(fname) - srcrpm = h[rpm.RPMTAG_SOURCERPM] + srcrpm = str(h[rpm.RPMTAG_SOURCERPM], encoding='utf-8') srcrpmbits = self.split_filename(srcrpm) - if srcrpmbits[0] == h[rpm.RPMTAG_NAME]: + if srcrpmbits[0] == str(h[rpm.RPMTAG_NAME], encoding='utf-8'): return mi = self.ts.dbMatch(rpm.RPMTAG_NAME, srcrpmbits[0]) try: - h = mi.next(); - except exceptions.StopIteration: + h = next(mi); + except StopIteration: raise ValueError([_("Cannot find base package %s") % srcrpmbits[0]]) for fentry in h.fiFromHeader(): @@ -771,7 +769,7 @@ PrivateNetwork=false fd.write("[Unit]\n") fd.write("Description=Sandbox multi-user target\n") fd.close() - except OSError, e: + except OSError as e: if not e.errno == errno.EEXIST: raise @@ -789,7 +787,7 @@ PrivateNetwork=false jpath = "/var/log/journal/" + uuid if os.path.lexists(jpath): os.remove(jpath) - except Exception, e: + except Exception as e: sys.stderr.write("%s: %s\n" % (sys.argv[0], e)) sys.stderr.flush() @@ -825,10 +823,10 @@ PrivateNetwork=false try: self.create_systemd() - except Exception, e: + except Exception as e: try: self.delete() - except Exception, e2: + except Exception as e2: sys.stderr.write("Cleanup failed: %s\n" % str(e2)) raise @@ -923,10 +921,10 @@ def connect(args): execute(args) return - print """\ + print ("""\ Connected to %s. Type 'Ctrl + ]' to detach from the console. -""" % ( args.name ) +""" % ( args.name )) os.execl("/usr/libexec/virt-sandbox-service-util", "virt-sandbox-service-util", "-c", args.uri, @@ -1014,7 +1012,7 @@ def clone(args): newcontainer.set_security(args.security) newcontainer.set_security_label() newcontainer.save_config() - except Exception, e: + except Exception as e: if newcontainer is not None: newcontainer.delete() raise @@ -1296,23 +1294,21 @@ if __name__ == '__main__': sys.exit(1) args.func(args) sys.exit(0) - except KeyboardInterrupt, e: + except KeyboardInterrupt as e: sys.exit(0) - except ValueError, e: - for line in e: - for l in line: - sys.stderr.write("%s: %s\n" % (sys.argv[0], l)) + except ValueError as e: + sys.stderr.write("%s: %s\n" % (sys.argv[0], e)) sys.stderr.flush() sys.exit(1) - except IOError, e: + except IOError as e: sys.stderr.write("%s: %s: %s\n" % (sys.argv[0], e.filename, e.strerror)) sys.stderr.flush() sys.exit(1) - except OSError, e: + except OSError as e: sys.stderr.write("%s: %s\n" % (sys.argv[0], e)) sys.stderr.flush() sys.exit(1) - except GLib.GError, e: + except GLib.GError as e: sys.stderr.write("%s: %s\n" % (sys.argv[0], e)) sys.stderr.flush() sys.exit(1) 2.15.1 ++++++ no-libexec.patch ++++++ --- /var/tmp/diff_new_pack.JUOG5c/_old 2017-12-14 11:01:23.660286475 +0100 +++ /var/tmp/diff_new_pack.JUOG5c/_new 2017-12-14 11:01:23.660286475 +0100 @@ -2,7 +2,7 @@ =================================================================== --- libvirt-sandbox-0.6.0.orig/bin/virt-sandbox-service +++ libvirt-sandbox-0.6.0/bin/virt-sandbox-service -@@ -484,7 +484,7 @@ After=libvirtd.service +@@ -467,7 +467,7 @@ After=libvirtd.service %(FOLLOW)s [Service] Type=simple @@ -11,22 +11,16 @@ ExecReload=/usr/bin/virt-sandbox-service -c %(URI)s reload -u %(RELOAD)s %(NAME)s ExecStop=/usr/bin/virsh -c %(URI)s destroy %(NAME)s -@@ -935,11 +935,11 @@ def connect(args): - print ("""\ +@@ -919,7 +919,7 @@ def connect(args): Connected to %s. Type 'Ctrl + ]' to detach from the console. --""" % ( args.name ) + """ % ( args.name )) - os.execl("/usr/libexec/virt-sandbox-service-util", -+""" % ( args.name )) + os.execl("/usr/lib/virt-sandbox-service-util", "virt-sandbox-service-util", "-c", args.uri, -- "-a", args.name)) -+ "-a", args.name) - - # - # Search Path for command to execute within the container. -@@ -1042,7 +1042,7 @@ def upgrade_config_legacy(path): + "-a", args.name) +@@ -1025,7 +1025,7 @@ def upgrade_config_legacy(path): fd.close() unitfile = unitfile.replace("/usr/bin/virt-sandbox-service start", ++++++ no-unmount-for-lxc-machines.patch ++++++ >From d4dcfc61a2828253239e28d114f5194d94f128fb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Bosdonnat?= <[email protected]> Date: Mon, 11 Dec 2017 18:34:04 +0100 Subject: [sandbox] init: no unmount for lxc machines An lxc machine tries to unmount all host mounts when shutting down. When the machine is running confined by apparmor, this results in a flurry of denied unmout messages that are uninportant. To avoid this, only do the unmount for the qemu machines. --- libvirt-sandbox/libvirt-sandbox-init-common.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) Index: libvirt-sandbox-0.6.0/libvirt-sandbox/libvirt-sandbox-init-common.c =================================================================== --- libvirt-sandbox-0.6.0.orig/libvirt-sandbox/libvirt-sandbox-init-common.c +++ libvirt-sandbox-0.6.0/libvirt-sandbox/libvirt-sandbox-init-common.c @@ -595,7 +595,8 @@ static GVirSandboxRPCPacket *gvir_sandbo * opportunistically sync + unmount here too. */ sync_data(); - umount_fs(); + if (!getenv("LIBVIRT_LXC_UUID")) + umount_fs(); if (!gvir_sandbox_rpcpacket_encode_header(pkt, error)) goto error; @@ -1453,7 +1454,7 @@ int main(int argc, char **argv) { sync_data(); - if (poweroff) { + if (poweroff && !getenv("LIBVIRT_LXC_UUID")) { umount_fs(); reboot(RB_POWER_OFF); /* Should not be reached, but if it is, kernel will panic anyway */
