Skip to content
Snippets Groups Projects
  1. Jul 23, 2012
    • Laszlo Ersek's avatar
      convert net_client_init() to OptsVisitor · 6687b79d
      Laszlo Ersek authored
      
      The net_client_init() prototype is kept intact.
      
      Based on "is_netdev", the QemuOpts-rooted QemuOpt-list is parsed as a
      Netdev or a NetLegacy. The original meat of net_client_init() is moved to
      and simplified in net_client_init1():
      
      Fields not common between -net and -netdev are clearly separated. Getting
      the name for the init functions is cleaner: Netdev::id is mandatory, and
      all init functions handle a NULL NetLegacy::name. NetLegacy::vlan
      explicitly depends on -net (see below).
      
      Verifying the "type=" option for -netdev can be turned into a switch.
      
      Format validation with qemu_opts_validate() can be removed because the
      visitor covers it. Relatedly, the "net_client_types" array is reduced to
      an array of init functions that can be directly indexed by opts->kind.
      (Help text is available in the schema JSON.)
      
      The outermost negation in the condition around qemu_find_vlan() was
      flattened, because it expresses the dependent code's requirements more
      clearly.
      
      VLAN lookup is avoided if there's no init function to pass the VLAN to.
      
      Whenever the value of type=... is needed, we substitute
      NetClientOptionsKind_lookup[kind].
      
      The individual init functions are not converted yet, thus the original
      QemuOpts instance is passed transparently.
      
      v1->v2:
      - NetLegacy::name is optional. Tracked it through all init functions: they
        all handle a NULL name. Updated commit message accordingly.
      
      v2->v3:
      - NetLegacy::id is allowed and takes precedence over NetLegacy::name.
      
      Signed-off-by: default avatarLaszlo Ersek <lersek@redhat.com>
      Signed-off-by: default avatarStefan Hajnoczi <stefanha@linux.vnet.ibm.com>
      6687b79d
    • Laszlo Ersek's avatar
      hw, net: "net_client_type" -> "NetClientOptionsKind" (qapi-generated) · 2be64a68
      Laszlo Ersek authored
      
      NET_CLIENT_TYPE_ -> NET_CLIENT_OPTIONS_KIND_
      
      Signed-off-by: default avatarLaszlo Ersek <lersek@redhat.com>
      Signed-off-by: default avatarStefan Hajnoczi <stefanha@linux.vnet.ibm.com>
      2be64a68
    • Laszlo Ersek's avatar
      qapi schema: add Netdev types · 14aa0c2d
      Laszlo Ersek authored
      
      NetdevTapOptions::sndbuf and NetdevDumpOptions::len use the new "size"
      type.
      
      v1->v2:
      - NetLegacy::name is optional
      - NetLegacyNicOptions::vectors is of type uint32
      - NetdevVdeOptions::port and ::mode are of type uint16
      - NetLegacy::vlan has type int32
      
      v2->v3:
      - NetLegacy::id is allowed and takes precedence over NetLegacy::name
      - replace "@traits" with "@opts" in NetLegacy & Netdev descriptions
      
      Signed-off-by: default avatarLaszlo Ersek <lersek@redhat.com>
      Signed-off-by: default avatarStefan Hajnoczi <stefanha@linux.vnet.ibm.com>
      14aa0c2d
    • Laszlo Ersek's avatar
      b80e560b
    • Laszlo Ersek's avatar
      qapi: introduce OptsVisitor · eb7ee2cb
      Laszlo Ersek authored
      
      This visitor supports parsing
      
        -option [type=]discriminator[,optarg1=val1][,optarg2=val2][,...]
      
      style QemuOpts objects into "native" C structures. After defining the type
      tree in the qapi schema (see below), a root type traversal with this
      visitor linked to the underlying QemuOpts object will build the "native" C
      representation of the option.
      
      The type tree in the schema, corresponding to an option with a
      discriminator, must have the following structure:
      
        struct
          scalar member for non-discriminated optarg 1 [*]
          list for repeating non-discriminated optarg 2 [*]
            wrapper struct
              single scalar member
          union
            struct for discriminator case 1
              scalar member for optarg 3 [*]
              list for repeating optarg 4 [*]
                wrapper struct
                  single scalar member
              scalar member for optarg 5 [*]
            struct for discriminator case 2
              ...
      
      The "type" optarg name is fixed for the discriminator role. Its schema
      representation is "union of structures", and each discriminator value must
      correspond to a member name in the union.
      
      If the option takes no "type" descriminator, then the type subtree rooted
      at the union must be absent from the schema (including the union itself).
      
      Optarg values can be of scalar types str / bool / integers / size.
      
      Members marked with [*] may be defined as optional in the schema,
      describing an optional optarg.
      
      Repeating an optarg is supported; its schema representation must be "list
      of structure with single mandatory scalar member". If an optarg is not
      described as repeating in the schema (ie. it is defined as a scalar field
      instead of a list), its last occurrence will take effect. Ordering between
      differently named optargs is not preserved.
      
      A mandatory list (or an optional one which is reported to be available),
      corresponding to a repeating optarg, has at least one element after
      successful parsing.
      
      v1->v2:
      - Update opts_type_size() prototype to uint64_t.
      - Add opts_type_uint64() for options needing the full uint64_t range.
        (Internals could be extracted to "cutils.c".)
      - Allow negative values in opts_type_int().
      - Rebase to nested Makefiles.
      
      v2->v3:
      - Factor opts_visitor_insert() out of opts_start_struct() and call it
        separately for opts_root->id if there's any.
      - Don't require non-negative values in opts_type_int()'s error message.
      - g_malloc0() may return NULL for zero-sized requests. Support empty
        structures by requesting 1 byte for them instead.
      
      Signed-off-by: default avatarLaszlo Ersek <lersek@redhat.com>
      Signed-off-by: default avatarStefan Hajnoczi <stefanha@linux.vnet.ibm.com>
      eb7ee2cb
    • Laszlo Ersek's avatar
      expose QemuOpt and QemuOpts struct definitions to interested parties · fdb17976
      Laszlo Ersek authored
      
      The only clients should be the existent "qemu-option.c", and the upcoming
      "qapi/opts-visitor.c".
      
      Signed-off-by: default avatarLaszlo Ersek <lersek@redhat.com>
      Signed-off-by: default avatarStefan Hajnoczi <stefanha@linux.vnet.ibm.com>
      fdb17976
    • Laszlo Ersek's avatar
      qapi: introduce "size" type · 092705d4
      Laszlo Ersek authored
      
      v1->v2:
      - fall back to uint64 rather than int
      
      Signed-off-by: default avatarLaszlo Ersek <lersek@redhat.com>
      Signed-off-by: default avatarStefan Hajnoczi <stefanha@linux.vnet.ibm.com>
      092705d4
    • Laszlo Ersek's avatar
    • Laszlo Ersek's avatar
    • Paolo Bonzini's avatar
      qapi: fix error propagation · d195325b
      Paolo Bonzini authored
      
      Don't overwrite / leak previously set errors.
      Make traversal cope with missing mandatory sub-structs.
      Don't try to end a container that could not be started.
      
      v1->v2:
      - unchanged
      
      v2->v3:
      - instead of examining, assert that we never overwrite errors with
        error_set()
      - allow visitors to set a NULL struct pointer successfully, so traversal
        of incomplete objects can continue
      - check for a NULL "obj" before accessing "(*obj)->has_XXX" (this is not a
        typo, "obj != NULL" implies "*obj != NULL" here)
      - fix start_struct / end_struct balance for unions as well
      
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      Signed-off-by: default avatarLaszlo Ersek <lersek@redhat.com>
      Signed-off-by: default avatarStefan Hajnoczi <stefanha@linux.vnet.ibm.com>
      d195325b
    • Stefan Hajnoczi's avatar
      MAINTAINERS: Replace net maintainer Mark McLoughlin with Stefan Hajnoczi · 837c36e7
      Stefan Hajnoczi authored
      
      The net subsystem has lacked an active maintainer since 2009.  I have
      built and tested a net-next tree to get the ball rolling again.
      
      Signed-off-by: default avatarStefan Hajnoczi <stefanha@linux.vnet.ibm.com>
      837c36e7
  2. Jul 19, 2012
  3. Jul 18, 2012
    • Anthony Liguori's avatar
      Merge remote-tracking branch 'kwolf/for-anthony' into staging · dfe1ce5d
      Anthony Liguori authored
      * kwolf/for-anthony: (41 commits)
        fdc-test: Clean up a bit
        fdc-test: introduce test_relative_seek
        fdc: fix relative seek
        qemu-iotests: Valgrind support
        coroutine-ucontext: Help valgrind understand coroutines
        qemu-io: Fix memory leaks
        hw/block-common: Factor out fall back to legacy -drive cyls=...
        blockdev: Don't limit DriveInfo serial to 20 characters
        hw/block-common: Factor out fall back to legacy -drive serial=...
        hw/block-common: Move BlockConf & friends from block.h
        Relax IDE CHS limits from 16383,16,63 to 65535,16,255
        blockdev: Drop redundant CHS validation for if=ide
        hd-geometry: Compute BIOS CHS translation in one place
        qtest: Test we don't put hard disk info into CMOS for a CD-ROM
        ide pc: Put hard disk info into CMOS only for hard disks
        block: Geometry and translation hints are now useless, purge them
        qtest: Cover qdev property for BIOS CHS translation
        ide: qdev property for BIOS CHS translation
        qdev: New property type chs-translation
        qdev: Collect private helpers in one place
        ...
      dfe1ce5d
    • Anthony Liguori's avatar
      Merge remote-tracking branch 'qemu-kvm/uq/master' into staging · 09f06a6c
      Anthony Liguori authored
      * qemu-kvm/uq/master:
        virtio: move common irqfd handling out of virtio-pci
        virtio: move common ioeventfd handling out of virtio-pci
        event_notifier: add event_notifier_set_handler
        memory: pass EventNotifier, not eventfd
        ivshmem: wrap ivshmem_del_eventfd loops with transaction
        ivshmem: use EventNotifier and memory API
        event_notifier: add event_notifier_init_fd
        event_notifier: remove event_notifier_test
        event_notifier: add event_notifier_set
        apic: Defer interrupt updates to VCPU thread
        apic: Reevaluate pending interrupts on LVT_LINT0 changes
        apic: Resolve potential endless loop around apic_update_irq
        kvm: expose tsc deadline timer feature to guest
        kvm_pv_eoi: add flag support
        kvm: Don't abort on kvm_irqchip_add_msi_route()
      09f06a6c
    • Anthony Liguori's avatar
      Merge remote-tracking branch 'qmp/queue/qmp' into staging · 513e6bde
      Anthony Liguori authored
      * qmp/queue/qmp:
        qapi: Convert getfd and closefd
        qapi: input_type_enum(): fix error message
        qmp: dump-guest-memory: improve schema doc
      513e6bde
    • Anthony Liguori's avatar
      Merge remote-tracking branch 'kraxel/bios.2' into staging · 052bb77a
      Anthony Liguori authored
      * kraxel/bios.2:
        Add vgabios build rules to roms/Makefile
      052bb77a
    • Anthony Liguori's avatar
      Merge remote-tracking branch 'kraxel/usb.57' into staging · 83199ca4
      Anthony Liguori authored
      * kraxel/usb.57:
        ehci: improve expire time calculation
        ehci: implement Interrupt Threshold Control support
        ehci: raise irq in the frame timer
        uhci: initialize expire_time when loading v1 vmstate
        usb: add usb attached scsi emulation
        scsi: add free_request callback
      83199ca4
  4. Jul 17, 2012
Loading