~ubuntu-branches/ubuntu/trusty/qemu/trusty

« back to all changes in this revision

Viewing changes to qdev-monitor.c

  • Committer: Package Import Robot
  • Author(s): Serge Hallyn
  • Date: 2013-10-22 22:47:07 UTC
  • mfrom: (1.8.3) (10.1.42 sid)
  • Revision ID: package-import@ubuntu.com-20131022224707-1lya34fw3k3f24tv
Tags: 1.6.0+dfsg-2ubuntu1
* Merge 1.6.0~rc0+dfsg-2exp from debian experimental.  Remaining changes:
  - debian/control
    * update maintainer
    * remove libiscsi, usb-redir, vde, vnc-jpeg, and libssh2-1-dev
      from build-deps
    * enable rbd
    * add qemu-system and qemu-common B/R to qemu-keymaps
    * add D:udev, R:qemu, R:qemu-common and B:qemu-common to
      qemu-system-common
    * qemu-system-arm, qemu-system-ppc, qemu-system-sparc:
      - add qemu-kvm to Provides
      - add qemu-common, qemu-kvm, kvm to B/R
      - remove openbios-sparc from qemu-system-sparc D
      - drop openbios-ppc and openhackware Depends to Suggests (for now)
    * qemu-system-x86:
      - add qemu-common to Breaks/Replaces.
      - add cpu-checker to Recommends.
    * qemu-user: add B/R:qemu-kvm
    * qemu-kvm:
      - add armhf armel powerpc sparc to Architecture
      - C/R/P: qemu-kvm-spice
    * add qemu-common package
    * drop qemu-slof which is not packaged in ubuntu
  - add qemu-system-common.links for tap ifup/down scripts and OVMF link.
  - qemu-system-x86.links:
    * remove pxe rom links which are in kvm-ipxe
    * add symlink for kvm.1 manpage
  - debian/rules
    * add kvm-spice symlink to qemu-kvm
    * call dh_installmodules for qemu-system-x86
    * update dh_installinit to install upstart script
    * run dh_installman (Closes: #709241) (cherrypicked from 1.5.0+dfsg-2)
  - Add qemu-utils.links for kvm-* symlinks.
  - Add qemu-system-x86.qemu-kvm.upstart and .default
  - Add qemu-system-x86.modprobe to set nesting=1
  - Add qemu-system-common.preinst to add kvm group
  - qemu-system-common.postinst: remove bad group acl if there, then have
    udev relabel /dev/kvm.
  - New linaro patches from qemu-linaro rebasing branch
  - Dropped patches:
    * xen-simplify-xen_enabled.patch
    * sparc-linux-user-fix-missing-symbols-in-.rel-.rela.plt-sections.patch
    * main_loop-do-not-set-nonblocking-if-xen_enabled.patch
    * xen_machine_pv-do-not-create-a-dummy-CPU-in-machine-.patch
    * virtio-rng-fix-crash
  - Kept patches:
    * expose_vms_qemu64cpu.patch - updated
    * linaro arm patches from qemu-linaro rebasing branch
  - New patches:
    * fix-pci-add: change CONFIG variable in ifdef to make sure that
      pci_add is defined.
* Add linaro patches
* Add experimental mach-virt patches for arm virtualization.
* qemu-system-common.install: add debian/tmp/usr/lib to install the
  qemu-bridge-helper

Show diffs side-by-side

added added

removed removed

Lines of Context:
75
75
    return (qdev_class_get_alias(dc) != NULL);
76
76
}
77
77
 
78
 
static void qdev_print_devinfo(ObjectClass *klass, void *opaque)
 
78
static void qdev_print_class_devinfo(DeviceClass *dc)
79
79
{
80
 
    DeviceClass *dc;
81
 
    bool *show_no_user = opaque;
82
 
 
83
 
    dc = (DeviceClass *)object_class_dynamic_cast(klass, TYPE_DEVICE);
84
 
 
85
 
    if (!dc || (show_no_user && !*show_no_user && dc->no_user)) {
 
80
    DeviceCategory category;
 
81
 
 
82
    if (!dc) {
86
83
        return;
87
84
    }
88
85
 
89
 
    error_printf("name \"%s\"", object_class_get_name(klass));
 
86
    error_printf("name \"%s\"", object_class_get_name(OBJECT_CLASS(dc)));
90
87
    if (dc->bus_type) {
91
88
        error_printf(", bus %s", dc->bus_type);
92
89
    }
93
90
    if (qdev_class_has_alias(dc)) {
94
91
        error_printf(", alias \"%s\"", qdev_class_get_alias(dc));
95
92
    }
 
93
    error_printf(", categories");
 
94
    for (category = 0; category < DEVICE_CATEGORY_MAX; ++category) {
 
95
        if (test_bit(category, dc->categories)) {
 
96
            error_printf(" \"%s\"", qdev_category_get_name(category));
 
97
        }
 
98
    }
96
99
    if (dc->desc) {
97
100
        error_printf(", desc \"%s\"", dc->desc);
98
101
    }
102
105
    error_printf("\n");
103
106
}
104
107
 
 
108
static void qdev_print_devinfo(ObjectClass *klass, void *opaque)
 
109
{
 
110
    DeviceClass *dc;
 
111
 
 
112
    dc = (DeviceClass *)object_class_dynamic_cast(klass, TYPE_DEVICE);
 
113
 
 
114
    qdev_print_class_devinfo(dc);
 
115
}
 
116
 
105
117
static int set_property(const char *name, const char *value, void *opaque)
106
118
{
107
119
    DeviceState *dev = opaque;
139
151
    return NULL;
140
152
}
141
153
 
 
154
static void qdev_print_category_devices(DeviceCategory category)
 
155
{
 
156
    DeviceClass *dc;
 
157
    GSList *list, *curr;
 
158
 
 
159
    list = object_class_get_list(TYPE_DEVICE, false);
 
160
    for (curr = list; curr; curr = g_slist_next(curr)) {
 
161
        dc = (DeviceClass *)object_class_dynamic_cast(curr->data, TYPE_DEVICE);
 
162
        if (!dc->no_user && test_bit(category, dc->categories)) {
 
163
            qdev_print_class_devinfo(dc);
 
164
        }
 
165
    }
 
166
    g_slist_free(list);
 
167
}
 
168
 
142
169
int qdev_device_help(QemuOpts *opts)
143
170
{
144
171
    const char *driver;
147
174
 
148
175
    driver = qemu_opt_get(opts, "driver");
149
176
    if (driver && is_help_option(driver)) {
150
 
        bool show_no_user = false;
151
 
        object_class_foreach(qdev_print_devinfo, TYPE_DEVICE, false, &show_no_user);
 
177
        DeviceCategory category;
 
178
        for (category = 0; category < DEVICE_CATEGORY_MAX; ++category) {
 
179
            qdev_print_category_devices(category);
 
180
        }
 
181
 
152
182
        return 1;
153
183
    }
154
184
 
360
390
 
361
391
        /* find device */
362
392
        if (sscanf(path+pos, "%127[^/]%n", elem, &len) != 1) {
363
 
            assert(0);
 
393
            g_assert_not_reached();
364
394
            elem[0] = len = 0;
365
395
        }
366
396
        pos += len;
397
427
 
398
428
        /* find bus */
399
429
        if (sscanf(path+pos, "%127[^/]%n", elem, &len) != 1) {
400
 
            assert(0);
 
430
            g_assert_not_reached();
401
431
            elem[0] = len = 0;
402
432
        }
403
433
        pos += len;