'Writes the passed value to the xenstore record for the given VM
at the specified location. A XenAPIPlugin.PluginError will be raised
if any error is encountered in the write process.'

def _write_to_xenstore(self, instance, path, value, vm_ref=None):

    dom_id = self._get_dom_id(instance, vm_ref)
    try:
        return host_xenstore.write_record(self._session, dom_id, path, jsonutils.dumps(value))
    except self._session.XenAPI.Failure as e:
        return self._process_plugin_exception(e, 'write_record', instance)
