View | Details | Raw Unified | Return to bug 232018 | Differences between
and this patch

Collapse All | Expand All

(-)usr.sbin/bhyve/Makefile (+6 lines)
Lines 73-78 SRCS+= vmm_instruction_emul.c Link Here
73
73
74
LIBADD=	vmmapi md pthread z util sbuf cam
74
LIBADD=	vmmapi md pthread z util sbuf cam
75
75
76
.if ${MK_INET_SUPPORT} != "no"
77
CFLAGS+=-DINET
78
.endif
79
.if ${MK_INET6_SUPPORT} != "no"
80
CFLAGS+=-DINET6
81
.endif
76
.if ${MK_OPENSSL} == "no"
82
.if ${MK_OPENSSL} == "no"
77
CFLAGS+=-DNO_OPENSSL
83
CFLAGS+=-DNO_OPENSSL
78
.else
84
.else
(-)usr.sbin/bhyve/bhyve.8 (-3 / +18 lines)
Lines 24-30 Link Here
24
.\"
24
.\"
25
.\" $FreeBSD$
25
.\" $FreeBSD$
26
.\"
26
.\"
27
.Dd Aug 23, 2018
27
.Dd October 20, 2018
28
.Dt BHYVE 8
28
.Dt BHYVE 8
29
.Os
29
.Os
30
.Sh NAME
30
.Sh NAME
Lines 369-375 Framebuffer devices: Link Here
369
.Bl -tag -width 10n
369
.Bl -tag -width 10n
370
.It Oo rfb= Ns Oo Ar IP: Oc Ns Ar port Oc Ns Oo ,w= Ns Ar width Oc Ns Oo ,h= Ns Ar height Oc Ns Oo ,vga= Ns Ar vgaconf Oc Ns Oo Ns ,wait Oc Ns Oo ,password= Ns Ar password Oc
370
.It Oo rfb= Ns Oo Ar IP: Oc Ns Ar port Oc Ns Oo ,w= Ns Ar width Oc Ns Oo ,h= Ns Ar height Oc Ns Oo ,vga= Ns Ar vgaconf Oc Ns Oo Ns ,wait Oc Ns Oo ,password= Ns Ar password Oc
371
.Bl -tag -width 8n
371
.Bl -tag -width 8n
372
.It Ar IP:port
372
.It Ar IPv4:port No or Ar [IPv6%zone]:port
373
An
373
An
374
.Ar IP
374
.Ar IP
375
address and a
375
address and a
Lines 376-382 address and a Link Here
376
.Ar port
376
.Ar port
377
VNC should listen on.
377
VNC should listen on.
378
The default is to listen on localhost IPv4 address and default VNC port 5900.
378
The default is to listen on localhost IPv4 address and default VNC port 5900.
379
Listening on an IPv6 address is not supported.
379
An IPv6 address must be enclosed in square brackets and may contain an
380
optional zone identifer.
380
.It Ar width No and Ar height
381
.It Ar width No and Ar height
381
A display resolution, width and height, respectively.
382
A display resolution, width and height, respectively.
382
If not specified, a default resolution of 1024x768 pixels will be used.
383
If not specified, a default resolution of 1024x768 pixels will be used.
Lines 587-592 bhyve -c 2 -m 4G -w -H \\ Link Here
587
  -l bootrom,/usr/local/share/uefi-firmware/BHYVE_UEFI.fd \\
588
  -l bootrom,/usr/local/share/uefi-firmware/BHYVE_UEFI.fd \\
588
   uefivm
589
   uefivm
589
.Ed
590
.Ed
591
.Pp
592
Run a UEFI virtual machine with a VNC display that is bound to all IPv6
593
addresses on port 5900.
594
.Bd -literal -offset indent
595
bhyve -c 2 -m 4G -w -H \\
596
  -s 0,hostbridge \\
597
  -s 4,ahci-hd,disk.img \\
598
  -s 5,virtio-net,tap0 \\
599
  -s 29,fbuf,tcp=[::]:5900,w=800,h=600 \\
600
  -s 30,xhci,tablet \\
601
  -s 31,lpc -l com1,stdio \\
602
  -l bootrom,/usr/local/share/uefi-firmware/BHYVE_UEFI.fd \\
603
   uefivm
604
.Ed
590
.Sh SEE ALSO
605
.Sh SEE ALSO
591
.Xr bhyve 4 ,
606
.Xr bhyve 4 ,
592
.Xr nmdm 4 ,
607
.Xr nmdm 4 ,
(-)usr.sbin/bhyve/pci_fbuf.c (-6 / +26 lines)
Lines 251-263 pci_fbuf_parse_opts(struct pci_fbuf_softc *sc, cha Link Here
251
		   xopts, config));
251
		   xopts, config));
