]> review.fuel-infra Code Review - openstack-build/cinder-build.git/commit
Rewrite ionice command filter using ChainingRegExpFilter
authorTomoki Sekiyama <tomoki.sekiyama@hds.com>
Wed, 25 Jun 2014 20:50:18 +0000 (16:50 -0400)
committerTomoki Sekiyama <tomoki.sekiyama@hds.com>
Fri, 15 Aug 2014 16:37:13 +0000 (12:37 -0400)
commitbb1579090b56b4de33bb3873b34ca6601f95dd56
tree28aaf7c9d2021e992cff7dfba5ac8209cd7bf46d
parent4b973e90e099d7ab66d3c10de2c32506d68e9f6c
Rewrite ionice command filter using ChainingRegExpFilter

Currently, the ionice command prepended to a dd command is allowed by three
rootwrap RegExpFilter's that cover 3 arguments patterns. However, this
doesn't support if either 'iflag=direct' or 'oflag=direct' is omitted.
Because of this problem, deletion of volumes may fail if volume_clear_ionice
is set, as 'iflag=direct' is omitted.

This commit fixes this problem by replacing the filters with
ChainingRegExpFilter's, which allow to execute ionice to be combined with the
other allowed commands, including 'dd'.

Originally '-c[0-3]( -n[0-7])?' was allowed as an ionice option, but it is
invalid to specify -n[0-7] in a single option (for example, when '-c2 -n7'
is specified, ionice causes an error "invalid class argument: '2 -n7'").
In this patch, 2 filters are provided to cover the case only with -c option
and the case with both -c and -n options.

Change-Id: Ia074bf3244b7f010bd9e3b5e46c3152c1848f3d3
Signed-off-by: Tomoki Sekiyama <tomoki.sekiyama@hds.com>
Closes-Bug: 1334422
cinder/tests/test_rootwrap_filter.py [new file with mode: 0644]
etc/cinder/rootwrap.d/volume.filters