static int vhost_client_migration_log(CPUPhysMemoryClient *client,

                                      int enable)

{

    struct vhost_dev *dev = container_of(client, struct vhost_dev, client);

    int r;

    if (!!enable == dev->log_enabled) {

        return 0;

    }

    if (!dev->started) {

        dev->log_enabled = enable;

        return 0;

    }

    if (!enable) {

        r = vhost_dev_set_log(dev, false);

        if (r < 0) {

            return r;

        }

        if (dev->log) {

            g_free(dev->log);

        }

        dev->log = NULL;

        dev->log_size = 0;

    } else {

        vhost_dev_log_resize(dev, vhost_get_log_size(dev));

        r = vhost_dev_set_log(dev, true);

        if (r < 0) {

            return r;

        }

    }

    dev->log_enabled = enable;

    return 0;

}

static int vhost_client_migration_log(CPUPhysMemoryClient *client,

                                      int enable)

{

    struct vhost_dev *dev = container_of(client, struct vhost_dev, client);

    int r;

    if (!!enable == dev->log_enabled) {

        return 0;

    }

    if (!dev->started) {

        dev->log_enabled = enable;

        return 0;

    }

    if (!enable) {

        r = vhost_dev_set_log(dev, false);

        if (r < 0) {

            return r;

        }

        if (dev->log) {

            g_free(dev->log);

        }

        dev->log = NULL;

        dev->log_size = 0;

    } else {

        vhost_dev_log_resize(dev, vhost_get_log_size(dev));

        r = vhost_dev_set_log(dev, true);

        if (r < 0) {

            return r;

        }

    }

    dev->log_enabled = enable;

    return 0;

}

    struct vhost_dev *dev = container_of(client, struct vhost_dev, client);     struct vhost_dev *dev = container_of(client, struct vhost_dev, client); static int vhost_client_migration_log(CPUPhysMemoryClient *client,                                       int enable)     struct vhost_dev *dev = container_of(client, struct vhost_dev, client);
static int FUNC_0(CPUPhysMemoryClient *VAR_0,

                                      int VAR_1)

{

    struct vhost_dev *VAR_2 = container_of(VAR_0, struct vhost_dev, VAR_0);

    int VAR_3;

    if (!!VAR_1 == VAR_2->log_enabled) {

        return 0;

    }

    if (!VAR_2->started) {

        VAR_2->log_enabled = VAR_1;

        return 0;

    }

    if (!VAR_1) {

        VAR_3 = vhost_dev_set_log(VAR_2, false);

        if (VAR_3 < 0) {

            return VAR_3;

        }

        if (VAR_2->log) {

            g_free(VAR_2->log);

        }

        VAR_2->log = NULL;

        VAR_2->log_size = 0;

    } else {

        vhost_dev_log_resize(VAR_2, vhost_get_log_size(VAR_2));

        VAR_3 = vhost_dev_set_log(VAR_2, true);

        if (VAR_3 < 0) {

            return VAR_3;

        }

    }

    VAR_2->log_enabled = VAR_1;

    return 0;

}

static int FUNC_0(CPUPhysMemoryClient *VAR_0,
int VAR_1)
{ struct vhost_dev *VAR_2 = container_of(VAR_0, struct vhost_dev, VAR_0); int VAR_3; if (!!VAR_1 == VAR_2->log_enabled) { return 0; } if (!VAR_2->started) { VAR_2->log_enabled = VAR_1; return 0; } if (!VAR_1) { VAR_3 = vhost_dev_set_log(VAR_2, false); if (VAR_3 < 0) { return VAR_3; } if (VAR_2->log) { g_free(VAR_2->log); } VAR_2->log = NULL; VAR_2->log_size = 0; } else { vhost_dev_log_resize(VAR_2, vhost_get_log_size(VAR_2)); VAR_3 = vhost_dev_set_log(VAR_2, true); if (VAR_3 < 0) { return VAR_3; } } VAR_2->log_enabled = VAR_1; return 0; }