public inbox for passt-dev@passt.top
 help / color / mirror / code / Atom feed
blob 5311f0e03b21c541a14806c2588ec8af47bcb8b0 1578 bytes (raw)

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
 
/* SPDX-License-Identifier: GPL-2.0-or-later
 * Copyright (c) 2025 Red Hat GmbH
 * Author: Stefano Brivio <sbrivio@redhat.com>
 */

#ifndef MIGRATE_H
#define MIGRATE_H

/**
 * struct migrate_header - Migration header from source
 * @magic:		0xB1BB1D1B0BB1D1B0, network order
 * @version:		Highest known, target aborts if too old, network order
 * @compat_version:	Lowest version compatible with @version, target aborts
 *			if too new, network order
 */
struct migrate_header {
	uint64_t magic;
	uint32_t version;
	uint32_t compat_version;
} __attribute__((packed));

/**
 * struct migrate_stage - Callbacks and parameters for one stage of migration
 * @name:	Stage name (for debugging)
 * @source:	Callback to implement this stage on the source
 * @target:	Callback to implement this stage on the target
 * @iov:	Optional data section to transfer
 */
struct migrate_stage {
	const char *name;
	int (*source)(struct ctx *c,
		      const struct migrate_stage *stage, int fd);
	int (*target)(struct ctx *c,
		      const struct migrate_stage *stage, int fd);

	/* FIXME: rollback callbacks? */

	struct iovec iov;
};

/**
 * struct migrate_version - Stages for a particular protocol version
 * @id:		Version number, host order
 * @s:		Ordered array of stages, NULL-terminated
 */
struct migrate_version {
	uint32_t id;
	const struct migrate_stage *s;
};

void migrate_init(struct ctx *c);
void migrate_close(struct ctx *c);
void migrate_request(struct ctx *c, int fd, bool target);
void migrate_handler(struct ctx *c);
void migrate_finish(struct ctx *c);

#endif /* MIGRATE_H */

debug log:

solving 5311f0e ...
found 5311f0e in https://archives.passt.top/passt-dev/20250205230919.205302-5-sbrivio@redhat.com/ ||
	https://archives.passt.top/passt-dev/20250205230314.203396-5-sbrivio@redhat.com/ ||
	https://archives.passt.top/passt-dev/20250205115516.843610-5-david@gibson.dropbear.id.au/ ||
	https://archives.passt.top/passt-dev/20250207010724.3121569-7-sbrivio@redhat.com/ ||
	https://archives.passt.top/passt-dev/20250206054951.1041610-8-david@gibson.dropbear.id.au/
found a586112 in https://archives.passt.top/passt-dev/20250207010724.3121569-2-sbrivio@redhat.com/ ||
	https://archives.passt.top/passt-dev/20250206054951.1041610-3-david@gibson.dropbear.id.au/ ||
	https://archives.passt.top/passt-dev/20250205230919.205302-2-sbrivio@redhat.com/ ||
	https://archives.passt.top/passt-dev/20250205230314.203396-2-sbrivio@redhat.com/ ||
	https://archives.passt.top/passt-dev/20250205115516.843610-2-david@gibson.dropbear.id.au/

applying [1/2] https://archives.passt.top/passt-dev/20250207010724.3121569-2-sbrivio@redhat.com/
diff --git a/migrate.h b/migrate.h
new file mode 100644
index 0000000..a586112

Checking patch migrate.h...
Applied patch migrate.h cleanly.

skipping https://archives.passt.top/passt-dev/20250206054951.1041610-3-david@gibson.dropbear.id.au/ for a586112
skipping https://archives.passt.top/passt-dev/20250205230919.205302-2-sbrivio@redhat.com/ for a586112
skipping https://archives.passt.top/passt-dev/20250205230314.203396-2-sbrivio@redhat.com/ for a586112
skipping https://archives.passt.top/passt-dev/20250205115516.843610-2-david@gibson.dropbear.id.au/ for a586112
index at:
100644 a5861120def857428dd6449c9f6f4271a46a1dbc	migrate.h

applying [2/2] https://archives.passt.top/passt-dev/20250205230919.205302-5-sbrivio@redhat.com/
diff --git a/migrate.h b/migrate.h
index a586112..5311f0e 100644

Checking patch migrate.h...
Applied patch migrate.h cleanly.

skipping https://archives.passt.top/passt-dev/20250205230314.203396-5-sbrivio@redhat.com/ for 5311f0e
skipping https://archives.passt.top/passt-dev/20250205115516.843610-5-david@gibson.dropbear.id.au/ for 5311f0e
skipping https://archives.passt.top/passt-dev/20250207010724.3121569-7-sbrivio@redhat.com/ for 5311f0e
skipping https://archives.passt.top/passt-dev/20250206054951.1041610-8-david@gibson.dropbear.id.au/ for 5311f0e
index at:
100644 5311f0e03b21c541a14806c2588ec8af47bcb8b0	migrate.h

Code repositories for project(s) associated with this public inbox

	https://passt.top/passt

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for IMAP folder(s).