Files
qemu/migration/cgs.h
Wei Wang b8fc99d9d6 migration/cgs-tdx: allow the use of 1 migration stream
Migration stream is a TDX concept and it is analogous to a "channel" in
the TDX module for migration data export and import. The default migration
flow (i.e. with multifd disabled) supports 1 channel to migrate data, so
for the current tdx migration only 1 migration stream is implemented.

In KVM, the migration stream is supported via building a piece of memory
shared to QEMU to map, so the QEMU side TdxMigStream includes the pointers
which will be set to mapped memory.

Signed-off-by: Wei Wang <wei.w.wang@intel.com>
2023-11-28 17:14:54 +02:00

53 lines
1.7 KiB
C

/*
* QEMU Migration for Confidential Guest Support
*
* Copyright (C) 2022 Intel Corp.
*
* Authors:
* Wei Wang <wei.w.wang@intel.com>
*
* This work is licensed under the terms of the GNU GPL, version 2 or later.
* See the COPYING file in the top-level directory.
*
*/
#ifndef QEMU_MIGRATION_CGS_H
#define QEMU_MIGRATION_CGS_H
#include "qemu/osdep.h"
#include "migration.h"
typedef struct CgsMig {
bool (*is_ready)(void);
int (*savevm_state_setup)(void);
int (*savevm_state_start)(QEMUFile *f);
long (*savevm_state_ram_start_epoch)(QEMUFile *f);
long (*savevm_state_ram)(QEMUFile *f,
hwaddr *gfns,
uint64_t gfn_num);
int (*savevm_state_downtime)(void);
int (*savevm_state_end)(QEMUFile *f);
int (*savevm_state_ram_cancel)(hwaddr gfn_end);
void (*savevm_state_cleanup)(void);
int (*loadvm_state_setup)(void);
int (*loadvm_state)(QEMUFile *f);
void (*loadvm_state_cleanup)(void);
} CgsMig;
bool cgs_mig_is_ready(void);
int cgs_mig_savevm_state_setup(QEMUFile *f);
int cgs_mig_savevm_state_start(QEMUFile *f);
long cgs_ram_save_start_epoch(QEMUFile *f);
long cgs_mig_savevm_state_ram(QEMUFile *f, RAMBlock *block, ram_addr_t offset,
hwaddr *gfns, uint64_t gfn_num);
int cgs_mig_savevm_state_downtime(QEMUFile *f);
int cgs_mig_savevm_state_end(QEMUFile *f);
int cgs_mig_savevm_state_ram_cancel(QEMUFile *f, hwaddr gfn_end);
void cgs_mig_savevm_state_cleanup(void);
int cgs_mig_loadvm_state_setup(QEMUFile *f);
int cgs_mig_loadvm_state(QEMUFile *f);
void cgs_mig_loadvm_state_cleanup(void);
void tdx_mig_init(CgsMig *cgs_mig, uint32_t nr_channels);
#endif