Skip to contentSkip to conversation

hmp: Remove "info pcmcia"

PATCH In review Markus Armbruster 4 participants 6 messages Sep 19, 2014 – Oct 9, 2014

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 hmp: Remove "info pcmcia"

This command lists PCMCIA sockets and cards. Only a few ARM boards have sockets (akita, borzoi, connex, mainstone, spitz, terrier, tosa, verdex, z2), the only card is the DSCM-1xxxx Hitachi Microdrive (qdev "microdrive"), and it is only inserted during machine init, if ever. So this command doesn't really tell anybody anything new so far.

Moreover, pcmcia_socket_unregister() has a use-after-free bug, flagged by Coverity. Has never been used, because there has never been code to eject a PCMCIA card.

Not worth fixing & converting to QMP. Remove it.

---
 hmp-commands.hx     |  2 --
 hw/ide/microdrive.c |  1 -
 hw/pcmcia/pxa2xx.c  | 21 ---------------------
 include/hw/pcmcia.h |  6 ------
 monitor.c           |  8 --------
 vl.c                | 44 --------------------------------------------
 6 files changed, 82 deletions(-)
hmp-commands.hx +0 -2
index f859f8d..0ffcb18 100644
@@ -1748,8 +1748,6 @@ show information about active capturing
 show list of VM snapshots
 @item info status
 show the current VM status (running|paused)
-@item info pcmcia
-show guest PCMCIA status
 @item info mice
 show which guest mouse is receiving events
 @item info vnc
hw/ide/microdrive.c +0 -1
index 15671b8..cca0648 100644
@@ -543,7 +543,6 @@ static int dscm1xxxx_attach(PCMCIACardState *card)
     device_reset(DEVICE(md));
     md_interrupt_update(md);
 
-    card->slot->card_string = "DSCM-1xxxx Hitachi Microdrive";
     return 0;
 }
 
hw/pcmcia/pxa2xx.c +0 -21
index 55e8a2a..a7e1877 100644
@@ -149,24 +149,11 @@ PXA2xxPCMCIAState *pxa2xx_pcmcia_init(MemoryRegion *sysmem,
     sysbus_mmio_map(SYS_BUS_DEVICE(dev), 0, base);
     s = PXA2XX_PCMCIA(dev);
 
-    if (base == 0x30000000) {
-        s->slot.slot_string = "PXA PC Card Socket 1";
-    } else {
-        s->slot.slot_string = "PXA PC Card Socket 0";
-    }
-
     qdev_init_nofail(dev);
 
     return s;
 }
 
-static void pxa2xx_pcmcia_realize(DeviceState *dev, Error **errp)
-{
-    PXA2xxPCMCIAState *s = PXA2XX_PCMCIA(dev);
-
-    pcmcia_socket_register(&s->slot);
-}
-
 static void pxa2xx_pcmcia_initfn(Object *obj)
 {
     SysBusDevice *sbd = SYS_BUS_DEVICE(obj);
@@ -262,19 +249,11 @@ void pxa2xx_pcmcia_set_irq_cb(void *opaque, qemu_irq irq, qemu_irq cd_irq)
     s->cd_irq = cd_irq;
 }
 
-static void pxa2xx_pcmcia_class_init(ObjectClass *oc, void *data)
-{
-    DeviceClass *dc = DEVICE_CLASS(oc);
-
-    dc->realize = pxa2xx_pcmcia_realize;
-}
-
 static const TypeInfo pxa2xx_pcmcia_type_info = {
     .name = TYPE_PXA2XX_PCMCIA,
     .parent = TYPE_SYS_BUS_DEVICE,
     .instance_size = sizeof(PXA2xxPCMCIAState),
     .instance_init = pxa2xx_pcmcia_initfn,
-    .class_init = pxa2xx_pcmcia_class_init,
 };
 
 static void pxa2xx_pcmcia_register_types(void)
include/hw/pcmcia.h +0 -6
index 2695d3c..98406ff 100644
@@ -8,14 +8,8 @@
 typedef struct PCMCIASocket {
     qemu_irq irq;
     bool attached;
-    const char *slot_string;
-    const char *card_string;
 } PCMCIASocket;
 
-void pcmcia_socket_register(PCMCIASocket *socket);
-void pcmcia_socket_unregister(PCMCIASocket *socket);
-void pcmcia_info(Monitor *mon, const QDict *qdict);
-
 #define TYPE_PCMCIA_CARD "pcmcia-card"
 #define PCMCIA_CARD(obj) \
     OBJECT_CHECK(PCMCIACardState, (obj), TYPE_PCMCIA_CARD)
monitor.c +0 -8
index 667efb7..6bb2f44 100644
@@ -25,7 +25,6 @@
 #include "hw/hw.h"
 #include "monitor/qdev.h"
 #include "hw/usb.h"
-#include "hw/pcmcia.h"
 #include "hw/i386/pc.h"
 #include "hw/pci/pci.h"
 #include "sysemu/watchdog.h"
