From d5c74a954b260567874c45c39b92904f3756b806 Mon Sep 17 00:00:00 2001 From: "Bryan D. Payne" Date: Mon, 31 Mar 2014 15:50:43 -0700 Subject: [PATCH] Adds ionice command permutations to rootwrap filters When setting volume_clear_ionice, the ionice command is prepended to a dd command before executing it. Previously, this would have failed because it wasn't allowed through the default rootwrap filters. This commit fixes this problem. Note that due to the way that the RegExpFilter works, we need three different expressions to cover all cases. This is because the various options result in a different number of arguments. And this filter will fail immediately if the number of arguments is incorrect. Change-Id: Ie29f7fa21b34982ed5394c2c8f38c3e066ef0112 Closes-Bug: #1300496 --- etc/cinder/rootwrap.d/volume.filters | 3 +++ 1 file changed, 3 insertions(+) diff --git a/etc/cinder/rootwrap.d/volume.filters b/etc/cinder/rootwrap.d/volume.filters index e4259332fdf..5b574040a7a 100644 --- a/etc/cinder/rootwrap.d/volume.filters +++ b/etc/cinder/rootwrap.d/volume.filters @@ -43,6 +43,9 @@ shred: CommandFilter, shred, root #cinder/volume/.py: utils.temporary_chown(path, 0), ... chown: CommandFilter, chown, root +ionice_1: RegExpFilter, ionice, root, ionice, -c[0-3]( -n[0-7])?, dd, if=\S+, of=\S+, count=\d+, bs=\S+ +ionice_2: RegExpFilter, ionice, root, ionice, -c[0-3]( -n[0-7])?, dd, if=\S+, of=\S+, count=\d+, bs=\S+, iflag=direct, oflag=direct +ionice_3: RegExpFilter, ionice, root, ionice, -c[0-3]( -n[0-7])?, dd, if=\S+, of=\S+, count=\d+, bs=\S+, conv=fdatasync # cinder/volume/driver.py dmsetup: CommandFilter, dmsetup, root