Commit e80084d3 authored by Peter Maydell's avatar Peter Maydell
Browse files

Merge remote-tracking branch 'remotes/mjt/tags/trivial-patches-2014-09-26' into staging



trivial patches for 2014-09-26

# gpg: Signature made Fri 26 Sep 2014 18:33:53 BST using RSA key ID A4C3D7DB
# gpg: Good signature from "Michael Tokarev <mjt@tls.msk.ru>"
# gpg:                 aka "Michael Tokarev <mjt@corpit.ru>"
# gpg:                 aka "Michael Tokarev <mjt@debian.org>"
# gpg: WARNING: This key is not certified with a trusted signature!
# gpg:          There is no indication that the signature belongs to the owner.
# Primary key fingerprint: 6EE1 95D1 886E 8FFB 810D  4324 457C E0A0 8044 65C5
#      Subkey fingerprint: 6F67 E18E 7C91 C5B1 5514  66A7 BEE5 9D74 A4C3 D7DB

* remotes/mjt/tags/trivial-patches-2014-09-26:
  os-posix: report error message when lock file failed
  os-posix: remove confused errno
  os-posix: change tab to space avoid violating coding style
  qapi: Update docs given recent event, spacing fixes
  qapi: Ignore files created during make check
  qapi: Consistent whitespace in tests/Makefile
  vmxcap: Update according to SDM of September 2014
  .travis.yml: remove "make check" from main matrix
  .travis.yml: pre-seed sub-modules for speed
  .travis.yml: make the make slightly more parallel
  .travis.yml: add more linux-user to the build matrix
  tests: avoid running duplicate qom-tests

Signed-off-by: default avatarPeter Maydell <peter.maydell@linaro.org>
parents 81ab11a7 e5048d15
Loading
Loading
Loading
Loading
+37 −18
Original line number Diff line number Diff line
@@ -12,7 +12,7 @@ notifications:
    on_failure: always
env:
  global:
    - TEST_CMD="make check"
    - TEST_CMD=""
    - EXTRA_CONFIG=""
    # Development packages, EXTRA_PKGS saved for additional builds
    - CORE_PKGS="libusb-1.0-0-dev libiscsi-dev librados-dev libncurses5-dev"
@@ -20,31 +20,51 @@ env:
    - GUI_PKGS="libgtk-3-dev libvte-2.90-dev libsdl1.2-dev libpng12-dev libpixman-1-dev"
    - EXTRA_PKGS=""
  matrix:
    # Group major targets together with their linux-user counterparts
    - TARGETS=alpha-softmmu,alpha-linux-user
    - TARGETS=arm-softmmu,arm-linux-user
    - TARGETS=aarch64-softmmu,aarch64-linux-user
    - TARGETS=cris-softmmu
    - TARGETS=i386-softmmu,x86_64-softmmu
    - TARGETS=lm32-softmmu
    - TARGETS=m68k-softmmu
    - TARGETS=microblaze-softmmu,microblazeel-softmmu
    - TARGETS=arm-softmmu,arm-linux-user,armeb-linux-user,aarch64-softmmu,aarch64-linux-user
    - TARGETS=cris-softmmu,cris-linux-user
    - TARGETS=i386-softmmu,i386-linux-user,x86_64-softmmu,x86_64-linux-user
    - TARGETS=m68k-softmmu,m68k-linux-user
    - TARGETS=microblaze-softmmu,microblazeel-softmmu,microblaze-linux-user,microblazeel-linux-user
    - TARGETS=mips-softmmu,mips64-softmmu,mips64el-softmmu,mipsel-softmmu
    - TARGETS=moxie-softmmu
    - TARGETS=or32-softmmu,
    - TARGETS=ppc-softmmu,ppc64-softmmu,ppcemb-softmmu
    - TARGETS=s390x-softmmu
    - TARGETS=sh4-softmmu,sh4eb-softmmu
    - TARGETS=sparc-softmmu,sparc64-softmmu
    - TARGETS=unicore32-softmmu
    - TARGETS=xtensa-softmmu,xtensaeb-softmmu
    - TARGETS=mips-linux-user,mips64-linux-user,mips64el-linux-user,mipsel-linux-user,mipsn32-linux-user,mipsn32el-linux-user
    - TARGETS=or32-softmmu,or32-linux-user
    - TARGETS=ppc-softmmu,ppc64-softmmu,ppcemb-softmmu,ppc-linux-user,ppc64-linux-user,ppc64abi32-linux-user,ppc64le-linux-user
    - TARGETS=s390x-softmmu,s390x-linux-user
    - TARGETS=sh4-softmmu,sh4eb-softmmu,sh4-linux-user sh4eb-linux-user
    - TARGETS=sparc-softmmu,sparc64-softmmu,sparc-linux-user,sparc32plus-linux-user,sparc64-linux-user
    - TARGETS=unicore32-softmmu,unicore32-linux-user
    # Group remaining softmmu only targets into one build
    - TARGETS=lm32-softmmu,moxie-softmmu,tricore-softmmu,xtensa-softmmu,xtensaeb-softmmu
