[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 3/4] Allow devices be notified of link status change
From: |
Mark McLoughlin |
Subject: |
[Qemu-devel] [PATCH 3/4] Allow devices be notified of link status change |
Date: |
Tue, 9 Dec 2008 10:55:42 +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 35ec501..883544f 100644
--- a/net.c
+++ b/net.c
@@ -1597,6 +1597,9 @@ int do_set_link(int vlan_id, int device_idx, 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 e7cd062..75b22c1 100644
--- a/net.h
+++ b/net.h
@@ -5,11 +5,14 @@
typedef struct VLANClientState VLANClientState;
+typedef void (LinkStatusChanged)(VLANClientState *);
+
struct VLANClientState {
IOReadHandler *fd_read;
/* 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.5.4.3
- [Qemu-devel] [PATCH 0/4] Add nic link up/down emulation to e1000, Mark McLoughlin, 2008/12/09
- [Qemu-devel] [PATCH 1/4] Add 'set_link' monitor command, Mark McLoughlin, 2008/12/09
- [Qemu-devel] Re: [PATCH 1/4] Add 'set_link' monitor command, Anthony Liguori, 2008/12/09
- [Qemu-devel] Re: [PATCH 1/4] Add 'set_link' monitor command, Mark McLoughlin, 2008/12/12
- [Qemu-devel] [PATCH 1/5] Add a model string to VLANClientState, Mark McLoughlin, 2008/12/12
- [Qemu-devel] [PATCH 2/5] Assign a name to each VLAN client, Mark McLoughlin, 2008/12/12
- [Qemu-devel] [PATCH 3/5] Fixup info_str formatting, Mark McLoughlin, 2008/12/12
- [Qemu-devel] [PATCH 4/5] Add qemu_format_nic_info_str(), Mark McLoughlin, 2008/12/12
- [Qemu-devel] [PATCH 5/5] Add a -net name=foo parameter, Mark McLoughlin, 2008/12/12
- Re: [Qemu-devel] [PATCH 5/5] Add a -net name=foo parameter, Aurelien Jarno, 2008/12/14