xapi-project / vhd-tool

Command-line tools for streaming and manipulating vhd format data
Other
8 stars 26 forks source link

CP-7327 nice and ionice config options for sparse_dd.conf #2

Closed thomassa closed 10 years ago

thomassa commented 10 years ago

Signed-off-by: Thomas Sanders thomas.sanders@citrix.com

thomassa commented 10 years ago

@xen-git test this please

mcclurmc commented 10 years ago

Looks good, @thomassa. I'd have recommended using the POSIX function setpriority [1] instead of forking out to nice to change the process priority, but it looks like the corresponding function to set IO priority is Linux-specific and doesn't have a glibc wrapper, so you have to jump through hoops and call it using syscall [2] [3]. While we could probably quickly whip up a ctypes binding to setpriority (or just use the one in ExtUnix [4]), it's probably not worth it since we I don't think we want to bother wrapping ioprio_set.

Other than that, the code is clean and well documented. Merge time!

[1] http://man7.org/linux/man-pages/man2/setpriority.2.html [2] http://man7.org/linux/man-pages/man2/ioprio_set.2.html [3] http://lxr.free-electrons.com/source/Documentation/block/ioprio.txt [4] http://extunix.forge.ocamlcore.org/api/ExtUnix.All.html