|
@@ -14,6 +14,7 @@
|
|
*/
|
|
*/
|
|
|
|
|
|
#include "qemu/osdep.h"
|
|
#include "qemu/osdep.h"
|
|
|
|
+#include "qemu/sockets.h"
|
|
#include "monitor-internal.h"
|
|
#include "monitor-internal.h"
|
|
#include "monitor/qdev.h"
|
|
#include "monitor/qdev.h"
|
|
#include "monitor/qmp-helpers.h"
|
|
#include "monitor/qmp-helpers.h"
|
|
@@ -139,6 +140,12 @@ void qmp_add_client(const char *protocol, const char *fdname,
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ if (!fd_is_socket(fd)) {
|
|
|
|
+ error_setg(errp, "parameter @fdname must name a socket");
|
|
|
|
+ close(fd);
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+
|
|
for (i = 0; i < ARRAY_SIZE(protocol_table); i++) {
|
|
for (i = 0; i < ARRAY_SIZE(protocol_table); i++) {
|
|
if (!strcmp(protocol, protocol_table[i].name)) {
|
|
if (!strcmp(protocol, protocol_table[i].name)) {
|
|
if (!protocol_table[i].add_client(fd, has_skipauth, skipauth,
|
|
if (!protocol_table[i].add_client(fd, has_skipauth, skipauth,
|