@@ -2791,13 +2790,6 @@ static mon_cmd_t info_cmds[] = {
         .mhandler.cmd = hmp_info_status,
     },
     {
-        .name       = "pcmcia",
-        .args_type  = "",
-        .params     = "",
-        .help       = "show guest PCMCIA status",
-        .mhandler.cmd = pcmcia_info,
-    },
-    {
         .name       = "mice",
         .args_type  = "",
         .params     = "",
vl.c +0 -44

56 lines not on this page · raw message

Signature · 1 line
1.9.3
#1 lore raw

Ping?

Quoted 13 lines · Markus Armbruster

This command lists PCMCIA sockets and cards. Only a few ARM boards have sockets (akita, borzoi, connex, mainstone, spitz, terrier, tosa, verdex, z2), the only card is the DSCM-1xxxx Hitachi Microdrive (qdev "microdrive"), and it is only inserted during machine init, if ever. So this command doesn't really tell anybody anything new so far.

Moreover, pcmcia_socket_unregister() has a use-after-free bug, flagged by Coverity. Has never been used, because there has never been code to eject a PCMCIA card.

Not worth fixing & converting to QMP. Remove it.

#2 lore raw
Quoted 15 lines · On Wed, 01 Oct 2014 10:54:44 +0200 Markus Armbruster <[email protected]> wrote:

Ping?

Quoted 11 lines · Markus Armbruster

This command lists PCMCIA sockets and cards. Only a few ARM boards have sockets (akita, borzoi, connex, mainstone, spitz, terrier, tosa, verdex, z2), the only card is the DSCM-1xxxx Hitachi Microdrive (qdev "microdrive"), and it is only inserted during machine init, if ever. So this command doesn't really tell anybody anything new so far.

Moreover, pcmcia_socket_unregister() has a use-after-free bug, flagged by Coverity. Has never been used, because there has never been code to eject a PCMCIA card.

Not worth fixing & converting to QMP. Remove it.

Sorry for the long delay on this one. But this patch is more about PCMCIA support in QEMU than HMP, so I can provide my ACK, but I don't think this is HMP material.

#3 lore raw

Am 09.10.2014 um 15:47 schrieb Luiz Capitulino:

Quoted 17 lines
Quoted 14 lines · On Wed, 01 Oct 2014 10:54:44 +0200 Markus Armbruster <[email protected]> wrote:

Ping?

Quoted 10 lines · Markus Armbruster

This command lists PCMCIA sockets and cards. Only a few ARM boards have sockets (akita, borzoi, connex, mainstone, spitz, terrier, tosa, verdex, z2), the only card is the DSCM-1xxxx Hitachi Microdrive (qdev "microdrive"), and it is only inserted during machine init, if ever. So this command doesn't really tell anybody anything new so far.

Moreover, pcmcia_socket_unregister() has a use-after-free bug, flagged by Coverity. Has never been used, because there has never been code to eject a PCMCIA card.

Quoted 7 lines
Quoted 1 line
Quoted 1 line

Not worth fixing & converting to QMP. Remove it.

Sorry for the long delay on this one. But this patch is more about PCMCIA support in QEMU than HMP, so I can provide my ACK, but I don't think this is HMP material.

As the probably last one to have touched the ugly PCMCIA code,

Maybe take it through the arm queue due to affected machines, Peter?

Regards,
Andreas

Signature · 2 lines
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg
#4 lore raw
Quoted 24 lines · Andreas Färber

Am 09.10.2014 um 15:47 schrieb Luiz Capitulino:

Quoted 23 lines
Quoted 15 lines · On Wed, 01 Oct 2014 10:54:44 +0200 Markus Armbruster <[email protected]> wrote:

Ping?

Quoted 11 lines · Markus Armbruster

This command lists PCMCIA sockets and cards. Only a few ARM boards have sockets (akita, borzoi, connex, mainstone, spitz, terrier, tosa, verdex, z2), the only card is the DSCM-1xxxx Hitachi Microdrive (qdev "microdrive"), and it is only inserted during machine init, if ever. So this command doesn't really tell anybody anything new so far.

Moreover, pcmcia_socket_unregister() has a use-after-free bug, flagged by Coverity. Has never been used, because there has never been code to eject a PCMCIA card.

Not worth fixing & converting to QMP. Remove it.

Sorry for the long delay on this one. But this patch is more about PCMCIA support in QEMU than HMP, so I can provide my ACK, but I don't think this is HMP material.

Quoted 7 lines
Quoted 1 line

As the probably last one to have touched the ugly PCMCIA code,

Maybe take it through the arm queue due to affected machines, Peter?

I don't particularly care -- the machines in question are near-dead so there's not much chance of conflicts. I can take it if that's easiest for everybody I guess?

-- PMM

#5 lore raw
Quoted 29 lines · Peter Maydell
Quoted 28 lines · Andreas Färber

Am 09.10.2014 um 15:47 schrieb Luiz Capitulino:

Quoted 17 lines
Quoted 14 lines · On Wed, 01 Oct 2014 10:54:44 +0200 Markus Armbruster <[email protected]> wrote:

Ping?

Quoted 10 lines · Markus Armbruster

This command lists PCMCIA sockets and cards. Only a few ARM boards have sockets (akita, borzoi, connex, mainstone, spitz, terrier, tosa, verdex, z2), the only card is the DSCM-1xxxx Hitachi Microdrive (qdev "microdrive"), and it is only inserted during machine init, if ever. So this command doesn't really tell anybody anything new so far.

Moreover, pcmcia_socket_unregister() has a use-after-free bug, flagged by Coverity. Has never been used, because there has never been code to eject a PCMCIA card.

Quoted 7 lines
Quoted 1 line
Quoted 1 line

Not worth fixing & converting to QMP. Remove it.

Sorry for the long delay on this one. But this patch is more about PCMCIA support in QEMU than HMP, so I can provide my ACK, but I don't think this is HMP material.

As the probably last one to have touched the ugly PCMCIA code,

Quoted 7 lines
Quoted 3 lines

Maybe take it through the arm queue due to affected machines, Peter?

I don't particularly care -- the machines in question are near-dead so there's not much chance of conflicts. I can take it if that's easiest for everybody I guess?

Yes, please!