提交 34b25ca7 编写于 作者: A aliguori

Allow devices be notified of link status change (Mark McLoughlin)

Signed-off-by: NMark McLoughlin <markmc@redhat.com>
Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>



git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6248 c046a42c-6fe2-441c-8c8c-71466251a162
上级 436e5e53
...@@ -1718,6 +1718,9 @@ int do_set_link(const char *name, const char *up_or_down) ...@@ -1718,6 +1718,9 @@ int do_set_link(const char *name, const char *up_or_down)
term_printf("invalid link status '%s'; only 'up' or 'down' valid\n", term_printf("invalid link status '%s'; only 'up' or 'down' valid\n",
up_or_down); up_or_down);
if (vc->link_status_changed)
vc->link_status_changed(vc);
return 1; return 1;
} }
......
...@@ -9,12 +9,15 @@ typedef ssize_t (IOReadvHandler)(void *, const struct iovec *, int); ...@@ -9,12 +9,15 @@ typedef ssize_t (IOReadvHandler)(void *, const struct iovec *, int);
typedef struct VLANClientState VLANClientState; typedef struct VLANClientState VLANClientState;
typedef void (LinkStatusChanged)(VLANClientState *);
struct VLANClientState { struct VLANClientState {
IOReadHandler *fd_read; IOReadHandler *fd_read;
IOReadvHandler *fd_readv; IOReadvHandler *fd_readv;
/* Packets may still be sent if this returns zero. It's used to /* Packets may still be sent if this returns zero. It's used to
rate-limit the slirp code. */ rate-limit the slirp code. */
IOCanRWHandler *fd_can_read; IOCanRWHandler *fd_can_read;
LinkStatusChanged *link_status_changed;
int link_down; int link_down;
void *opaque; void *opaque;
struct VLANClientState *next; struct VLANClientState *next;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册