Present the bvm console device to the guest only when explicitly requested via
the "-b" command line option. Reviewed by: grehan Obtained from: NetApp
This commit is contained in:
parent
90415e0b4e
commit
e365fca6c8
@ -124,4 +124,17 @@ console_handler(struct vmctx *ctx, int vcpu, int in, int port, int bytes,
|
||||
|
||||
return (0);
|
||||
}
|
||||
INOUT_PORT(console, BVM_CONSOLE_PORT, IOPORT_F_INOUT, console_handler);
|
||||
|
||||
static struct inout_port consport = {
|
||||
"bvmcons",
|
||||
BVM_CONSOLE_PORT,
|
||||
IOPORT_F_INOUT,
|
||||
console_handler
|
||||
};
|
||||
|
||||
void
|
||||
init_bvmcons(void)
|
||||
{
|
||||
|
||||
register_inout(&consport);
|
||||
}
|
||||
|
@ -563,21 +563,25 @@ vm_loop(struct vmctx *ctx, int vcpu, uint64_t rip)
|
||||
int
|
||||
main(int argc, char *argv[])
|
||||
{
|
||||
int c, error, gdb_port, inject_bkpt, tmp, err, ioapic;
|
||||
int c, error, gdb_port, inject_bkpt, tmp, err, ioapic, bvmcons;
|
||||
struct vmctx *ctx;
|
||||
uint64_t rip;
|
||||
|
||||
bvmcons = 0;
|
||||
inject_bkpt = 0;
|
||||
progname = basename(argv[0]);
|
||||
gdb_port = DEFAULT_GDB_PORT;
|
||||
guest_ncpus = 1;
|
||||
ioapic = 0;
|
||||
|
||||
while ((c = getopt(argc, argv, "aehBHIPxp:g:c:z:s:S:n:m:M:")) != -1) {
|
||||
while ((c = getopt(argc, argv, "abehBHIPxp:g:c:z:s:S:n:m:M:")) != -1) {
|
||||
switch (c) {
|
||||
case 'a':
|
||||
disable_x2apic = 1;
|
||||
break;
|
||||
case 'b':
|
||||
bvmcons = 1;
|
||||
break;
|
||||
case 'B':
|
||||
inject_bkpt = 1;
|
||||
break;
|
||||
@ -707,6 +711,9 @@ main(int argc, char *argv[])
|
||||
if (gdb_port != 0)
|
||||
init_dbgport(gdb_port);
|
||||
|
||||
if (bvmcons)
|
||||
init_bvmcons();
|
||||
|
||||
error = vm_get_register(ctx, BSP, VM_REG_GUEST_RIP, &rip);
|
||||
assert(error == 0);
|
||||
|
||||
|
@ -62,4 +62,6 @@ int emulate_inout(struct vmctx *, int vcpu, int in, int port, int bytes,
|
||||
uint32_t *eax, int strict);
|
||||
int register_inout(struct inout_port *iop);
|
||||
|
||||
void init_bvmcons(void);
|
||||
|
||||
#endif /* _INOUT_H_ */
|
||||
|
Loading…
x
Reference in New Issue
Block a user