mirror of https://github.com/xemu-project/xemu.git
Merge remote-tracking branch 'stefanha/net' into staging
# By Amos Kong (1) and Jason Wang (1) # Via Stefan Hajnoczi * stefanha/net: tap: properly initialize vhostfds net: make network client name unique Message-id: 1367582254-15060-1-git-send-email-stefanha@redhat.com Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
This commit is contained in:
commit
a612925b41
|
@ -157,8 +157,7 @@ void qemu_macaddr_default_if_unset(MACAddr *macaddr)
|
||||||
/**
|
/**
|
||||||
* Generate a name for net client
|
* Generate a name for net client
|
||||||
*
|
*
|
||||||
* Only net clients created with the legacy -net option need this. Naming is
|
* Only net clients created with the legacy -net option and NICs need this.
|
||||||
* mandatory for net clients created with -netdev.
|
|
||||||
*/
|
*/
|
||||||
static char *assign_name(NetClientState *nc1, const char *model)
|
static char *assign_name(NetClientState *nc1, const char *model)
|
||||||
{
|
{
|
||||||
|
@ -170,9 +169,7 @@ static char *assign_name(NetClientState *nc1, const char *model)
|
||||||
if (nc == nc1) {
|
if (nc == nc1) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
/* For compatibility only bump id for net clients on a vlan */
|
if (strcmp(nc->model, model) == 0) {
|
||||||
if (strcmp(nc->model, model) == 0 &&
|
|
||||||
net_hub_id_for_client(nc, NULL) == 0) {
|
|
||||||
id++;
|
id++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -623,7 +623,7 @@ static int net_init_tap_one(const NetdevTapOptions *tap, NetClientState *peer,
|
||||||
vhostfdname || (tap->has_vhostforce && tap->vhostforce)) {
|
vhostfdname || (tap->has_vhostforce && tap->vhostforce)) {
|
||||||
int vhostfd;
|
int vhostfd;
|
||||||
|
|
||||||
if (tap->has_vhostfd) {
|
if (tap->has_vhostfd || tap->has_vhostfds) {
|
||||||
vhostfd = monitor_handle_fd_param(cur_mon, vhostfdname);
|
vhostfd = monitor_handle_fd_param(cur_mon, vhostfdname);
|
||||||
if (vhostfd == -1) {
|
if (vhostfd == -1) {
|
||||||
return -1;
|
return -1;
|
||||||
|
|
Loading…
Reference in New Issue