> > +static void handle_ovmf_log_range(GString *out,
> > +                                  dma_addr_t start,
> > +                                  dma_addr_t end,
> > +                                  Error **errp)
> > +{

> How about eliminating the intermediate buffer alloocation / printf by
> reading straight into the GString buf ? Something like
> 
>    size_t len = end - start;
>    g_string_set_size(out, out->len + len);
>    if (dma_memory_read(&address_space_memory, start,
>                        out->str + (out->len - len),
>                      len, MEMTXATTRS_UNSPECIFIED)) {
>        ...
>    }

There are two ranges in the wrap-around case, and I don't think I can
put multiple chunks into a single gstring.

take care,
  Gerd


Reply via email to