qdev: Replace device names containing whitespace
PATCH 1/1 qdev: Replace device names containing whitespace
Device names with whitespace require quoting in the shell and in the monitor. Some of the offenders are also overly long. Some have a more convenient alias, some don't.
The place for verbose device names is DeviceInfo member desc. The name should be short & sweet.
---
I'm prepared to respin this patch with any device name changes found objectionable dropped.
I hate the inconsistent use of '-' and '_' in device names, too, but not enough to patch it in time for 0.12.
hw/bt-hid.c | 2 +- hw/cirrus_vga.c | 5 +++-- hw/grackle_pci.c | 4 ++-- hw/ide/cmd646.c | 4 ++-- hw/ide/piix.c | 8 ++++---- hw/unin_pci.c | 30 +++++++++++++++--------------- hw/usb-bt.c | 4 ++-- hw/usb-bus.c | 2 +- hw/usb-hid.c | 9 +++------ hw/usb-hub.c | 2 +- hw/usb-msd.c | 5 ++--- hw/usb-net.c | 4 ++-- hw/usb-ohci.c | 5 ++--- hw/usb-serial.c | 10 ++++------ hw/usb-uhci.c | 8 ++++---- hw/usb-wacom.c | 4 ++-- hw/vmware_vga.c | 4 ++-- usb-bsd.c | 4 ++-- usb-linux.c | 5 ++--- 19 files changed, 56 insertions(+), 63 deletions(-)
hw/bt-hid.c +1 -1
@@ -566,6 +566,6 @@ static struct bt_device_s *bt_hid_init(struct bt_scatternet_s *net,struct bt_device_s *bt_keyboard_init (struct bt_scatternet_s *net) { -USBDevice *dev =usb_create_simple (NULL /* FIXME */ ,"QEMU USB Keyboard" ); +USBDevice *dev =usb_create_simple (NULL /* FIXME */ ,"usb-kbd" );return bt_hid_init (net, dev, class_keyboard); }
hw/cirrus_vga.c +3 -2
@@ -3217,11 +3217,12 @@ static int pci_cirrus_vga_initfn(PCIDevice *dev)void pci_cirrus_vga_init (PCIBus *bus) { -pci_create_simple (bus,-1 ,"Cirrus VGA" ); +pci_create_simple (bus,-1 ,"cirrus-vga" ); }static PCIDeviceInfo cirrus_vga_info = { - .qdev.name ="Cirrus VGA" , + .qdev.name ="cirrus-vga" , + .qdev.desc ="Cirrus CLGD 54xx VGA" , .qdev.size =sizeof (PCICirrusVGAState), .qdev.vmsd = &vmstate_pci_cirrus_vga, .init = pci_cirrus_vga_initfn,
hw/grackle_pci.c +2 -2
@@ -178,7 +178,7 @@ static PCIDeviceInfo grackle_pci_host_info = { };static PCIDeviceInfo dec_21154_pci_host_info = { - .qdev.name ="DEC 21154" , + .qdev.name ="DEC-21154" , .qdev.size =sizeof (PCIDevice), .init = dec_21154_pci_host_init, };
@@ -188,7 +188,7 @@ static void grackle_register_devices(void)sysbus_register_dev ("grackle" ,sizeof (GrackleState), pci_grackle_init_device);pci_qdev_register (&grackle_pci_host_info); -sysbus_register_dev ("DEC 21154" ,sizeof (GrackleState), +sysbus_register_dev ("DEC-21154" ,sizeof (GrackleState), pci_dec_21154_init_device);pci_qdev_register (&dec_21154_pci_host_info); }
hw/ide/cmd646.c +2 -2
@@ -245,7 +245,7 @@ void pci_cmd646_ide_init(PCIBus *bus, DriveInfo **hd_table, {PCIDevice *dev; - dev =pci_create (bus,-1 ,"CMD646 IDE" ); + dev =pci_create (bus,-1 ,"cmd646-ide" );qdev_prop_set_uint32 (&dev->qdev,"secondary" , secondary_ide_enabled);qdev_init_nofail (&dev->qdev);
@@ -254,7 +254,7 @@ void pci_cmd646_ide_init(PCIBus *bus, DriveInfo **hd_table,static PCIDeviceInfo cmd646_ide_info[] = { { - .qdev.name ="CMD646 IDE" , + .qdev.name ="cmd646-ide" , .qdev.size =sizeof (PCIIDEState), .init = pci_cmd646_ide_initfn, .qdev.props = (Property []) {
hw/ide/piix.c +4 -4
@@ -161,7 +161,7 @@ void pci_piix3_ide_init(PCIBus *bus, DriveInfo **hd_table, int devfn) {PCIDevice *dev; - dev =pci_create_simple (bus, devfn,"PIIX3 IDE" ); + dev =pci_create_simple (bus, devfn,"piix3-ide" );pci_ide_create_devs (dev, hd_table); }
@@ -171,18 +171,18 @@ void pci_piix4_ide_init(PCIBus *bus, DriveInfo **hd_table, int devfn) {PCIDevice *dev; - dev =pci_create_simple (bus, devfn,"PIIX4 IDE" ); + dev =pci_create_simple (bus, devfn,"piix4-ide" );pci_ide_create_devs (dev, hd_table); }static PCIDeviceInfo piix_ide_info[] = { { - .qdev.name ="PIIX3 IDE" , + .qdev.name ="piix3-ide" , .qdev.size =sizeof (PCIIDEState), .qdev.no_user =1 , .init = pci_piix3_ide_initfn, },{ - .qdev.name ="PIIX4 IDE" , + .qdev.name ="piix4-ide" , .qdev.size =sizeof (PCIIDEState), .qdev.no_user =1 , .init = pci_piix4_ide_initfn,
hw/unin_pci.c +15 -15
@@ -148,7 +148,7 @@ PCIBus *pci_pmac_init(qemu_irq *pic)/* Use values found on a real PowerMac */ /* Uninorth main bus */ - dev =qdev_create (NULL ,"Uni-north main" ); + dev =qdev_create (NULL ,"Uni-north-main" );qdev_init_nofail (dev); s =sysbus_from_qdev (dev); d =FROM_SYSBUS (UNINState, s);
@@ -157,7 +157,7 @@ PCIBus *pci_pmac_init(qemu_irq *pic) pic, 11 << 3, 4);#if 0 -pci_create_simple (d->host_state.bus,11 <<3 ,"Uni-north main" ); +pci_create_simple (d->host_state.bus,11 <<3 ,"Uni-north-main" );#endif sysbus_mmio_map (s,0 ,0xf2800000 );
@@ -166,12 +166,12 @@ PCIBus *pci_pmac_init(qemu_irq *pic)/* DEC 21154 bridge */ #if 0 /* XXX: not activated as PPC BIOS doesn't handle multiple buses properly */ -pci_create_simple (d->host_state.bus,12 <<3 ,"DEC 21154" ); +pci_create_simple (d->host_state.bus,12 <<3 ,"DEC-21154" );#endif /* Uninorth AGP bus */ -pci_create_simple (d->host_state.bus,11 <<3 ,"Uni-north AGP" ); - dev =qdev_create (NULL ,"Uni-north AGP" ); +pci_create_simple (d->host_state.bus,11 <<3 ,"Uni-north-AGP" ); + dev =qdev_create (NULL ,"Uni-north-AGP" );qdev_init_nofail (dev); s =sysbus_from_qdev (dev);sysbus_mmio_map (s,0 ,0xf0800000 );
@@ -180,8 +180,8 @@ PCIBus *pci_pmac_init(qemu_irq *pic)/* Uninorth internal bus */ #if 0 /* XXX: not needed for now */ -pci_create_simple (d->host_state.bus,14 <<3 ,"Uni-north internal" ); - dev =qdev_create (NULL ,"Uni-north internal" ); +pci_create_simple (d->host_state.bus,14 <<3 ,"Uni-north-internal" ); + dev =qdev_create (NULL ,"Uni-north-internal" );qdev_init_nofail (dev); s =sysbus_from_qdev (dev);sysbus_mmio_map (s,0 ,0xf4800000 );
@@ -260,41 +260,41 @@ static int unin_internal_pci_host_init(PCIDevice *d) }static PCIDeviceInfo unin_main_pci_host_info = { - .qdev.name ="Uni-north main" , + .qdev.name ="Uni-north-main" , .qdev.size =sizeof (PCIDevice), .init = unin_main_pci_host_init, };static PCIDeviceInfo dec_21154_pci_host_info = { - .qdev.name ="DEC 21154" , + .qdev.name ="DEC-21154" , .qdev.size =sizeof (PCIDevice), .init = dec_21154_pci_host_init, };static PCIDeviceInfo unin_agp_pci_host_info = { - .qdev.name ="Uni-north AGP" , + .qdev.name ="Uni-north-AGP" , .qdev.size =sizeof (PCIDevice), .init = unin_agp_pci_host_init, };static PCIDeviceInfo unin_internal_pci_host_info = { - .qdev.name ="Uni-north internal" , + .qdev.name ="Uni-north-internal" , .qdev.size =sizeof (PCIDevice), .init = unin_internal_pci_host_init, };static void unin_register_devices (void ) { -sysbus_register_dev ("Uni-north main" ,sizeof (UNINState), +sysbus_register_dev ("Uni-north-main" ,sizeof (UNINState), pci_unin_main_init_device);pci_qdev_register (&unin_main_pci_host_info); -sysbus_register_dev ("DEC 21154" ,sizeof (UNINState), +sysbus_register_dev ("DEC-21154" ,sizeof (UNINState), pci_dec_21154_init_device);pci_qdev_register (&dec_21154_pci_host_info); -sysbus_register_dev ("Uni-north AGP" ,sizeof (UNINState), +sysbus_register_dev ("Uni-north-AGP" ,sizeof (UNINState), pci_unin_agp_init_device);pci_qdev_register (&unin_agp_pci_host_info); -sysbus_register_dev ("Uni-north internal" ,sizeof (UNINState), +sysbus_register_dev ("Uni-north-internal" ,sizeof (UNINState), pci_unin_internal_init_device);pci_qdev_register (&unin_internal_pci_host_info); }
hw/usb-bt.c +2 -2
@@ -630,7 +630,7 @@ USBDevice *usb_bt_init(HCIInfo *hci)if (!hci)return NULL ; - dev =usb_create_simple (NULL /* FIXME */ ,"QEMU BT dongle" ); + dev =usb_create_simple (NULL /* FIXME */ ,"usb-bt-dongle" ); s = DO_UPCAST(struct USBBtState, dev, dev); s->dev.opaque = s;
@@ -645,7 +645,7 @@ USBDevice *usb_bt_init(HCIInfo *hci) }static struct USBDeviceInfo bt_info = { - .qdev.name ="QEMU BT dongle" , + .qdev.name ="usb-bt-dongle" , .qdev.size =sizeof (struct USBBtState ), .init = usb_bt_initfn, .handle_packet = usb_generic_handle_packet,
hw/usb-bus.c +1 -1
@@ -153,7 +153,7 @@ int usb_device_attach(USBDevice *dev)if (bus->nfree ==1 ) {/* Create a new hub and chain it on. */ - hub =usb_create_simple (bus,"QEMU USB Hub" ); + hub =usb_create_simple (bus,"usb-hub" ); }do_attach (dev);return 0 ;
hw/usb-hid.c +3 -6
@@ -880,8 +880,7 @@ void usb_hid_datain_cb(USBDevice *dev, void *opaque, void (*datain)(void *))static struct USBDeviceInfo hid_info[] = { { - .qdev.name ="QEMU USB Tablet" , - .qdev.alias ="usb-tablet" , + .qdev.name ="usb-tablet" , .usbdevice_name ="tablet" , .qdev.size =sizeof (USBHIDState), .init = usb_tablet_initfn,
@@ -891,8 +890,7 @@ static struct USBDeviceInfo hid_info[] = { .handle_data = usb_hid_handle_data, .handle_destroy = usb_hid_handle_destroy, },{ - .qdev.name = "QEMU USB Mouse", - .qdev.alias = "usb-mouse", + .qdev.name = "usb-mouse", .usbdevice_name = "mouse", .qdev.size = sizeof(USBHIDState), .init = usb_mouse_initfn,
@@ -902,8 +900,7 @@ static struct USBDeviceInfo hid_info[] = { .handle_data = usb_hid_handle_data, .handle_destroy = usb_hid_handle_destroy, },{ - .qdev.name = "QEMU USB Keyboard", - .qdev.alias = "usb-kbd", + .qdev.name = "usb-kbd", .usbdevice_name = "keyboard", .qdev.size = sizeof(USBHIDState), .init = usb_keyboard_initfn,
hw/usb-hub.c +1 -1
@@ -544,7 +544,7 @@ static int usb_hub_initfn(USBDevice *dev) }static struct USBDeviceInfo hub_info = { - .qdev.name ="QEMU USB Hub" , + .qdev.name ="usb-hub" , .qdev.size =sizeof (USBHubState), .init = usb_hub_initfn, .handle_packet = usb_hub_handle_packet,
hw/usb-msd.c +2 -3
@@ -591,7 +591,7 @@ static USBDevice *usb_msd_init(const char *filename) }/* create guest device */ - dev =usb_create (NULL /* FIXME */ ,"QEMU USB MSD" ); + dev =usb_create (NULL /* FIXME */ ,"usb-storage" );qdev_prop_set_drive (&dev->qdev,"drive" , dinfo);if (qdev_init (&dev->qdev) <0 )return NULL ;
@@ -600,8 +600,7 @@ static USBDevice *usb_msd_init(const char *filename) }static struct USBDeviceInfo msd_info = { - .qdev.name ="QEMU USB MSD" , - .qdev.alias ="usb-storage" , + .qdev.name ="usb-storage" , .qdev.size =sizeof (MSDState), .init = usb_msd_initfn, .handle_packet = usb_generic_handle_packet,
hw/usb-net.c +2 -2
@@ -1463,7 +1463,7 @@ USBDevice *usb_net_init(NICInfo *nd)USBDevice *dev;USBNetState *s; - dev =usb_create_simple (NULL /* FIXME */ ,"QEMU USB Network Interface" ); + dev =usb_create_simple (NULL /* FIXME */ ,"usb-net" ); s =DO_UPCAST (USBNetState, dev, dev);memcpy (s->conf.macaddr.a, nd->macaddr,sizeof (nd->macaddr));
@@ -1487,7 +1487,7 @@ USBDevice *usb_net_init(NICInfo *nd) }static struct USBDeviceInfo net_info = { - .qdev.name ="QEMU USB Network Interface" , + .qdev.name ="usb-net" , .qdev.size =sizeof (USBNetState), .init = usb_net_initfn, .handle_packet = usb_generic_handle_packet,
hw/usb-ohci.c +2 -3
@@ -1736,7 +1736,7 @@ static int usb_ohci_initfn_pci(struct PCIDevice *dev)void usb_ohci_init_pci (struct PCIBus *bus,int devfn) { -pci_create_simple (bus, devfn,"OHCI USB PCI" ); +pci_create_simple (bus, devfn,"pci-ohci" ); } void usb_ohci_init_pxa(target_phys_addr_t base, int num_ports, int devfn,
@@ -1762,8 +1762,7 @@ void usb_ohci_init_sm501(uint32_t mmio_base, uint32_t localmem_base, }static PCIDeviceInfo ohci_info = { - .qdev.name ="OHCI USB PCI" , - .qdev.alias ="pci-ohci" , + .qdev.name ="pci-ohci" , .qdev.desc ="Apple USB Controller" , .qdev.size =sizeof (OHCIPCIState), .init = usb_ohci_initfn_pci,
hw/usb-serial.c +4 -6
@@ -577,7 +577,7 @@ static USBDevice *usb_serial_init(const char *filename)if (!cdrv)return NULL ; - dev =usb_create (NULL /* FIXME */ ,"QEMU USB Serial" ); + dev =usb_create (NULL /* FIXME */ ,"usb-serial" );qdev_prop_set_chr (&dev->qdev,"chardev" , cdrv);if (vendorid)qdev_prop_set_uint16 (&dev->qdev,"vendorid" , vendorid);
@@ -597,7 +597,7 @@ static USBDevice *usb_braille_init(const char *unused)if (!cdrv)return NULL ; - dev =usb_create (NULL /* FIXME */ ,"QEMU USB Braille" ); + dev =usb_create (NULL /* FIXME */ ,"usb-braille" );qdev_prop_set_chr (&dev->qdev,"chardev" , cdrv);qdev_init (&dev->qdev);
@@ -605,8 +605,7 @@ static USBDevice *usb_braille_init(const char *unused) }static struct USBDeviceInfo serial_info = { - .qdev.name ="QEMU USB Serial" , - .qdev.alias ="usb-serial" , + .qdev.name ="usb-serial" , .qdev.size =sizeof (USBSerialState), .init = usb_serial_initfn, .handle_packet = usb_generic_handle_packet,
@@ -625,8 +624,7 @@ static struct USBDeviceInfo serial_info = { };static struct USBDeviceInfo braille_info = { - .qdev.name ="QEMU USB Braille" , - .qdev.alias ="usb-braille" , + .qdev.name ="usb-braille" , .qdev.size =sizeof (USBSerialState), .init = usb_serial_initfn, .handle_packet = usb_generic_handle_packet,
hw/usb-uhci.c +4 -4
@@ -1111,12 +1111,12 @@ static int usb_uhci_piix4_initfn(PCIDevice *dev)static PCIDeviceInfo uhci_info[] = { { - .qdev.name ="PIIX3 USB-UHCI" , + .qdev.name ="piix3-usb-uhci" , .qdev.size =sizeof (UHCIState), .qdev.vmsd = &vmstate_uhci, .init = usb_uhci_piix3_initfn, },{ - .qdev.name ="PIIX4 USB-UHCI" , + .qdev.name ="piix4-usb-uhci" , .qdev.size =sizeof (UHCIState), .qdev.vmsd = &vmstate_uhci, .init = usb_uhci_piix4_initfn,
@@ -1133,10 +1133,10 @@ device_init(uhci_register);void usb_uhci_piix3_init (PCIBus *bus,int devfn) { -pci_create_simple (bus, devfn,"PIIX3 USB-UHCI" ); +pci_create_simple (bus, devfn,"piix3-usb-uhci" ); }void usb_uhci_piix4_init (PCIBus *bus,int devfn) { -pci_create_simple (bus, devfn,"PIIX4 USB-UHCI" ); +pci_create_simple (bus, devfn,"piix4-usb-uhci" ); }
hw/usb-wacom.c +2 -2
@@ -409,8 +409,8 @@ static int usb_wacom_initfn(USBDevice *dev) }static struct USBDeviceInfo wacom_info = { - .qdev.name ="QEMU PenPartner Tablet" , - .qdev.alias ="wacom-tablet" , + .qdev.name ="usb-wacom-tablet" , + .qdev.desc ="QEMU PenPartner Tablet" , .usbdevice_name ="wacom-tablet" , .qdev.size =sizeof (USBWacomState), .init = usb_wacom_initfn,
hw/vmware_vga.c +2 -2
@@ -1194,11 +1194,11 @@ static int pci_vmsvga_initfn(PCIDevice *dev)void pci_vmsvga_init (PCIBus *bus) { -pci_create_simple (bus,-1 ,"QEMUware SVGA" ); +pci_create_simple (bus,-1 ,"vmware-svga" ); }static PCIDeviceInfo vmsvga_info = { - .qdev.name ="QEMUware SVGA" , + .qdev.name ="vmware-svga" , .qdev.size =sizeof (struct pci_vmsvga_state_s ), .qdev.vmsd = &vmstate_vmware_vga, .init = pci_vmsvga_initfn,
usb-bsd.c +2 -2
@@ -361,7 +361,7 @@ USBDevice *usb_host_device_open(const char *devname) goto fail; } - d =usb_create (NULL /* FIXME */ ,"USB Host Device" ); + d =usb_create (NULL /* FIXME */ ,"usb-host" ); dev =DO_UPCAST (USBHostDevice, dev, d);if (dev_info.udi_speed ==1 )
@@ -393,7 +393,7 @@ fail: }static struct USBDeviceInfo usb_host_dev_info = { - .qdev.name ="USB Host Device" , + .qdev.name ="usb-host" , .qdev.size =sizeof (USBHostDevice), .init = usb_host_initfn, .handle_packet = usb_generic_handle_packet,
usb-linux.c +2 -3
@@ -979,8 +979,7 @@ static int usb_host_initfn(USBDevice *dev) }static struct USBDeviceInfo usb_host_dev_info = { - .qdev.name ="USB Host Device" , - .qdev.alias ="usb-host" , + .qdev.name ="usb-host" , .qdev.size =sizeof (USBHostDevice), .init = usb_host_initfn, .handle_packet = usb_host_handle_packet,
@@ -1010,7 +1009,7 @@ USBDevice *usb_host_device_open(const char *devname)USBHostDevice *s;char *p; - dev =usb_create (NULL /* FIXME */ ,"USB Host Device" ); + dev =usb_create (NULL /* FIXME */ ,"usb-host" ); s =DO_UPCAST (USBHostDevice, dev, dev);if (strstr (devname,"auto:" )) {
Signature · 1 line
1.6.2.5
Quoted 15 lines
hw/usb-msd.c +1
-1@@ -591,7 +591,7 @@ static USBDevice *usb_msd_init(const char *filename) }/* create guest device */ - dev =usb_create (NULL /* FIXME */ ,"QEMU USB MSD" ); + dev =usb_create (NULL /* FIXME */ ,"usb-storage" );qdev_prop_set_drive (&dev->qdev,"drive" , dinfo);if (qdev_init (&dev->qdev)<0 )return NULL ;
hw/usb-msd.c static USBDevice *usb_msd_init(const char *filename) · line 606
Quoted 9 lines
hw/usb-msd.c +1
-2@@ -600,8 +600,7 @@ static USBDevice *usb_msd_init(const char *filename) }static struct USBDeviceInfo msd_info = { - .qdev.name ="QEMU USB MSD" , - .qdev.alias ="usb-storage" , + .qdev.name ="usb-storage" , .qdev.size =sizeof (MSDState), .init = usb_msd_initfn, .handle_packet = usb_generic_handle_packet,
No. USB needs some more care. DeviceInfo->name is also used as default value for USBDevice->devname. See usb_qdev_init(). Most usb backends don't change it. So this change is visible in both 'info usb' monitor command and within the guest (check /proc/bus/usb/devices).
I'd suggest to add a new field to USBDeviceInfo, stick the long name there and use that in usb_qdev_init() then.
Otherwise the patch looks fine to me.
cheers,
Gerd
Quoted 30 lines · Gerd Hoffmann
Quoted 14 lines
hw/usb-msd.c +1
-1@@ -591,7 +591,7 @@ static USBDevice *usb_msd_init(const char *filename) }/* create guest device */ - dev =usb_create (NULL /* FIXME */ ,"QEMU USB MSD" ); + dev =usb_create (NULL /* FIXME */ ,"usb-storage" );qdev_prop_set_drive (&dev->qdev,"drive" , dinfo);if (qdev_init (&dev->qdev)<0 )return NULL ;hw/usb-msd.c static USBDevice *usb_msd_init(const char *filename) · line 606
Quoted 9 lines
hw/usb-msd.c +1
-2@@ -600,8 +600,7 @@ static USBDevice *usb_msd_init(const char *filename) }static struct USBDeviceInfo msd_info = { - .qdev.name ="QEMU USB MSD" , - .qdev.alias ="usb-storage" , + .qdev.name ="usb-storage" , .qdev.size =sizeof (MSDState), .init = usb_msd_initfn, .handle_packet = usb_generic_handle_packet,No. USB needs some more care.
DeviceInfo->nameis also used as
default value forUSBDevice->devname. Seeusb_qdev_init(). Most usb
backends don't change it. So this change is visible in both 'info usb' monitor command and within the guest (check/proc/bus/usb/devices).
Quoted 2 lines
I'd suggest to add a new field to USBDeviceInfo, stick the long name there and use that in
usb_qdev_init()then.
I missed that needle in the "grep -w name" haystack.
Quoted 1 line
Otherwise the patch looks fine to me.
Will fix. Thanks!
Quoted 2 lines · Markus Armbruster
The place for verbose device names is DeviceInfo member desc. The name should be short & sweet.
Agreed, however...
Why do these (maybe others) get caps in their names? they dont look right to me, compared to the others with nice names like usb-serial, piix-ide, or cirrus-vga.
Quoted 7 lines
hw/unin_pci.c +2
-2-sysbus_register_dev ("Uni-north main" ,sizeof (UNINState), +sysbus_register_dev ("Uni-north-main" ,sizeof (UNINState), pci_unin_main_init_device);pci_qdev_register (&unin_main_pci_host_info); -sysbus_register_dev ("DEC 21154" ,sizeof (UNINState), +sysbus_register_dev ("DEC-21154" ,sizeof (UNINState), pci_dec_21154_init_device);
hw/unin_pci.c static int unin_internal_pci_host_init(PCIDevice *d) · line 300
Quoted 10 lines
hw/unin_pci.c +2
-2pci_qdev_register (&dec_21154_pci_host_info); -sysbus_register_dev ("Uni-north AGP" ,sizeof (UNINState), +sysbus_register_dev ("Uni-north-AGP" ,sizeof (UNINState), pci_unin_agp_init_device);pci_qdev_register (&unin_agp_pci_host_info); -sysbus_register_dev ("Uni-north internal" ,sizeof (UNINState), +sysbus_register_dev ("Uni-north-internal" ,sizeof (UNINState), pci_unin_internal_init_device);pci_qdev_register (&unin_internal_pci_host_info); }
-Ian
Quoted 28 lines · Ian Molton
Quoted 2 lines · Markus Armbruster
The place for verbose device names is DeviceInfo member desc. The name should be short & sweet.
Agreed, however...
Why do these (maybe others) get caps in their names? they dont look right to me, compared to the others with nice names like usb-serial, piix-ide, or cirrus-vga.
Quoted 17 lines
hw/unin_pci.c +4
-4-sysbus_register_dev ("Uni-north main" ,sizeof (UNINState), +sysbus_register_dev ("Uni-north-main" ,sizeof (UNINState), pci_unin_main_init_device);pci_qdev_register (&unin_main_pci_host_info); -sysbus_register_dev ("DEC 21154" ,sizeof (UNINState), +sysbus_register_dev ("DEC-21154" ,sizeof (UNINState), pci_dec_21154_init_device);pci_qdev_register (&dec_21154_pci_host_info); -sysbus_register_dev ("Uni-north AGP" ,sizeof (UNINState), +sysbus_register_dev ("Uni-north-AGP" ,sizeof (UNINState), pci_unin_agp_init_device);pci_qdev_register (&unin_agp_pci_host_info); -sysbus_register_dev ("Uni-north internal" ,sizeof (UNINState), +sysbus_register_dev ("Uni-north-internal" ,sizeof (UNINState), pci_unin_internal_init_device);pci_qdev_register (&unin_internal_pci_host_info); }
I can downcase them. Blue Swirl, any objections?
Quoted 31 lines · Markus Armbruster
Quoted 28 lines · Ian Molton
Quoted 2 lines · Markus Armbruster
The place for verbose device names is DeviceInfo member desc. The name should be short & sweet.
Agreed, however...
Why do these (maybe others) get caps in their names? they dont look right to me, compared to the others with nice names like usb-serial, piix-ide, or cirrus-vga.
Quoted 17 lines
- sysbus_register_dev("Uni-north main", sizeof(UNINState),
+ sysbus_register_dev("Uni-north-main", sizeof(UNINState),pci_unin_main_init_device);pci_qdev_register(&unin_main_pci_host_info);
- sysbus_register_dev("DEC 21154", sizeof(UNINState),
+ sysbus_register_dev("DEC-21154", sizeof(UNINState),pci_dec_21154_init_device);pci_qdev_register(&dec_21154_pci_host_info);
- sysbus_register_dev("Uni-north AGP", sizeof(UNINState),
+ sysbus_register_dev("Uni-north-AGP", sizeof(UNINState),pci_unin_agp_init_device);pci_qdev_register(&unin_agp_pci_host_info);
- sysbus_register_dev("Uni-north internal", sizeof(UNINState),
+ sysbus_register_dev("Uni-north-internal", sizeof(UNINState),pci_unin_internal_init_device);pci_qdev_register(&unin_internal_pci_host_info);
}
Quoted 2 lines
I can downcase them. Blue Swirl, any objections?
I'd prefer the same names that are used by the device tree, like uni-n and uni-north-agp. Though the bridge is name poorly, just "pci-bridge".
For example:
http://penguinppc.org/historical/dev-trees-html/imac_400_1.html
Quoted 35 lines · Blue Swirl
Quoted 31 lines · Markus Armbruster
Quoted 28 lines · Ian Molton
Quoted 2 lines · Markus Armbruster
The place for verbose device names is DeviceInfo member desc. The name should be short & sweet.
Agreed, however...
Why do these (maybe others) get caps in their names? they dont look right to me, compared to the others with nice names like usb-serial, piix-ide, or cirrus-vga.
Quoted 17 lines
- sysbus_register_dev("Uni-north main", sizeof(UNINState),
+ sysbus_register_dev("Uni-north-main", sizeof(UNINState),pci_unin_main_init_device);pci_qdev_register(&unin_main_pci_host_info);
- sysbus_register_dev("DEC 21154", sizeof(UNINState),
+ sysbus_register_dev("DEC-21154", sizeof(UNINState),pci_dec_21154_init_device);pci_qdev_register(&dec_21154_pci_host_info);
- sysbus_register_dev("Uni-north AGP", sizeof(UNINState),
+ sysbus_register_dev("Uni-north-AGP", sizeof(UNINState),pci_unin_agp_init_device);pci_qdev_register(&unin_agp_pci_host_info);
- sysbus_register_dev("Uni-north internal", sizeof(UNINState),
+ sysbus_register_dev("Uni-north-internal", sizeof(UNINState),pci_unin_internal_init_device);pci_qdev_register(&unin_internal_pci_host_info);
}Quoted 2 lines
I can downcase them. Blue Swirl, any objections?
Quoted 6 lines
I'd prefer the same names that are used by the device tree, like uni-n and uni-north-agp. Though the bridge is name poorly, just "pci-bridge".
For example:
http://penguinppc.org/historical/dev-trees-html/imac_400_1.html
If I read that document correctly, we have
old qdev name device tree name
Uni-north main uni-n
Uni-north AGP uni-north-agp
Uni-north internal pci
DEC 21154 pci-bridgeDo you want me to respin my patch? If yes, the best way to make me do exactly what you want is to tell me exactly what you want. In this case, tell me the names you want.
Quoted 52 lines · Markus Armbruster
Quoted 35 lines · Blue Swirl
Quoted 31 lines · Markus Armbruster
Quoted 28 lines · Ian Molton
Quoted 2 lines · Markus Armbruster
The place for verbose device names is DeviceInfo member desc. The name should be short & sweet.
Agreed, however...
Why do these (maybe others) get caps in their names? they dont look right to me, compared to the others with nice names like usb-serial, piix-ide, or cirrus-vga.
Quoted 17 lines
- sysbus_register_dev("Uni-north main", sizeof(UNINState),
+ sysbus_register_dev("Uni-north-main", sizeof(UNINState),pci_unin_main_init_device);pci_qdev_register(&unin_main_pci_host_info);
- sysbus_register_dev("DEC 21154", sizeof(UNINState),
+ sysbus_register_dev("DEC-21154", sizeof(UNINState),pci_dec_21154_init_device);pci_qdev_register(&dec_21154_pci_host_info);
- sysbus_register_dev("Uni-north AGP", sizeof(UNINState),
+ sysbus_register_dev("Uni-north-AGP", sizeof(UNINState),pci_unin_agp_init_device);pci_qdev_register(&unin_agp_pci_host_info);
- sysbus_register_dev("Uni-north internal", sizeof(UNINState),
+ sysbus_register_dev("Uni-north-internal", sizeof(UNINState),pci_unin_internal_init_device);pci_qdev_register(&unin_internal_pci_host_info);
}Quoted 2 lines
I can downcase them. Blue Swirl, any objections?
Quoted 6 lines
I'd prefer the same names that are used by the device tree, like uni-n and uni-north-agp. Though the bridge is name poorly, just "pci-bridge".
For example:
http://penguinppc.org/historical/dev-trees-html/imac_400_1.htmlIf I read that document correctly, we have
old qdev name device tree name
Uni-north main uni-n
Uni-north AGP uni-north-agp
Uni-north internal pci
DEC 21154 pci-bridge
Quoted 3 lines
Do you want me to respin my patch? If yes, the best way to make me do exactly what you want is to tell me exactly what you want. In this case, tell me the names you want.
'pci' and 'pci-bridge' are too generic, so please respin with these:
Uni-north main uni-north Uni-north AGP uni-north-agp Uni-north internal uni-north-pci DEC 21154 dec-21154
PATCH 1/1 qdev: Improve uni-north device names (was: [Qemu-devel] [FOR 0.12 PATCH] qdev: Replace device names containing whitespace)
Switch to the names suggested by Blue Swirl.
--- hw/unin_pci.c | 24 ++++++++++++------------ 1 files changed, 12 insertions(+), 12 deletions(-)
hw/unin_pci.c +12 -12
@@ -148,7 +148,7 @@ PCIBus *pci_pmac_init(qemu_irq *pic)/* Use values found on a real PowerMac */ /* Uninorth main bus */ - dev =qdev_create (NULL ,"uni-north-main" ); + dev =qdev_create (NULL ,"uni-north" );qdev_init_nofail (dev); s =sysbus_from_qdev (dev); d =FROM_SYSBUS (UNINState, s);
@@ -157,7 +157,7 @@ PCIBus *pci_pmac_init(qemu_irq *pic) pic, 11 << 3, 4);#if 0 -pci_create_simple (d->host_state.bus,11 <<3 ,"uni-north-main" ); +pci_create_simple (d->host_state.bus,11 <<3 ,"uni-north" );#endif sysbus_mmio_map (s,0 ,0xf2800000 );
@@ -170,8 +170,8 @@ PCIBus *pci_pmac_init(qemu_irq *pic)#endif /* Uninorth AGP bus */ -pci_create_simple (d->host_state.bus,11 <<3 ,"uni-north-AGP" ); - dev =qdev_create (NULL ,"uni-north-AGP" ); +pci_create_simple (d->host_state.bus,11 <<3 ,"uni-north-agp" ); + dev =qdev_create (NULL ,"uni-north-agp" );qdev_init_nofail (dev); s =sysbus_from_qdev (dev);sysbus_mmio_map (s,0 ,0xf0800000 );
@@ -180,8 +180,8 @@ PCIBus *pci_pmac_init(qemu_irq *pic)/* Uninorth internal bus */ #if 0 /* XXX: not needed for now */ -pci_create_simple (d->host_state.bus,14 <<3 ,"uni-north-internal" ); - dev =qdev_create (NULL ,"uni-north-internal" ); +pci_create_simple (d->host_state.bus,14 <<3 ,"uni-north-pci" ); + dev =qdev_create (NULL ,"uni-north-pci" );qdev_init_nofail (dev); s =sysbus_from_qdev (dev);sysbus_mmio_map (s,0 ,0xf4800000 );
@@ -260,7 +260,7 @@ static int unin_internal_pci_host_init(PCIDevice *d) }static PCIDeviceInfo unin_main_pci_host_info = { - .qdev.name ="uni-north-main" , + .qdev.name ="uni-north" , .qdev.size =sizeof (PCIDevice), .init = unin_main_pci_host_init, };
@@ -272,29 +272,29 @@ static PCIDeviceInfo dec_21154_pci_host_info = { };static PCIDeviceInfo unin_agp_pci_host_info = { - .qdev.name ="uni-north-AGP" , + .qdev.name ="uni-north-agp" , .qdev.size =sizeof (PCIDevice), .init = unin_agp_pci_host_init, };static PCIDeviceInfo unin_internal_pci_host_info = { - .qdev.name ="uni-north-internal" , + .qdev.name ="uni-north-pci" , .qdev.size =sizeof (PCIDevice), .init = unin_internal_pci_host_init, };static void unin_register_devices (void ) { -sysbus_register_dev ("uni-north-main" ,sizeof (UNINState), +sysbus_register_dev ("uni-north" ,sizeof (UNINState), pci_unin_main_init_device);pci_qdev_register (&unin_main_pci_host_info);sysbus_register_dev ("dec-21154" ,sizeof (UNINState), pci_dec_21154_init_device);pci_qdev_register (&dec_21154_pci_host_info); -sysbus_register_dev ("uni-north-AGP" ,sizeof (UNINState), +sysbus_register_dev ("uni-north-agp" ,sizeof (UNINState), pci_unin_agp_init_device);pci_qdev_register (&unin_agp_pci_host_info); -sysbus_register_dev ("uni-north-internal" ,sizeof (UNINState), +sysbus_register_dev ("uni-north-pci" ,sizeof (UNINState), pci_unin_internal_init_device);pci_qdev_register (&unin_internal_pci_host_info); }