- fixed parameter name for save/restore of connected devices

- moved configuration subtree 'usb' back to the 'ports' list to make it
  accessible again by the config interface
- delete s.scsi_dev only if not NULL
This commit is contained in:
Volker Ruppert 2009-01-19 21:39:03 +00:00
parent d3533d9fcc
commit cfa759cd57
6 changed files with 30 additions and 29 deletions

View File

@ -1,4 +1,4 @@
$Id: PARAM_TREE.txt,v 1.20 2009-01-19 13:13:32 vruppert Exp $
$Id: PARAM_TREE.txt,v 1.21 2009-01-19 21:39:03 vruppert Exp $
Starting from Bochs 2.3 the parameters are organized in a tree structure
instead of a huge flat list. The parameter tree was required for implementing
@ -175,15 +175,15 @@ ports
outfile
2
(same options as ports.parallel.1)
usb
uhci
enabled
port1
port2
ohci
enabled
port1
port2
usb
uhci
enabled
port1
port2
ohci
enabled
port1
port2
network
ne2k

View File

@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////
// $Id: config.cc,v 1.151 2009-01-19 13:13:32 vruppert Exp $
// $Id: config.cc,v 1.152 2009-01-19 21:39:03 vruppert Exp $
/////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2002 MandrakeSoft S.A.
@ -1370,7 +1370,7 @@ void bx_init_options()
}
// usb subtree
bx_list_c *usb = new bx_list_c(root_param, "usb", "USB Configuration");
bx_list_c *usb = new bx_list_c(ports, "usb", "USB Configuration");
usb->get_options()->set(bx_list_c::SHOW_PARENT);
bx_param_string_c *port;
@ -3617,9 +3617,9 @@ int bx_write_configuration(const char *rc, int overwrite)
bx_write_serial_options(fp, base, i+1);
}
// usb
base = (bx_list_c*) SIM->get_param("usb.uhci");
base = (bx_list_c*) SIM->get_param("ports.usb.uhci");
bx_write_usb_options(fp, base);
base = (bx_list_c*) SIM->get_param("usb.ohci");
base = (bx_list_c*) SIM->get_param("ports.usb.ohci");
bx_write_usb_options(fp, base);
// pci
fprintf(fp, "i440fxsupport: enabled=%d",

View File

@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////
// $Id: siminterface.h,v 1.224 2009-01-19 13:13:32 vruppert Exp $
// $Id: siminterface.h,v 1.225 2009-01-19 21:39:03 vruppert Exp $
/////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2009 The Bochs Project
@ -229,12 +229,12 @@ typedef enum {
#define BXPN_ATA1_SLAVE "ata.1.slave"
#define BXPN_ATA2_SLAVE "ata.2.slave"
#define BXPN_ATA3_SLAVE "ata.3.slave"
#define BXPN_UHCI_ENABLED "usb.uhci.enabled"
#define BXPN_UHCI_PORT1 "usb.uhci.port1"
#define BXPN_UHCI_PORT2 "usb.uhci.port2"
#define BXPN_OHCI_ENABLED "usb.ohci.enabled"
#define BXPN_OHCI_PORT1 "usb.ohci.port1"
#define BXPN_OHCI_PORT2 "usb.ohci.port2"
#define BXPN_UHCI_ENABLED "ports.usb.uhci.enabled"
#define BXPN_UHCI_PORT1 "ports.usb.uhci.port1"
#define BXPN_UHCI_PORT2 "ports.usb.uhci.port2"
#define BXPN_OHCI_ENABLED "ports.usb.ohci.enabled"
#define BXPN_OHCI_PORT1 "ports.usb.ohci.port1"
#define BXPN_OHCI_PORT2 "ports.usb.ohci.port2"
#define BXPN_NE2K "network.ne2k"
#define BXPN_NE2K_ENABLED "network.ne2k.enabled"
#define BXPN_PNIC "network.pnic"

View File

@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////
// $Id: usb_msd.cc,v 1.11 2009-01-19 09:48:11 vruppert Exp $
// $Id: usb_msd.cc,v 1.12 2009-01-19 21:39:03 vruppert Exp $
/////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2009 Volker Ruppert
@ -142,7 +142,8 @@ usb_msd_device_c::usb_msd_device_c(void)
usb_msd_device_c::~usb_msd_device_c(void)
{
delete s.scsi_dev;
if (s.scsi_dev != NULL)
delete s.scsi_dev;
s.hdimage->close();
delete s.hdimage;
}

View File

@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////
// $Id: usb_ohci.cc,v 1.1 2009-01-19 17:18:57 vruppert Exp $
// $Id: usb_ohci.cc,v 1.2 2009-01-19 21:39:03 vruppert Exp $
/////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2009 Benjamin D Lunt (fys at frontiernet net)
@ -436,7 +436,7 @@ void bx_usb_ohci_c::init_device(Bit8u port, const char *devname)
BX_PANIC(("unknown USB device: %s", devname));
return;
}
sprintf(pname, "usb.ohci.port%d.device", port+1);
sprintf(pname, "usb_ohci.hub.port%d.device", port+1);
bx_list_c *devlist = (bx_list_c*)SIM->get_param(pname, SIM->get_bochs_root());
BX_OHCI_THIS hub.usb_port[port].device->register_state(devlist);
usb_set_connect_status(port, type, 1);
@ -1430,7 +1430,7 @@ void bx_usb_ohci_c::usb_set_connect_status(Bit8u port, int type, bx_bool connect
if (BX_OHCI_THIS hub.usb_port[port].device != NULL) {
delete BX_OHCI_THIS hub.usb_port[port].device;
BX_OHCI_THIS hub.usb_port[port].device = NULL;
sprintf(pname, "usb.ohci.port%d.device", port+1);
sprintf(pname, "usb_ohci.hub.port%d.device", port+1);
bx_list_c *devlist = (bx_list_c*)SIM->get_param(pname, SIM->get_bochs_root());
devlist->clear();
}

View File

@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////
// $Id: usb_uhci.cc,v 1.2 2009-01-19 13:13:32 vruppert Exp $
// $Id: usb_uhci.cc,v 1.3 2009-01-19 21:39:03 vruppert Exp $
/////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2009 Benjamin D Lunt (fys at frontiernet net)
@ -307,7 +307,7 @@ void bx_usb_uhci_c::init_device(Bit8u port, const char *devname)
BX_PANIC(("unknown USB device: %s", devname));
return;
}
sprintf(pname, "usb.uhci.port%d.device", port+1);
sprintf(pname, "usb_uhci.hub.port%d.device", port+1);
bx_list_c *devlist = (bx_list_c*)SIM->get_param(pname, SIM->get_bochs_root());
BX_UHCI_THIS hub.usb_port[port].device->register_state(devlist);
usb_set_connect_status(port, type, 1);
@ -1113,7 +1113,7 @@ void bx_usb_uhci_c::usb_set_connect_status(Bit8u port, int type, bx_bool connect
if (BX_UHCI_THIS hub.usb_port[port].device != NULL) {
delete BX_UHCI_THIS hub.usb_port[port].device;
BX_UHCI_THIS hub.usb_port[port].device = NULL;
sprintf(pname, "usb.uhci.port%d.device", port+1);
sprintf(pname, "usb_uhci.hub.port%d.device", port+1);
bx_list_c *devlist = (bx_list_c*)SIM->get_param(pname, SIM->get_bochs_root());
devlist->clear();
}