[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 2/4] Allow devices be notified of link status change
From: |
Mark McLoughlin |
Subject: |
[Qemu-devel] [PATCH 2/4] Allow devices be notified of link status change |
Date: |
Thu, 8 Jan 2009 18:37:48 +0000 |
Signed-off-by: Mark McLoughlin <address@hidden>
---
net.c | 3 +++
net.h | 3 +++
2 files changed, 6 insertions(+), 0 deletions(-)
diff --git a/net.c b/net.c
index eef0564..0a182b2 100644
--- a/net.c
+++ b/net.c
@@ -1743,6 +1743,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",
up_or_down);
+ if (vc->link_status_changed)
+ vc->link_status_changed(vc);
+
return 1;
}
diff --git a/net.h b/net.h
index 3c0dab9..291807a 100644
--- a/net.h
+++ b/net.h
@@ -9,12 +9,15 @@ typedef ssize_t (IOReadvHandler)(void *, const struct iovec
*, int);
typedef struct VLANClientState VLANClientState;
+typedef void (LinkStatusChanged)(VLANClientState *);
+
struct VLANClientState {
IOReadHandler *fd_read;
IOReadvHandler *fd_readv;
/* Packets may still be sent if this returns zero. It's used to
rate-limit the slirp code. */
IOCanRWHandler *fd_can_read;
+ LinkStatusChanged *link_status_changed;
int link_down;
void *opaque;
struct VLANClientState *next;
--
1.6.0.6