diff --git a/qubes/storage/lvm.py b/qubes/storage/lvm.py index 18756acf..178019dd 100644 --- a/qubes/storage/lvm.py +++ b/qubes/storage/lvm.py @@ -102,7 +102,8 @@ class ThinPool(qubes.storage.Pool): 'name': self.name, 'volume_group': self.volume_group, 'thin_pool': self.thin_pool, - 'driver': ThinPool.driver + 'driver': ThinPool.driver, + 'revisions_to_keep': self.revisions_to_keep, } def destroy(self): @@ -702,6 +703,12 @@ def qubes_lvm(cmd, log=logging.getLogger('qubes.storage.lvm')): p = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE, close_fds=True, env=environ) out, err = p.communicate() + err = err.decode() + # Filter out warning about intended over-provisioning. + # Upstream discussion about missing option to silence it: + # https://bugzilla.redhat.com/1347008 + err = '\n'.join(line for line in err.splitlines() + if 'exceeds the size of thin pool' not in line) return_code = p.returncode if out: log.debug(out) @@ -709,6 +716,7 @@ def qubes_lvm(cmd, log=logging.getLogger('qubes.storage.lvm')): log.warning(err) elif return_code != 0: assert err, "Command exited unsuccessful, but printed nothing to stderr" + err = err.replace('%', '%%') raise qubes.storage.StoragePoolException(err) return True diff --git a/qubes/tests/extra.py b/qubes/tests/extra.py index d93b8cc2..9eb55c92 100644 --- a/qubes/tests/extra.py +++ b/qubes/tests/extra.py @@ -66,8 +66,9 @@ class VMWrapper(object): def __hash__(self): return hash(self._vm) - def start(self): - return self._loop.run_until_complete(self._vm.start()) + def start(self, start_guid=True): + return self._loop.run_until_complete( + self._vm.start(start_guid=start_guid)) def shutdown(self): return self._loop.run_until_complete(self._vm.shutdown()) diff --git a/qubes/tests/integ/pvgrub.py b/qubes/tests/integ/pvgrub.py index fa78f03b..53a699bd 100644 --- a/qubes/tests/integ/pvgrub.py +++ b/qubes/tests/integ/pvgrub.py @@ -70,7 +70,7 @@ class TC_40_PVGrub(object): def get_kernel_version(self, vm): if self.template.startswith('fedora-'): - cmd_get_kernel_version = 'rpm -q kernel-core|sort -n|tail -1|' \ + cmd_get_kernel_version = 'rpm -q kernel-core|sort -V|tail -1|' \ 'cut -d - -f 3-' elif self.template.startswith('debian-'): cmd_get_kernel_version = \ diff --git a/qubes/vm/qubesvm.py b/qubes/vm/qubesvm.py index 4bfc0317..85272c8e 100644 --- a/qubes/vm/qubesvm.py +++ b/qubes/vm/qubesvm.py @@ -912,9 +912,20 @@ class QubesVM(qubes.vm.mix.net.NetVMMixin, qubes.vm.BaseVM): self.log.info('Starting {}'.format(self.name)) - yield from self.fire_event_async('domain-pre-start', - pre_event=True, - start_guid=start_guid, mem_required=mem_required) + try: + yield from self.fire_event_async('domain-pre-start', + pre_event=True, + start_guid=start_guid, mem_required=mem_required) + except Exception as exc: + yield from self.fire_event_async('domain-start-failed', + reason=str(exc)) + raise + + for devclass in self.devices: + for dev in self.devices[devclass].persistent(): + if isinstance(dev, qubes.devices.UnknownDevice): + raise qubes.exc.QubesException( + '{} device {} not available'.format(devclass, dev)) qmemman_client = None try: