Merge remote-tracking branch 'remotes/ehabkost/tags/machine-next-pull-request' into staging

QOM boilerplate cleanup

Documentation build fix:
* memory: Remove kernel-doc comment marker (Eduardo Habkost)

QOM cleanups:
* Rename QOM macros for consistency between
  TYPE_* and type checking constants (Eduardo Habkost)

QOM new macros:
* OBJECT_DECLARE_* and OBJECT_DEFINE_* macros (Daniel P. Berrangé)
* DECLARE_*_CHECKER macros (Eduardo Habkost)

Automated QOM boilerplate changes:
* Automated changes to use DECLARE_*_CHECKER (Eduardo Habkost
* Automated changes to use OBJECT_DECLARE* (Eduardo Habkost)

# gpg: Signature made Thu 10 Sep 2020 19:17:49 BST
# gpg:                using RSA key 5A322FD5ABC4D3DBACCFD1AA2807936F984DC5A6
# gpg:                issuer "ehabkost@redhat.com"
# gpg: Good signature from "Eduardo Habkost <ehabkost@redhat.com>" [full]
# Primary key fingerprint: 5A32 2FD5 ABC4 D3DB ACCF  D1AA 2807 936F 984D C5A6

* remotes/ehabkost/tags/machine-next-pull-request: (33 commits)
  virtio-vga: Use typedef name for instance_size
  vhost-user-vga: Use typedef name for instance_size
  xilinx_axienet: Use typedef name for instance_size
  lpc_ich9: Use typedef name for instance_size
  omap_intc: Use typedef name for instance_size
  xilinx_axidma: Use typedef name for instance_size
  tusb6010: Rename TUSB to TUSB6010
  pc87312: Rename TYPE_PC87312_SUPERIO to TYPE_PC87312
  vfio: Rename PCI_VFIO to VFIO_PCI
  usb: Rename USB_SERIAL_DEV to USB_SERIAL
  sabre: Rename SABRE_DEVICE to SABRE
  rs6000_mc: Rename RS6000MC_DEVICE to RS6000MC
  filter-rewriter: Rename FILTER_COLO_REWRITER to FILTER_REWRITER
  esp: Rename ESP_STATE to ESP
  ahci: Rename ICH_AHCI to ICH9_AHCI
  vmgenid: Rename VMGENID_DEVICE to TYPE_VMGENID
  vfio: Rename VFIO_AP_DEVICE_TYPE to TYPE_VFIO_AP_DEVICE
  dev-smartcard-reader: Rename CCID_DEV_NAME to TYPE_USB_CCID_DEV
  ap-device: Rename AP_DEVICE_TYPE to TYPE_AP_DEVICE
  gpex: Fix type checking function name
  ...

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
This commit is contained in:
Peter Maydell
2020-09-11 19:26:51 +01:00
827 changed files with 7851 additions and 4406 deletions

View File

@ -23,21 +23,22 @@
#include "migration/colo.h"
#include "util.h"
#define FILTER_COLO_REWRITER(obj) \
OBJECT_CHECK(RewriterState, (obj), TYPE_FILTER_REWRITER)
#define TYPE_FILTER_REWRITER "filter-rewriter"
typedef struct RewriterState RewriterState;
DECLARE_INSTANCE_CHECKER(RewriterState, FILTER_REWRITER,
TYPE_FILTER_REWRITER)
#define FAILOVER_MODE_ON true
#define FAILOVER_MODE_OFF false
typedef struct RewriterState {
struct RewriterState {
NetFilterState parent_obj;
NetQueue *incoming_queue;
/* hashtable to save connection */
GHashTable *connection_track_table;
bool vnet_hdr;
bool failover_mode;
} RewriterState;
};
static void filter_rewriter_failover_mode(RewriterState *s)
{
@ -46,7 +47,7 @@ static void filter_rewriter_failover_mode(RewriterState *s)
static void filter_rewriter_flush(NetFilterState *nf)
{
RewriterState *s = FILTER_COLO_REWRITER(nf);
RewriterState *s = FILTER_REWRITER(nf);
if (!qemu_net_queue_flush(s->incoming_queue)) {
/* Unable to empty the queue, purge remaining packets */
@ -257,7 +258,7 @@ static ssize_t colo_rewriter_receive_iov(NetFilterState *nf,
int iovcnt,
NetPacketSent *sent_cb)
{
RewriterState *s = FILTER_COLO_REWRITER(nf);
RewriterState *s = FILTER_REWRITER(nf);
Connection *conn;
ConnectionKey key;
Packet *pkt;
@ -355,7 +356,7 @@ static gboolean offset_is_nonzero(gpointer key,
static void colo_rewriter_handle_event(NetFilterState *nf, int event,
Error **errp)
{
RewriterState *rs = FILTER_COLO_REWRITER(nf);
RewriterState *rs = FILTER_REWRITER(nf);
switch (event) {
case COLO_EVENT_CHECKPOINT:
@ -375,7 +376,7 @@ static void colo_rewriter_handle_event(NetFilterState *nf, int event,
static void colo_rewriter_cleanup(NetFilterState *nf)
{
RewriterState *s = FILTER_COLO_REWRITER(nf);
RewriterState *s = FILTER_REWRITER(nf);
/* flush packets */
if (s->incoming_queue) {
@ -386,7 +387,7 @@ static void colo_rewriter_cleanup(NetFilterState *nf)
static void colo_rewriter_setup(NetFilterState *nf, Error **errp)
{
RewriterState *s = FILTER_COLO_REWRITER(nf);
RewriterState *s = FILTER_REWRITER(nf);
s->connection_track_table = g_hash_table_new_full(connection_key_hash,
connection_key_equal,
@ -397,7 +398,7 @@ static void colo_rewriter_setup(NetFilterState *nf, Error **errp)
static bool filter_rewriter_get_vnet_hdr(Object *obj, Error **errp)
{
RewriterState *s = FILTER_COLO_REWRITER(obj);
RewriterState *s = FILTER_REWRITER(obj);
return s->vnet_hdr;
}
@ -406,14 +407,14 @@ static void filter_rewriter_set_vnet_hdr(Object *obj,
bool value,
Error **errp)
{
RewriterState *s = FILTER_COLO_REWRITER(obj);
RewriterState *s = FILTER_REWRITER(obj);
s->vnet_hdr = value;
}
static void filter_rewriter_init(Object *obj)
{
RewriterState *s = FILTER_COLO_REWRITER(obj);
RewriterState *s = FILTER_REWRITER(obj);
s->vnet_hdr = false;
s->failover_mode = FAILOVER_MODE_OFF;