#include <xen/sched.h>
#include <xen/lu.h>
+#include <public/migration_stream.h>
+
void lu_reserve_pages(struct lu_stream *stream)
{
}
struct domain *lu_restore_domains(struct lu_stream *stream)
{
+ struct mr_rhdr *hdr;
+
+ while ( (hdr = lu_next_record(stream)) && hdr->type != REC_TYPE_END )
+ {
+ if ( hdr->type == REC_TYPE_LU_VERSION &&
+ hdr->length == sizeof(struct mr_lu_version) )
+ {
+ const struct mr_lu_version *vers = LU_REC_DATA(hdr);
+
+ printk("Live update from Xen %d.%d\n",
+ vers->xen_major, vers->xen_minor);
+ }
+ }
+
panic("Implement me!\n");
}
#include <xen/lu.h>
#include <xen/kimage.h>
#include <xen/sched.h>
+#include <xen/version.h>
#include <public/migration_stream.h>
+int lu_save_version(struct lu_stream *stream)
+{
+ struct mr_lu_version ver_rec;
+
+ ver_rec.xen_major = xen_major_version();
+ ver_rec.xen_minor = xen_minor_version();
+ return lu_stream_append_record(stream, REC_TYPE_LU_VERSION,
+ &ver_rec, sizeof(ver_rec));
+}
+
+
int lu_save_domain(struct lu_stream *stream, struct domain *d)
{
return 0;
memset(&stream, 0, sizeof(stream));
+ rc = lu_save_version(&stream);
+
+ if ( rc )
+ goto err_notpaused;
+
/*
* Pause all the domains before saving the state.
*
rcu_read_unlock(&domlist_read_lock);
+err_notpaused:
lu_stream_free(&stream);
return rc;
#define REC_TYPE_CHECKPOINT 0x0000000eU
#define REC_TYPE_CHECKPOINT_DIRTY_PFN_LIST 0x0000000fU
+#define REC_TYPE_LU_VERSION 0x40000000U
+
#define REC_TYPE_OPTIONAL 0x80000000U
#define REC_TYPE_LIVE_UPDATE 0x40000000U
struct mr_hvm_params_entry param[0];
};
+/* LU_VERSION */
+struct mr_lu_version
+{
+ uint32_t xen_major;
+ uint32_t xen_minor;
+};
+
#endif /* __XEN_MIGRATION_STREAM_H__ */
/*