static void ahci_migrate(AHCIQState *from, AHCIQState *to, const char *uri)

{

    QOSState *tmp = to->parent;

    QPCIDevice *dev = to->dev;

    char *uri_local = NULL;



    if (uri == NULL) {

        uri_local = g_strdup_printf("%s%s", "unix:", mig_socket);

        uri = uri_local;

    }



    /* context will be 'to' after completion. */

    migrate(from->parent, to->parent, uri);



    /* We'd like for the AHCIState objects to still point

     * to information specific to its specific parent

     * instance, but otherwise just inherit the new data. */

    memcpy(to, from, sizeof(AHCIQState));

    to->parent = tmp;

    to->dev = dev;



    tmp = from->parent;

    dev = from->dev;

    memset(from, 0x00, sizeof(AHCIQState));

    from->parent = tmp;

    from->dev = dev;



    verify_state(to);

    g_free(uri_local);

}

static void ahci_migrate(AHCIQState *from, AHCIQState *to, const char *uri)

{

    QOSState *tmp = to->parent;

    QPCIDevice *dev = to->dev;

    char *uri_local = NULL;



    if (uri == NULL) {

        uri_local = g_strdup_printf("%s%s", "unix:", mig_socket);

        uri = uri_local;

    }



    

    migrate(from->parent, to->parent, uri);



    





    memcpy(to, from, sizeof(AHCIQState));

    to->parent = tmp;

    to->dev = dev;



    tmp = from->parent;

    dev = from->dev;

    memset(from, 0x00, sizeof(AHCIQState));

    from->parent = tmp;

    from->dev = dev;



    verify_state(to);

    g_free(uri_local);

}

    verify_state(to);
static void FUNC_0(AHCIQState *VAR_0, AHCIQState *VAR_1, const char *VAR_2)

{

    QOSState *tmp = VAR_1->parent;

    QPCIDevice *dev = VAR_1->dev;

    char *VAR_3 = NULL;



    if (VAR_2 == NULL) {

        VAR_3 = g_strdup_printf("%s%s", "unix:", mig_socket);

        VAR_2 = VAR_3;

    }



    

    migrate(VAR_0->parent, VAR_1->parent, VAR_2);



    





    memcpy(VAR_1, VAR_0, sizeof(AHCIQState));

    VAR_1->parent = tmp;

    VAR_1->dev = dev;



    tmp = VAR_0->parent;

    dev = VAR_0->dev;

    memset(VAR_0, 0x00, sizeof(AHCIQState));

    VAR_0->parent = tmp;

    VAR_0->dev = dev;



    verify_state(VAR_1);

    g_free(VAR_3);

}

static void FUNC_0(AHCIQState *VAR_0, AHCIQState *VAR_1, const char *VAR_2)
{ QOSState *tmp = VAR_1->parent; QPCIDevice *dev = VAR_1->dev; char *VAR_3 = NULL; if (VAR_2 == NULL) { VAR_3 = g_strdup_printf("%s%s", "unix:", mig_socket); VAR_2 = VAR_3; } migrate(VAR_0->parent, VAR_1->parent, VAR_2); memcpy(VAR_1, VAR_0, sizeof(AHCIQState)); VAR_1->parent = tmp; VAR_1->dev = dev; tmp = VAR_0->parent; dev = VAR_0->dev; memset(VAR_0, 0x00, sizeof(AHCIQState)); VAR_0->parent = tmp; VAR_0->dev = dev; verify_state(VAR_1); g_free(VAR_3); }