252
252
253
		if (!strcmp(xopts, "tcp") || !strcmp(xopts, "rfb")) {
253
		if (!strcmp(xopts, "tcp") || !strcmp(xopts, "rfb")) {
254
			/* parse host-ip:port */
254
			/*
255
		        tmpstr = strsep(&config, ":");
255
			 * IPv4 -- host-ip:port
256
			if (!config)
256
			 * IPv6 -- [host-ip%zone]:port
257
				sc->rfb_port = atoi(tmpstr);
257
			 * XXX for now port is mandatory.
258
			else {
258
			 */
259
			tmpstr = strsep(&config, "]");
260
			if (config) {
261
				if (tmpstr[0] == '[')
262
					tmpstr++;
263
				sc->rfb_host = tmpstr;
264
				if (config[0] == ':')
265
					config++;
266
				else {
267
					pci_fbuf_usage(xopts);
268
					ret = -1;
269
					goto done;
270
				}
259
				sc->rfb_port = atoi(config);
271
				sc->rfb_port = atoi(config);
260
				sc->rfb_host = tmpstr;
272
			} else {
273
				config = tmpstr;
274
				tmpstr = strsep(&config, ":");
275
				if (!config)
276
					sc->rfb_port = atoi(tmpstr);
277
				else {
278
					sc->rfb_port = atoi(config);
279
					sc->rfb_host = tmpstr;
280
				}
261
			}
281
			}
262
	        } else if (!strcmp(xopts, "vga")) {
282
	        } else if (!strcmp(xopts, "vga")) {
263
			if (!strcmp(config, "off")) {
283
			if (!strcmp(config, "off")) {
(-)usr.sbin/bhyve/rfb.c (-11 / +30 lines)
Lines 42-47 __FBSDID("$FreeBSD$"); Link Here
42
#include <machine/cpufunc.h>
42
#include <machine/cpufunc.h>
43
#include <machine/specialreg.h>
43
#include <machine/specialreg.h>
44
#include <netinet/in.h>
44
#include <netinet/in.h>
45
#include <netdb.h>
45
46
46
#include <assert.h>
47
#include <assert.h>
47
#include <err.h>
48
#include <err.h>
Lines 960-967 sse42_supported(void) Link Here
960
int
961
int
961
rfb_init(char *hostname, int port, int wait, char *password)
962
rfb_init(char *hostname, int port, int wait, char *password)
962
{
963
{
964
	int e;
965
	char servname[6];
963
	struct rfb_softc *rc;
966
	struct rfb_softc *rc;
964
	struct sockaddr_in sin;
967
	struct addrinfo *ai;
968
	struct addrinfo hints;
965
	int on = 1;
969
	int on = 1;
966
#ifndef WITHOUT_CAPSICUM
970
#ifndef WITHOUT_CAPSICUM
967
	cap_rights_t rights;
971
	cap_rights_t rights;
Lines 978-1006 rfb_init(char *hostname, int port, int wait, char Link Here
978
982
979
	rc->password = password;
983
	rc->password = password;
980
984
981
	rc->sfd = socket(AF_INET, SOCK_STREAM, 0);
985
	snprintf(servname, sizeof(servname), "%d", port ? port : 5900);
986
987
	if (!hostname || strlen(hostname) == 0)
988
#if defined(INET)
989
		hostname = "127.0.0.1";
990
#elif defined(INET6)
991
		hostname = "[::1]";
992
#endif
993
994
	memset(&hints, 0, sizeof(hints));
995
	hints.ai_family = AF_UNSPEC;
996
	hints.ai_socktype = SOCK_STREAM;
997
	hints.ai_flags = AI_NUMERICHOST | AI_NUMERICSERV | AI_PASSIVE;
998
999
	if ((e = getaddrinfo(hostname, servname, &hints, &ai)) != 0) {
1000
		fprintf(stderr, "getaddrinfo: %s\n", gai_strerror(e));
1001
		return(-1);
1002
	}
1003
1004
	rc->sfd = socket(ai->ai_family, ai->ai_socktype, 0);
982
	if (rc->sfd < 0) {
1005
	if (rc->sfd < 0) {
983
		perror("socket");
1006
		perror("socket");
1007
		freeaddrinfo(ai);
984
		return (-1);
1008
		return (-1);
985
	}
1009
	}
986
1010
987
	setsockopt(rc->sfd, SOL_SOCKET, SO_REUSEADDR, &on, sizeof(on));
1011
	setsockopt(rc->sfd, SOL_SOCKET, SO_REUSEADDR, &on, sizeof(on));
988
1012
989
	sin.sin_len = sizeof(sin);
1013
	if (bind(rc->sfd, ai->ai_addr, ai->ai_addrlen) < 0) {
990
	sin.sin_family = AF_INET;
991
	sin.sin_port = port ? htons(port) : htons(5900);
992
	if (hostname && strlen(hostname) > 0)
993
		inet_pton(AF_INET, hostname, &(sin.sin_addr));
994
	else
995
		sin.sin_addr.s_addr = htonl(INADDR_LOOPBACK);
996
997
	if (bind(rc->sfd, (struct sockaddr *)&sin, sizeof(sin)) < 0) {
998
		perror("bind");
1014
		perror("bind");
1015
		freeaddrinfo(ai);
999
		return (-1);
1016
		return (-1);
1000
	}
1017
	}
1001
1018
1002
	if (listen(rc->sfd, 1) < 0) {
1019
	if (listen(rc->sfd, 1) < 0) {
1003
		perror("listen");
1020
		perror("listen");
1021
		freeaddrinfo(ai);
1004
		return (-1);
1022
		return (-1);
1005
	}
1023
	}
1006
1024
Lines 1028-1032 rfb_init(char *hostname, int port, int wait, char Link Here
1028
		pthread_mutex_unlock(&rc->mtx);
1046
		pthread_mutex_unlock(&rc->mtx);
1029
	}
1047
	}
1030
1048
1049
	freeaddrinfo(ai);
1031
	return (0);
1050
	return (0);
1032
}
1051
}

Return to bug 232018