Hi,

> I think it would be better if the HwOps calls all took a QemuConsole 
> instead of the opaque structure. The hw implementations can dig their 
> opaque structure out from there.

QemuConsole is private to ui/console.c though (and I prefer to keep it
this way).  So we need either a helper function to query con->hw or we
keep the opaque and pass QemuConsole as additional parameter.

When going this route.

Alternative approach:

struct my_gfx_card_state {
    PCIDevice pci;
    [ ... ]
    struct my_head_state {
        QemuConsole *con;
        [ ... ]
    } heads[MAX_HEADS];
}

Then instead of

   graphic_console_init(..., &state);

call

   graphic_console_init(..., &state->heads[i]);

so you can figure the head in the callbacks.

cheers,
  Gerd



Reply via email to