As a general rule the public virDomainPtr objects should not be passed
down into internal methods. Likewise, when creating / defining a VM,
the virGetDomain call should be the last one in the normal execution
path of the method.
Thus, just pass the 'virConnectPtr' instance to
openvzDomainSetVcpusInternal
as suggested above, and keep the setVcpusInternal calls above the call
to virGetDomain.
OK, done.