1. 12 Mar, 2018 1 commit
  2. 06 Mar, 2018 1 commit
  3. 05 Mar, 2018 1 commit
  4. 02 Mar, 2018 5 commits
    • Markus Armbruster's avatar
      qapi: Move qapi-schema.json to qapi/, rename generated files · eb815e24
      Markus Armbruster authored
      Move qapi-schema.json to qapi/, so it's next to its modules, and all
      files get generated to qapi/, not just the ones generated for modules.
      Consistently name the generated files qapi-MODULE.EXT:
      qmp-commands.[ch] become qapi-commands.[ch], qapi-event.[ch] become
      qapi-events.[ch], and qmp-introspect.[ch] become qapi-introspect.[ch].
      This gets rid of the temporary hacks in scripts/qapi/commands.py,
      scripts/qapi/events.py, and scripts/qapi/common.py.
      Signed-off-by: 's avatarMarkus Armbruster <armbru@redhat.com>
      Message-Id: <20180211093607.27351-28-armbru@redhat.com>
      Reviewed-by: 's avatarEric Blake <eblake@redhat.com>
      Reviewed-by: 's avatarMarc-André Lureau <marcandre.lureau@redhat.com>
      Reviewed-by: 's avatarMichael Roth <mdroth@linux.vnet.ibm.com>
      [eblake: Fix trailing dot in tpm.c, undo temporary hack for OSX toolchain]
      Signed-off-by: 's avatarEric Blake <eblake@redhat.com>
    • Markus Armbruster's avatar
      qapi: Empty out qapi-schema.json · 112ed241
      Markus Armbruster authored
      The previous commit improved compile time by including less of the
      generated QAPI headers.  This is impossible for stuff defined directly
      in qapi-schema.json, because that ends up in headers that that pull in
      Move everything but include directives from qapi-schema.json to new
      sub-module qapi/misc.json, then include just the "misc" shard where
      It's possible everywhere, except:
      * monitor.c needs qmp-command.h to get qmp_init_marshal()
      * monitor.c, ui/vnc.c and the generated qapi-event-FOO.c need
        qapi-event.h to get enum QAPIEvent
      Perhaps we'll get rid of those some other day.
      Adding a type to qapi/migration.json now recompiles some 120 instead
      of 2300 out of 5100 objects.
      Signed-off-by: 's avatarMarkus Armbruster <armbru@redhat.com>
      Message-Id: <20180211093607.27351-25-armbru@redhat.com>
      [eblake: rebase to master]
      Signed-off-by: 's avatarEric Blake <eblake@redhat.com>
    • Markus Armbruster's avatar
      qapi: Generate separate .h, .c for each module · 252dc310
      Markus Armbruster authored
      Our qapi-schema.json is composed of modules connected by include
      directives, but the generated code is monolithic all the same: one
      qapi-types.h with all the types, one qapi-visit.h with all the
      visitors, and so forth.  These monolithic headers get included all
      over the place.  In my "build everything" tree, adding a QAPI type
      recompiles about 4800 out of 5100 objects.
      We wouldn't write such monolithic headers by hand.  It stands to
      reason that we shouldn't generate them, either.
      Split up generated qapi-types.h to mirror the schema's modular
      structure: one header per module.  Name the main module's header
      qapi-types.h, and sub-module D/B.json's header D/qapi-types-B.h.
      Mirror the schema's includes in the headers, so that qapi-types.h gets
      you everything exactly as before.  If you need less, you can include
      one or more of the sub-module headers.  To be exploited shortly.
      Split up qapi-types.c, qapi-visit.h, qapi-visit.c, qmp-commands.h,
      qmp-commands.c, qapi-event.h, qapi-event.c the same way.
      qmp-introspect.h, qmp-introspect.c and qapi.texi remain monolithic.
      The split of qmp-commands.c duplicates static helper function
      qmp_marshal_output_str() in qapi-commands-char.c and
      qapi-commands-misc.c.  This happens when commands returning the same
      type occur in multiple modules.  Not worth avoiding.
      Since I'm going to rename qapi-event.[ch] to qapi-events.[ch], and
      qmp-commands.[ch] to qapi-commands.[ch], name the shards that way
      already, to reduce churn.  This requires temporary hacks in
      commands.py and events.py.  Similarly, c_name() must temporarily
      be taught to munge '/' in common.py.  They'll go away with the rename.
      Signed-off-by: 's avatarMarkus Armbruster <armbru@redhat.com>
      Message-Id: <20180211093607.27351-23-armbru@redhat.com>
      Reviewed-by: 's avatarEric Blake <eblake@redhat.com>
      [eblake: declare a dummy variable in each .c file, to shut up OSX
      toolchain warnings about empty .o files, including hacking c_name()]
      Signed-off-by: 's avatarEric Blake <eblake@redhat.com>
    • Markus Armbruster's avatar
      qapi/types qapi/visit: Generate built-in stuff into separate files · cdb6610a
      Markus Armbruster authored
      Linking code from multiple separate QAPI schemata into the same
      program is possible, but involves some weirdness around built-in
      * We generate code for built-in types into .c only with option
        --builtins.  The user is responsible for generating code for exactly
        one QAPI schema per program with --builtins.
      * We generate code for built-in types into .h regardless of
        --builtins, but guarded by #ifndef QAPI_VISIT_BUILTIN.  Because all
        copies of this code are exactly the same, including any combination
        of these headers works.
      Replace this contraption by something more conventional: generate code
      for built-in types into their very own files: qapi-builtin-types.c,
      qapi-builtin-visit.c, qapi-builtin-types.h, qapi-builtin-visit.h, but
      only with --builtins.  Obey --output-dir, but ignore --prefix for
      Make qapi-types.h include qapi-builtin-types.h.  With multiple
      schemata you now have multiple qapi-types.[ch], but only one
      qapi-builtin-types.[ch].  Same for qapi-visit.[ch] and
      Bonus: if all you need is built-in stuff, you can include a much
      smaller header.  To be exploited shortly.
      Signed-off-by: 's avatarMarkus Armbruster <armbru@redhat.com>
      Message-Id: <20180211093607.27351-21-armbru@redhat.com>
      Reviewed-by: 's avatarEric Blake <eblake@redhat.com>
      Reviewed-by: 's avatarMarc-André Lureau <marcandre.lureau@redhat.com>
      Reviewed-by: 's avatarMichael Roth <mdroth@linux.vnet.ibm.com>
      [eblake: fix octal constant for python 3]
      Signed-off-by: 's avatarEric Blake <eblake@redhat.com>
    • Markus Armbruster's avatar
      qapi: Rename generated qmp-marshal.c to qmp-commands.c · 834a3f34
      Markus Armbruster authored
      All generated .c are named like their .h, except for qmp-marshal.c and
      qmp-commands.h.  To add to the confusion, tests-qmp-commands.c falsely
      matches generated test-qmp-commands.h.
      Get rid of this unnecessary complication.
      Signed-off-by: 's avatarMarkus Armbruster <armbru@redhat.com>
      Message-Id: <20180211093607.27351-19-armbru@redhat.com>
      Reviewed-by: 's avatarEric Blake <eblake@redhat.com>
      Reviewed-by: 's avatarMarc-André Lureau <marcandre.lureau@redhat.com>
      Reviewed-by: 's avatarMichael Roth <mdroth@linux.vnet.ibm.com>
      Signed-off-by: 's avatarEric Blake <eblake@redhat.com>
  5. 19 Feb, 2018 2 commits
  6. 16 Feb, 2018 1 commit
  7. 31 Jan, 2018 1 commit
  8. 24 Jan, 2018 1 commit
  9. 18 Jan, 2018 1 commit
  10. 09 Jan, 2018 1 commit
  11. 25 Oct, 2017 1 commit
  12. 10 Oct, 2017 1 commit
  13. 21 Sep, 2017 1 commit
    • Paolo Bonzini's avatar
      scsi, file-posix: add support for persistent reservation management · 7c9e5276
      Paolo Bonzini authored
      It is a common requirement for virtual machine to send persistent
      reservations, but this currently requires either running QEMU with
      CAP_SYS_RAWIO, or using out-of-tree patches that let an unprivileged
      QEMU bypass Linux's filter on SG_IO commands.
      As an alternative mechanism, the next patches will introduce a
      privileged helper to run persistent reservation commands without
      expanding QEMU's attack surface unnecessarily.
      The helper is invoked through a "pr-manager" QOM object, to which
      file-posix.c passes SG_IO requests for PERSISTENT RESERVE OUT and
      PERSISTENT RESERVE IN commands.  For example:
        $ qemu-system-x86_64
            -device virtio-scsi \
            -object pr-manager-helper,id=helper0,path=/var/run/qemu-pr-helper.sock
            -drive if=none,id=hd,driver=raw,file.filename=/dev/sdb,file.pr-manager=helper0
            -device scsi-block,drive=hd
        $ qemu-system-x86_64
            -device virtio-scsi \
            -object pr-manager-helper,id=helper0,path=/var/run/qemu-pr-helper.sock
            -blockdev node-name=hd,driver=raw,file.driver=host_device,file.filename=/dev/sdb,file.pr-manager=helper0
            -device scsi-block,drive=hd
      Multiple pr-manager implementations are conceivable and possible, though
      only one is implemented right now.  For example, a pr-manager could:
      - talk directly to the multipath daemon from a privileged QEMU
        (i.e. QEMU links to libmpathpersist); this makes reservation work
        properly with multipath, but still requires CAP_SYS_RAWIO
      - use the Linux IOC_PR_* ioctls (they require CAP_SYS_ADMIN though)
      - more interestingly, implement reservations directly in QEMU
        through file system locks or a shared database (e.g. sqlite)
      Signed-off-by: 's avatarPaolo Bonzini <pbonzini@redhat.com>
  14. 19 Sep, 2017 1 commit
  15. 18 Sep, 2017 1 commit
  16. 15 Sep, 2017 1 commit
  17. 20 Jul, 2017 1 commit
  18. 11 Jul, 2017 1 commit
  19. 10 Jul, 2017 1 commit
    • Vladimir Sementsov-Ogievskiy's avatar
      nbd: use generic trace subsystem instead of TRACE macro · 9588463e
      Vladimir Sementsov-Ogievskiy authored
      Let NBD use the trace mechanisms already present in qemu. Now you can
      use the -trace optino of qemu, or the -T/--trace option of qemu-img,
      qemu-io, and qemu-nbd, to select nbd traces. For qemu, the QMP commands
      trace-event-{get,set}-state can also toggle tracing on the fly.
         qemu-nbd --trace 'nbd_*' <image file> # enables all nbd traces
      Recompilation with CFLAGS=-DDEBUG_NBD is no more needed, furthermore,
      DEBUG_NBD macro is removed from the code.
      Signed-off-by: 's avatarVladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
      Message-Id: <20170707152918.23086-11-vsementsov@virtuozzo.com>
      [eblake: minor tweaks to a couple of traces]
      Signed-off-by: 's avatarEric Blake <eblake@redhat.com>
  20. 04 Jul, 2017 1 commit
  21. 15 Jun, 2017 4 commits
  22. 02 Jun, 2017 1 commit
  23. 17 May, 2017 1 commit
  24. 20 Mar, 2017 1 commit
  25. 21 Feb, 2017 1 commit
  26. 20 Feb, 2017 1 commit
  27. 31 Jan, 2017 6 commits