Message ID | 1348217255-22441-29-git-send-email-quintela@redhat.com |
---|---|
State | New |
Headers | show |
Il 21/09/2012 10:47, Juan Quintela ha scritto: > qemu_fseek() is known to be wrong. Would be removed on the next > commit. This code should never been used (value has been > MAC_TABLE_ENTRIES since 2009). > > Signed-off-by: Juan Quintela <quintela@redhat.com> > --- > hw/virtio-net.c | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) > > diff --git a/hw/virtio-net.c b/hw/virtio-net.c > index 6490743..e8c43af 100644 > --- a/hw/virtio-net.c > +++ b/hw/virtio-net.c > @@ -921,7 +921,9 @@ static int virtio_net_load(QEMUFile *f, void *opaque, int version_id) > qemu_get_buffer(f, n->mac_table.macs, > n->mac_table.in_use * ETH_ALEN); > } else if (n->mac_table.in_use) { > - qemu_fseek(f, n->mac_table.in_use * ETH_ALEN, SEEK_CUR); > + uint8_t *buf = g_malloc0(n->mac_table.in_use); > + qemu_get_buffer(f, buf, n->mac_table.in_use * ETH_ALEN); > + g_free(buf); > n->mac_table.multi_overflow = n->mac_table.uni_overflow = 1; > n->mac_table.in_use = 0; > } > Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
diff --git a/hw/virtio-net.c b/hw/virtio-net.c index 6490743..e8c43af 100644 --- a/hw/virtio-net.c +++ b/hw/virtio-net.c @@ -921,7 +921,9 @@ static int virtio_net_load(QEMUFile *f, void *opaque, int version_id) qemu_get_buffer(f, n->mac_table.macs, n->mac_table.in_use * ETH_ALEN); } else if (n->mac_table.in_use) { - qemu_fseek(f, n->mac_table.in_use * ETH_ALEN, SEEK_CUR); + uint8_t *buf = g_malloc0(n->mac_table.in_use); + qemu_get_buffer(f, buf, n->mac_table.in_use * ETH_ALEN); + g_free(buf); n->mac_table.multi_overflow = n->mac_table.uni_overflow = 1; n->mac_table.in_use = 0; }
qemu_fseek() is known to be wrong. Would be removed on the next commit. This code should never been used (value has been MAC_TABLE_ENTRIES since 2009). Signed-off-by: Juan Quintela <quintela@redhat.com> --- hw/virtio-net.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)