Revision 8707ecca

b/hw/pci-hotplug.c
97 97
            type = IF_SCSI;
98 98
        else if (!strcmp(buf, "virtio")) {
99 99
            type = IF_VIRTIO;
100
        } else {
101
            monitor_printf(mon, "type %s not a hotpluggable PCI device.\n", buf);
102
            goto out;
100 103
        }
101 104
    } else {
102 105
        monitor_printf(mon, "no if= specified\n");
103
        return NULL;
106
        goto out;
104 107
    }
105 108

  
106 109
    if (get_param_value(buf, sizeof(buf), "file", opts)) {
107 110
        drive_idx = add_init_drive(opts);
108 111
        if (drive_idx < 0)
109
            return NULL;
112
            goto out;
110 113
    } else if (type == IF_VIRTIO) {
111 114
        monitor_printf(mon, "virtio requires a backing file/device.\n");
112
        return NULL;
115
        goto out;
113 116
    }
114 117

  
115 118
    switch (type) {
......
122 125
    case IF_VIRTIO:
123 126
        opaque = virtio_blk_init (pci_bus, drives_table[drive_idx].bdrv);
124 127
        break;
125
    default:
126
        monitor_printf(mon, "type %s not a hotpluggable PCI device.\n", buf);
127 128
    }
128 129

  
130
out:
129 131
    return opaque;
130 132
}
131 133

  

Also available in: Unified diff