git:
  # we want to do this ourselves
  submodules: false
before_install:
  - wget -O - http://people.linaro.org/~alex.bennee/qemu-submodule-git-seed.tar.xz | tar -xvJ
  - git submodule update --init --recursive
  - sudo apt-get update -qq
  - sudo apt-get install -qq ${CORE_PKGS} ${NET_PKGS} ${GUI_PKGS} ${EXTRA_PKGS}
script: "./configure --target-list=${TARGETS} ${EXTRA_CONFIG} && make && ${TEST_CMD}"
before_script:
  - ./configure --target-list=${TARGETS} --enable-debug-tcg ${EXTRA_CONFIG}
script:
  - make -j2 && ${TEST_CMD}
matrix:
  # We manually include a number of additional build for non-standard bits
  include:
    # Make check target (we only do this once)
    - env:
        - TARGETS=alpha-softmmu,arm-softmmu,aarch64-softmmu,cris-softmmu,
                  i386-softmmu,x86_64-softmmu,m68k-softmmu,microblaze-softmmu,
                  microblazeel-softmmu,mips-softmmu,mips64-softmmu,
                  mips64el-softmmu,mipsel-softmmu,or32-softmmu,ppc-softmmu,
                  ppc64-softmmu,ppcemb-softmmu,s390x-softmmu,sh4-softmmu,
                  sh4eb-softmmu,sparc-softmmu,sparc64-softmmu,
                  unicore32-softmmu,unicore32-linux-user,
                  lm32-softmmu,moxie-softmmu,tricore-softmmu,xtensa-softmmu,
                  xtensaeb-softmmu
          TEST_CMD="make check"
      compiler: gcc
    # Debug related options
    - env: TARGETS=i386-softmmu,x86_64-softmmu
           EXTRA_CONFIG="--enable-debug"
@@ -73,7 +93,6 @@ matrix:
      compiler: gcc
    - env: TARGETS=i386-softmmu,x86_64-softmmu
           EXTRA_CONFIG="--enable-trace-backends=ftrace"
           TEST_CMD=""
      compiler: gcc
    - env: TARGETS=i386-softmmu,x86_64-softmmu
          EXTRA_PKGS="liblttng-ust-dev liburcu-dev"
+80 −20
Original line number Diff line number Diff line
= How to use the QAPI code generator =

* Note: as of this writing, QMP does not use QAPI. Eventually QMP
commands will be converted to use QAPI internally. The following
information describes QMP/QAPI as it will exist after the
conversion.

QAPI is a native C API within QEMU which provides management-level
functionality to internal/external users. For external
users/processes, this interface is made available by a JSON-based
@@ -19,7 +14,7 @@ marshaling/dispatch code for the guest agent server running in the
guest.

This document will describe how the schemas, scripts, and resulting
code is used.
code are used.


== QMP/Guest agent schema ==
@@ -234,6 +229,7 @@ Resulting in this JSON object:
  "data": { "b": "test string" },
  "timestamp": { "seconds": 1267020223, "microseconds": 435656 } }


== Code generation ==

Schemas are fed into 3 scripts to generate all the code/files that, paired
@@ -256,6 +252,8 @@ command which takes that type as a parameter and returns the same type:
      'data':    {'arg1': 'UserDefOne'},
      'returns': 'UserDefOne' }

    { 'event': 'MY_EVENT' }

=== scripts/qapi-types.py ===

Used to generate the C types defined by a schema. The following files are
@@ -451,6 +449,8 @@ $(prefix)qmp-commands.h: Function prototypes for the QMP commands

Example:

    $ python scripts/qapi-commands.py --output-dir="qapi-generated"
    --prefix="example-" --input-file=example-schema.json
    $ cat qapi-generated/example-qmp-marshal.c
[Uninteresting stuff omitted...]

@@ -528,3 +528,63 @@ Example:
    UserDefOne *qmp_my_command(UserDefOne *arg1, Error **errp);

    #endif

=== scripts/qapi-event.py ===

Used to generate the event-related C code defined by a schema. The
following files are created:

$(prefix)qapi-event.h - Function prototypes for each event type, plus an
                        enumeration of all event names
$(prefix)qapi-event.c - Implementation of functions to send an event

Example:

    $ python scripts/qapi-event.py --output-dir="qapi-generated"
    --prefix="example-" --input-file=example-schema.json
    $ cat qapi-generated/example-qapi-event.c
[Uninteresting stuff omitted...]

    void qapi_event_send_my_event(Error **errp)
    {
        QDict *qmp;
        Error *local_err = NULL;
        QMPEventFuncEmit emit;
        emit = qmp_event_get_func_emit();
        if (!emit) {
            return;
        }

        qmp = qmp_event_build_dict("MY_EVENT");

        emit(EXAMPLE_QAPI_EVENT_MY_EVENT, qmp, &local_err);

        error_propagate(errp, local_err);
        QDECREF(qmp);
    }

    const char *EXAMPLE_QAPIEvent_lookup[] = {
        "MY_EVENT",
        NULL,
    };
    $ cat qapi-generated/example-qapi-event.h
