On 10/27/2014 06:06 AM, Paolo Bonzini wrote:


On 10/02/2014 12:55 AM, John Snow wrote:
+    /* If this is true, you're leaking memory. */

... or qsg is uninitialized, which would work because qemu_sglist_init
initializes all fields.

This is the only comment I have on the series. :)

Paolo

+    assert(qsg->sg == NULL);
+
      qsg->sg = g_malloc(alloc_hint * sizeof(ScatterGatherEntry));


@@ -1147,7 +1147,7 @@ static int ahci_dma_prepare_buf(IDEDMA *dma, int is_write)
      s->io_buffer_size = s->sg.size;

      DPRINTF(ad->port_no, "len=%#x\n", s->io_buffer_size);
-    return s->io_buffer_size != 0;
+    return s->io_buffer_size / 512 != 0;
  }

oh, yeah :\

I really did want to guard against re-initialization, but if it's expected that this structure may have completely anything in it at init time, I don't really have a way to do that, do I.

I guess I'll just delete the assertion, unless you have a very simple idea to help guard against double-inits.

--j

Reply via email to