···2424#include "hw/xen/xen.h"
2525#include "sysemu/tcg.h"
2626#include "exec/ramlist.h"
2727-2828-struct RAMBlock {
2929- struct rcu_head rcu;
3030- struct MemoryRegion *mr;
3131- uint8_t *host;
3232- uint8_t *colo_cache; /* For colo, VM's ram cache */
3333- ram_addr_t offset;
3434- ram_addr_t used_length;
3535- ram_addr_t max_length;
3636- void (*resized)(const char*, uint64_t length, void *host);
3737- uint32_t flags;
3838- /* Protected by iothread lock. */
3939- char idstr[256];
4040- /* RCU-enabled, writes protected by the ramlist lock */
4141- QLIST_ENTRY(RAMBlock) next;
4242- QLIST_HEAD(, RAMBlockNotifier) ramblock_notifiers;
4343- int fd;
4444- size_t page_size;
4545- /* dirty bitmap used during migration */
4646- unsigned long *bmap;
4747- /* bitmap of already received pages in postcopy */
4848- unsigned long *receivedmap;
4949-5050- /*
5151- * bitmap to track already cleared dirty bitmap. When the bit is
5252- * set, it means the corresponding memory chunk needs a log-clear.
5353- * Set this up to non-NULL to enable the capability to postpone
5454- * and split clearing of dirty bitmap on the remote node (e.g.,
5555- * KVM). The bitmap will be set only when doing global sync.
5656- *
5757- * NOTE: this bitmap is different comparing to the other bitmaps
5858- * in that one bit can represent multiple guest pages (which is
5959- * decided by the `clear_bmap_shift' variable below). On
6060- * destination side, this should always be NULL, and the variable
6161- * `clear_bmap_shift' is meaningless.
6262- */
6363- unsigned long *clear_bmap;
6464- uint8_t clear_bmap_shift;
6565-};
2727+#include "exec/ramblock.h"
66286729/**
6830 * clear_bmap_size: calculate clear bitmap size
+64
include/exec/ramblock.h
···11+/*
22+ * Declarations for cpu physical memory functions
33+ *
44+ * Copyright 2011 Red Hat, Inc. and/or its affiliates
55+ *
66+ * Authors:
77+ * Avi Kivity <avi@redhat.com>
88+ *
99+ * This work is licensed under the terms of the GNU GPL, version 2 or
1010+ * later. See the COPYING file in the top-level directory.
1111+ *
1212+ */
1313+1414+/*
1515+ * This header is for use by exec.c and memory.c ONLY. Do not include it.
1616+ * The functions declared here will be removed soon.
1717+ */
1818+1919+#ifndef QEMU_EXEC_RAMBLOCK_H
2020+#define QEMU_EXEC_RAMBLOCK_H
2121+2222+#ifndef CONFIG_USER_ONLY
2323+#include "cpu-common.h"
2424+2525+struct RAMBlock {
2626+ struct rcu_head rcu;
2727+ struct MemoryRegion *mr;
2828+ uint8_t *host;
2929+ uint8_t *colo_cache; /* For colo, VM's ram cache */
3030+ ram_addr_t offset;
3131+ ram_addr_t used_length;
3232+ ram_addr_t max_length;
3333+ void (*resized)(const char*, uint64_t length, void *host);
3434+ uint32_t flags;
3535+ /* Protected by iothread lock. */
3636+ char idstr[256];
3737+ /* RCU-enabled, writes protected by the ramlist lock */
3838+ QLIST_ENTRY(RAMBlock) next;
3939+ QLIST_HEAD(, RAMBlockNotifier) ramblock_notifiers;
4040+ int fd;
4141+ size_t page_size;
4242+ /* dirty bitmap used during migration */
4343+ unsigned long *bmap;
4444+ /* bitmap of already received pages in postcopy */
4545+ unsigned long *receivedmap;
4646+4747+ /*
4848+ * bitmap to track already cleared dirty bitmap. When the bit is
4949+ * set, it means the corresponding memory chunk needs a log-clear.
5050+ * Set this up to non-NULL to enable the capability to postpone
5151+ * and split clearing of dirty bitmap on the remote node (e.g.,
5252+ * KVM). The bitmap will be set only when doing global sync.
5353+ *
5454+ * NOTE: this bitmap is different comparing to the other bitmaps
5555+ * in that one bit can represent multiple guest pages (which is
5656+ * decided by the `clear_bmap_shift' variable below). On
5757+ * destination side, this should always be NULL, and the variable
5858+ * `clear_bmap_shift' is meaningless.
5959+ */
6060+ unsigned long *clear_bmap;
6161+ uint8_t clear_bmap_shift;
6262+};
6363+#endif
6464+#endif