Re: Add qemu_send_raw() to vlan.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Oct 15, 2009 at 08:04:45AM +0100, Mark McLoughlin wrote:
> Hi Gleb,
> 
> On Tue, 2009-05-26 at 13:03 +0300, Gleb Natapov wrote:
> > It gets packet without virtio header and adds it if needed.  Allows to
> > inject packets to vlan from outside. To send gracious arp for instance.
> ...
> > diff --git a/net.h b/net.h
> > index 931133b..3d0b6f2 100644
> > --- a/net.h
> > +++ b/net.h
> > ...
> > @@ -63,6 +64,7 @@ int qemu_can_send_packet(VLANClientState *vc);
> >  ssize_t qemu_sendv_packet(VLANClientState *vc, const struct iovec *iov,
> >                            int iovcnt);
> >  int qemu_send_packet(VLANClientState *vc, const uint8_t *buf, int size);
> > +void qemu_send_packet_raw(VLANClientState *vc, const uint8_t *buf, int size);
> >  void qemu_format_nic_info_str(VLANClientState *vc, uint8_t macaddr[6]);
> >  void qemu_check_nic_model(NICInfo *nd, const char *model);
> >  void qemu_check_nic_model_list(NICInfo *nd, const char * const *models,
> 
> I've only just now noticed that we never actually made announce_self()
> use this ... care to do that?
> 
Something like this:

---
Use qemu_send_packet_raw to send gracious arp. This will ensure that
vnet header is handled properly.

Signed-off-by: Gleb Natapov <gleb@xxxxxxxxxx>
diff --git a/savevm.c b/savevm.c
index 7a363b6..8ea2daf 100644
--- a/savevm.c
+++ b/savevm.c
@@ -132,7 +132,7 @@ static void qemu_announce_self_once(void *opaque)
         len = announce_self_create(buf, nd_table[i].macaddr);
         vlan = nd_table[i].vlan;
 	for(vc = vlan->first_client; vc != NULL; vc = vc->next) {
-            vc->receive(vc, buf, len);
+            qemu_send_packet_raw(vc, buf, len);
         }
     }
     if (count--) {
--
			Gleb.
--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux