提交 cad0b273 编写于 作者: P Peter Maydell

Merge remote-tracking branch 'remotes/armbru/tags/pull-monitor-2016-03-16' into staging

Monitor patches for 2016-03-16

# gpg: Signature made Wed 16 Mar 2016 09:47:23 GMT using RSA key ID EB918653
# gpg: Good signature from "Markus Armbruster <armbru@redhat.com>"
# gpg:                 aka "Markus Armbruster <armbru@pond.sub.org>"

* remotes/armbru/tags/pull-monitor-2016-03-16:
  qdev-monitor: add missing aliases for virtio device classes
  qdev-monitor: sort alias table by typename
  qdev-monitor: improve error message when alias device is unavailable
Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
...@@ -39,19 +39,39 @@ typedef struct QDevAlias ...@@ -39,19 +39,39 @@ typedef struct QDevAlias
uint32_t arch_mask; uint32_t arch_mask;
} QDevAlias; } QDevAlias;
/* Please keep this table sorted by typename. */
static const QDevAlias qdev_alias_table[] = { static const QDevAlias qdev_alias_table[] = {
{ "virtio-blk-pci", "virtio-blk", QEMU_ARCH_ALL & ~QEMU_ARCH_S390X }, { "e1000", "e1000-82540em" },
{ "virtio-net-pci", "virtio-net", QEMU_ARCH_ALL & ~QEMU_ARCH_S390X }, { "ich9-ahci", "ahci" },
{ "virtio-serial-pci", "virtio-serial", QEMU_ARCH_ALL & ~QEMU_ARCH_S390X }, { "kvm-pci-assign", "pci-assign" },
{ "lsi53c895a", "lsi" },
{ "virtio-9p-ccw", "virtio-9p", QEMU_ARCH_S390X },
{ "virtio-9p-pci", "virtio-9p", QEMU_ARCH_ALL & ~QEMU_ARCH_S390X },
{ "virtio-balloon-ccw", "virtio-balloon", QEMU_ARCH_S390X },
{ "virtio-balloon-pci", "virtio-balloon", { "virtio-balloon-pci", "virtio-balloon",
QEMU_ARCH_ALL & ~QEMU_ARCH_S390X }, QEMU_ARCH_ALL & ~QEMU_ARCH_S390X },
{ "virtio-blk-ccw", "virtio-blk", QEMU_ARCH_S390X }, { "virtio-blk-ccw", "virtio-blk", QEMU_ARCH_S390X },
{ "virtio-blk-pci", "virtio-blk", QEMU_ARCH_ALL & ~QEMU_ARCH_S390X },
{ "virtio-gpu-ccw", "virtio-gpu", QEMU_ARCH_S390X },
{ "virtio-gpu-pci", "virtio-gpu", QEMU_ARCH_ALL & ~QEMU_ARCH_S390X },
{ "virtio-input-host-ccw", "virtio-input-host", QEMU_ARCH_S390X },
{ "virtio-input-host-pci", "virtio-input-host",
QEMU_ARCH_ALL & ~QEMU_ARCH_S390X },
{ "virtio-keyboard-ccw", "virtio-keyboard", QEMU_ARCH_S390X },
{ "virtio-keyboard-pci", "virtio-keyboard",
QEMU_ARCH_ALL & ~QEMU_ARCH_S390X },
{ "virtio-mouse-ccw", "virtio-mouse", QEMU_ARCH_S390X },
{ "virtio-mouse-pci", "virtio-mouse", QEMU_ARCH_ALL & ~QEMU_ARCH_S390X },
{ "virtio-net-ccw", "virtio-net", QEMU_ARCH_S390X }, { "virtio-net-ccw", "virtio-net", QEMU_ARCH_S390X },
{ "virtio-net-pci", "virtio-net", QEMU_ARCH_ALL & ~QEMU_ARCH_S390X },
{ "virtio-rng-ccw", "virtio-rng", QEMU_ARCH_S390X },
{ "virtio-rng-pci", "virtio-rng", QEMU_ARCH_ALL & ~QEMU_ARCH_S390X },
{ "virtio-scsi-ccw", "virtio-scsi", QEMU_ARCH_S390X },
{ "virtio-scsi-pci", "virtio-scsi", QEMU_ARCH_ALL & ~QEMU_ARCH_S390X },
{ "virtio-serial-ccw", "virtio-serial", QEMU_ARCH_S390X }, { "virtio-serial-ccw", "virtio-serial", QEMU_ARCH_S390X },
{ "lsi53c895a", "lsi" }, { "virtio-serial-pci", "virtio-serial", QEMU_ARCH_ALL & ~QEMU_ARCH_S390X },
{ "ich9-ahci", "ahci" }, { "virtio-tablet-ccw", "virtio-tablet", QEMU_ARCH_S390X },
{ "kvm-pci-assign", "pci-assign" }, { "virtio-tablet-pci", "virtio-tablet", QEMU_ARCH_ALL & ~QEMU_ARCH_S390X },
{ "e1000", "e1000-82540em" },
{ } { }
}; };
...@@ -188,6 +208,7 @@ static DeviceClass *qdev_get_device_class(const char **driver, Error **errp) ...@@ -188,6 +208,7 @@ static DeviceClass *qdev_get_device_class(const char **driver, Error **errp)
{ {
ObjectClass *oc; ObjectClass *oc;
DeviceClass *dc; DeviceClass *dc;
const char *original_name = *driver;
oc = object_class_by_name(*driver); oc = object_class_by_name(*driver);
if (!oc) { if (!oc) {
...@@ -200,7 +221,12 @@ static DeviceClass *qdev_get_device_class(const char **driver, Error **errp) ...@@ -200,7 +221,12 @@ static DeviceClass *qdev_get_device_class(const char **driver, Error **errp)
} }
if (!object_class_dynamic_cast(oc, TYPE_DEVICE)) { if (!object_class_dynamic_cast(oc, TYPE_DEVICE)) {
error_setg(errp, "'%s' is not a valid device model name", *driver); if (*driver != original_name) {
error_setg(errp, "'%s' (alias '%s') is not a valid device model"
" name", original_name, *driver);
} else {
error_setg(errp, "'%s' is not a valid device model name", *driver);
}
return NULL; return NULL;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册