Move filedescriptor parsing code from net.c into qemu_parse_fd()

Move the parsing of a filedescriptor into a common function
qemu_parse_fd() so others can use it as well. Have net.c call this
function.

v2:
 - moving qemu_parse_fd into cutils.c

Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
This commit is contained in:
Stefan Berger 2011-09-28 06:41:32 -04:00 committed by Anthony Liguori
parent f809c0d66b
commit 443916d1d9
3 changed files with 14 additions and 6 deletions

7
net.c
View file

@ -733,12 +733,7 @@ int net_handle_fd_param(Monitor *mon, const char *param)
return -1;
}
} else {
char *endptr = NULL;
fd = strtol(param, &endptr, 10);
if (*endptr || (fd == 0 && param == endptr)) {
return -1;
}
fd = qemu_parse_fd(param);
}
return fd;