aboutsummaryrefslogtreecommitdiff
path: root/monitor.c
diff options
context:
space:
mode:
authorAnthony Liguori <aliguori@us.ibm.com>2012-09-10 12:48:43 -0500
committerAnthony Liguori <aliguori@us.ibm.com>2012-09-10 12:48:43 -0500
commit14df77a609e39403c3ec814bae63bec0fb4d24d2 (patch)
treefaabedbfdaa0d8b467368f2be07d7d4eb929c247 /monitor.c
parent455aa1e0818653c41fd794435b982426ce21ba2f (diff)
parent1241ed94c331ddd8fc8297b02b4508ead59467de (diff)
Merge remote-tracking branch 'mst/tags/for_anthony' into staging
* mst/tags/for_anthony: vhost: Pass device path to vhost_dev_init() monitor: Rename+move net_handle_fd_param -> monitor_handle_fd_param pcie_aer: clear cmask for Advanced Error Interrupt Message Number pcie: drop version_id field for live migration qemu: add .exrc
Diffstat (limited to 'monitor.c')
-rw-r--r--monitor.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/monitor.c b/monitor.c
index 9be0140598..67064e2706 100644
--- a/monitor.c
+++ b/monitor.c
@@ -2407,6 +2407,24 @@ int monitor_fdset_dup_fd_remove(int dup_fd)
return monitor_fdset_dup_fd_find_remove(dup_fd, true);
}
+int monitor_handle_fd_param(Monitor *mon, const char *fdname)
+{
+ int fd;
+
+ if (!qemu_isdigit(fdname[0]) && mon) {
+
+ fd = monitor_get_fd(mon, fdname);
+ if (fd == -1) {
+ error_report("No file descriptor named %s found", fdname);
+ return -1;
+ }
+ } else {
+ fd = qemu_parse_fd(fdname);
+ }
+
+ return fd;
+}
+
/* mon_cmds and info_cmds would be sorted at runtime */
static mon_cmd_t mon_cmds[] = {
#include "hmp-commands.h"