qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Michael S. Tsirkin" <mst@redhat.com>
To: "Zhanghaoyu (A)" <haoyu.zhang@huawei.com>
Cc: "chenliang (T)" <chenliang88@huawei.com>,
	"Huangweidong (C)" <weidong.huang@huawei.com>,
	Gleb Natapov <gleb@redhat.com>,
	"paolo.bonzini@gmail.com" <paolo.bonzini@gmail.com>,
	Jason Wang <jasowang@redhat.com>,
	Luonengjun <luonengjun@huawei.com>,
	qemu-devel <qemu-devel@nongnu.org>, Xiahai <xiahai@huawei.com>
Subject: Re: [Qemu-devel] [RFC] sync NIC's MAC maintained in NICConf as soon as emualted NIC's MAC changed in guest
Date: Wed, 25 Sep 2013 12:31:27 +0300	[thread overview]
Message-ID: <20130925093127.GB6320@redhat.com> (raw)
In-Reply-To: <D3E216785288A145B7BC975F83A2ED1043EDFCAE@szxeml556-mbx.china.huawei.com>

On Wed, Sep 25, 2013 at 09:02:54AM +0000, Zhanghaoyu (A) wrote:
> >> Hi, all
> >> 
> >> Do live migration if emulated NIC's MAC has been changed, RARP with 
> >> wrong MAC address will broadcast via qemu_announce_self in destination, so, long time network disconnection probably happen.
> >
> >Good catch.
> >
> >> I want to do below works to resolve this problem, 1. change NICConf's 
> >> MAC as soon as emulated NIC's MAC changed in guest
> >
> >This will make it impossible to revert it correctly on reset, won't it?
> >
> You are right.
> virsh reboot <domain>, or virsh reset <domain>, or reboot VM from guest, will revert emulated NIC's MAC to original one maintained in NICConf.
> During the reboot/reset flow in qemu, emulated NIC's reset handler will sync the MAC address in NICConf to the MAC address in emulated NIC structure,
> e.g., virtio_net_reset sync the MAC address in NICConf to VirtIONet'mac.
> 
> BTW, in native scenario, reboot will revert the changed MAC to original one, too.
> 
> >> 2. sync NIC's (more precisely, queue) MAC to corresponding NICConf in 
> >> NIC's migration load handler
> >> 
> >> Any better ideas?
> >> 
> >> Thanks,
> >> Zhang Haoyu
> >
> >I think announce needs to poke at the current MAC instead of the default one in NICConf.
> >We can make it respect link down state while we are at it.
> >
> NICConf structures are incorporated in different emulated NIC's structure, e.g., VirtIONet, E1000State_st, RTL8139State, etc.,
> since so many kinds of emulated NICs, they are described by different structures, how to find all NICs' current MAC?
> 
> Maybe we can introduce a pointer member 'current_mac' to NICConf structure, which points to the current MAC,
> then we can find all current MACs from NICConf.current_mac.

I wouldn't make it a pointer, just a buffer with the mac, copy it there.
Maybe call it "softmac" that's what it is really.

> Can we broadcast the RARP with current MAC in NIC's migration load handler respectively?
> 
> Thanks,
> Zhang Haoyu

It's not so simple, you need to retry several times.

> >Happily recent linux guests aren't affected since they do announcements from guest.
> >
> >--
> >MST

  reply	other threads:[~2013-09-25  9:29 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-09-22  8:35 [Qemu-devel] [RFC] sync NIC's MAC maintained in NICConf as soon as emualted NIC's MAC changed in guest Zhanghaoyu (A)
2013-09-22  8:59 ` Michael S. Tsirkin
2013-09-25  9:02   ` Zhanghaoyu (A)
2013-09-25  9:31     ` Michael S. Tsirkin [this message]
2013-09-25  9:55       ` Zhanghaoyu (A)
2013-09-25 10:06         ` Michael S. Tsirkin
2013-09-25 10:14           ` Zhanghaoyu (A)
2013-09-25 10:53             ` Michael S. Tsirkin
2013-09-25 11:39               ` Markus Armbruster
2013-09-25 12:21                 ` Michael S. Tsirkin
2013-09-26  1:27                   ` Zhanghaoyu (A)
2013-09-26  7:18                   ` Markus Armbruster
2013-09-26  3:24 ` Jason Wang
2013-09-26  3:42   ` Zhanghaoyu (A)
2013-09-26  4:28     ` Jason Wang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20130925093127.GB6320@redhat.com \
    --to=mst@redhat.com \
    --cc=chenliang88@huawei.com \
    --cc=gleb@redhat.com \
    --cc=haoyu.zhang@huawei.com \
    --cc=jasowang@redhat.com \
    --cc=luonengjun@huawei.com \
    --cc=paolo.bonzini@gmail.com \
    --cc=qemu-devel@nongnu.org \
    --cc=weidong.huang@huawei.com \
    --cc=xiahai@huawei.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).