[Uninteresting stuff omitted...]

    #ifndef EXAMPLE_QAPI_EVENT_H
    #define EXAMPLE_QAPI_EVENT_H

    #include "qapi/error.h"
    #include "qapi/qmp/qdict.h"
    #include "example-qapi-types.h"


    void qapi_event_send_my_event(Error **errp);

    extern const char *EXAMPLE_QAPIEvent_lookup[];
    typedef enum EXAMPLE_QAPIEvent
    {
        EXAMPLE_QAPI_EVENT_MY_EVENT = 0,
        EXAMPLE_QAPI_EVENT_MAX = 1,
    } EXAMPLE_QAPIEvent;

    #endif
+45 −38
Original line number Diff line number Diff line
@@ -206,8 +206,9 @@ void os_daemonize(void)
    if (daemonize) {
        pid_t pid;

	if (pipe(fds) == -1)
        if (pipe(fds) == -1) {
            exit(1);
        }

        pid = fork();
        if (pid > 0) {
@@ -218,18 +219,21 @@ void os_daemonize(void)

        again:
            len = read(fds[0], &status, 1);
            if (len == -1 && (errno == EINTR))
            if (len == -1 && (errno == EINTR)) {
                goto again;

            if (len != 1)
            }
            if (len != 1) {
                exit(1);
            }
            else if (status == 1) {
                fprintf(stderr, "Could not acquire pidfile: %s\n", strerror(errno));
                fprintf(stderr, "Could not acquire pidfile\n");
                exit(1);
            } else
            } else {
                exit(0);
	} else if (pid < 0)
            }
            } else if (pid < 0) {
                exit(1);
            }

        close(fds[0]);
        qemu_set_cloexec(fds[1]);
@@ -237,11 +241,11 @@ void os_daemonize(void)
        setsid();

        pid = fork();
	if (pid > 0)
        if (pid > 0) {
            exit(0);
	else if (pid < 0)
        } else if (pid < 0) {
            exit(1);

        }
        umask(027);

        signal(SIGTSTP, SIG_IGN);
@@ -260,20 +264,21 @@ void os_setup_post(void)

    again1:
        len = write(fds[1], &status, 1);
	if (len == -1 && (errno == EINTR))
        if (len == -1 && (errno == EINTR)) {
            goto again1;

	if (len != 1)
        }
        if (len != 1) {
            exit(1);

        }
        if (chdir("/")) {
            perror("not able to chdir to /");
            exit(1);
        }
        TFR(fd = qemu_open("/dev/null", O_RDWR));
	if (fd == -1)
        if (fd == -1) {
            exit(1);
        }
    }

    change_root();
    change_process_uid();
@@ -314,6 +319,8 @@ int qemu_create_pidfile(const char *filename)
        return -1;
    }
    if (lockf(fd, F_TLOCK, 0) == -1) {
        fprintf(stderr, "lock file '%s' failed: %s\n",
                filename, strerror(errno));
        close(fd);
        return -1;
    }
+6 −4
Original line number Diff line number Diff line
@@ -99,7 +99,7 @@ controls = [
    Misc(
        name = 'Basic VMX Information',
        bits = {
            (0, 31): 'Revision',
            (0, 30): 'Revision',
            (32,44): 'VMCS size',
            48: 'VMCS restricted to 32 bit addresses',
            49: 'Dual-monitor support',
@@ -169,7 +169,9 @@ controls = [
            12: 'Enable INVPCID',
            13: 'Enable VM functions',
            14: 'VMCS shadowing',
            18: 'EPT-violation #VE'
            16: 'RDSEED exiting',
            18: 'EPT-violation #VE',
            20: 'Enable XSAVES/XRSTORS',
            },
        cap_msr = MSR_IA32_VMX_PROCBASED_CTLS2,
        ),
@@ -195,7 +197,7 @@ controls = [
        name = 'VM-Entry controls',
        bits = {
            2: 'Load debug controls',
            9: 'IA-64 mode guest',
            9: 'IA-32e mode guest',
            10: 'Entry to SMM',
            11: 'Deactivate dual-monitor treatment',
            13: 'Load IA32_PERF_GLOBAL_CTRL',
@@ -216,7 +218,7 @@ controls = [
            8: 'Wait-for-SIPI activity state',
            15: 'IA32_SMBASE support',
            (16,24): 'Number of CR3-target values',
            (25,27): 'MSR-load/store count recommenation',
            (25,27): 'MSR-load/store count recommendation',
            28: 'IA32_SMM_MONITOR_CTL[2] can be set to 1',
            29: 'VMWRITE to VM-exit information fields',
            (32,63): 'MSEG revision identifier',
+3 −0
Original line number Diff line number Diff line
@@ -14,11 +14,14 @@ test-int128
test-iov
test-mul64
test-opts-visitor
test-qapi-event.[ch]
test-qapi-types.[ch]
test-qapi-visit.[ch]
test-qdev-global-props
test-qemu-opts
test-qmp-commands
test-qmp-commands.h
test-qmp-event
test-qmp-input-strict
test-qmp-input-visitor
test-qmp-marshal.c
Loading