set: don't call vps_setup_res() on an unsupported kernel

Long time ago, commit f18aada made it possible to use vzctl set --save
on an unsupported (ie non-openvz) kernel with --force flag, in order
to save parameters to ctid.conf.

Calling vps_setup_res() on such kernel is pointless, so let's skip it,
avoiding potential null pointer dereference (since h is null for a
non-supported kernel).

From the first glance it might look like we don't need to call
vps_setup_res() on a non-running container anyway. This is wrong, the
call is needed in such case to generate a bunch of relevant

	Unable to setup WHATEVER: CT is not running

errors.

Potential null pointer dereference reported by coverity, CID 996853.

Signed-off-by: Kir Kolyshkin <kir@openvz.org>
1 file changed