linux/drivers/hv/hv_snapshot.c

// SPDX-License-Identifier: GPL-2.0-only
/*
 * An implementation of host initiated guest snapshot.
 *
 * Copyright (C) 2013, Microsoft, Inc.
 * Author : K. Y. Srinivasan <[email protected]>
 */
#define pr_fmt(fmt)

#include <linux/net.h>
#include <linux/nls.h>
#include <linux/connector.h>
#include <linux/workqueue.h>
#include <linux/hyperv.h>
#include <asm/hyperv-tlfs.h>

#include "hyperv_vmbus.h"
#include "hv_utils_transport.h"

#define VSS_MAJOR
#define VSS_MINOR
#define VSS_VERSION

#define VSS_VER_COUNT
static const int vss_versions[] =;

#define FW_VER_COUNT
static const int fw_versions[] =;

/* See comment with struct hv_vss_msg regarding the max VMbus packet size */
#define VSS_MAX_PKT_SIZE

/*
 * Timeout values are based on expecations from host
 */
#define VSS_FREEZE_TIMEOUT

/*
 * Global state maintained for transaction that is being processed. For a class
 * of integration services, including the "VSS service", the specified protocol
 * is a "request/response" protocol which means that there can only be single
 * outstanding transaction from the host at any given point in time. We use
 * this to simplify memory management in this driver - we cache and process
 * only one message at a time.
 *
 * While the request/response protocol is guaranteed by the host, we further
 * ensure this by serializing packet processing in this driver - we do not
 * read additional packets from the VMBUs until the current packet is fully
 * handled.
 */

static struct {} vss_transaction;


static void vss_respond_to_host(int error);

/*
 * This state maintains the version number registered by the daemon.
 */
static int dm_reg_value;

static const char vss_devname[] =;
static __u8 *recv_buffer;
static struct hvutil_transport *hvt;

static void vss_timeout_func(struct work_struct *dummy);
static void vss_handle_request(struct work_struct *dummy);

static DECLARE_DELAYED_WORK(vss_timeout_work, vss_timeout_func);
static DECLARE_WORK(vss_handle_request_work, vss_handle_request);

static void vss_poll_wrapper(void *channel)
{}

/*
 * Callback when data is received from user mode.
 */

static void vss_timeout_func(struct work_struct *dummy)
{}

static void vss_register_done(void)
{}

static int vss_handle_handshake(struct hv_vss_msg *vss_msg)
{}

static int vss_on_msg(void *msg, int len)
{}

static void vss_send_op(void)
{}

static void vss_handle_request(struct work_struct *dummy)
{}

/*
 * Send a response back to the host.
 */

static void
vss_respond_to_host(int error)
{}

/*
 * This callback is invoked when we get a VSS message from the host.
 * The host ensures that only one VSS transaction can be active at a time.
 */

void hv_vss_onchannelcallback(void *context)
{}

static void vss_on_reset(void)
{}

int
hv_vss_init(struct hv_util_service *srv)
{}

static void hv_vss_cancel_work(void)
{}

int hv_vss_pre_suspend(void)
{}

int hv_vss_pre_resume(void)
{}

void hv_vss_deinit(void)
{}