]> git.proxmox.com Git - mirror_qemu.git/commitdiff
Merge remote-tracking branch 'remotes/vivier2/tags/trivial-branch-for-5.2-pull-reques...
authorPeter Maydell <peter.maydell@linaro.org>
Tue, 22 Sep 2020 14:42:23 +0000 (15:42 +0100)
committerPeter Maydell <peter.maydell@linaro.org>
Tue, 22 Sep 2020 14:42:23 +0000 (15:42 +0100)
Pull request trivial patches 20200919

# gpg: Signature made Sat 19 Sep 2020 19:43:35 BST
# gpg:                using RSA key CD2F75DDC8E3A4DC2E4F5173F30C38BD3F2FBE3C
# gpg:                issuer "laurent@vivier.eu"
# gpg: Good signature from "Laurent Vivier <lvivier@redhat.com>" [full]
# gpg:                 aka "Laurent Vivier <laurent@vivier.eu>" [full]
# gpg:                 aka "Laurent Vivier (Red Hat) <lvivier@redhat.com>" [full]
# Primary key fingerprint: CD2F 75DD C8E3 A4DC 2E4F  5173 F30C 38BD 3F2F BE3C

* remotes/vivier2/tags/trivial-branch-for-5.2-pull-request:
  contrib/: fix some comment spelling errors
  qapi/: fix some comment spelling errors
  disas/: fix some comment spelling errors
  linux-user/: fix some comment spelling errors
  util/: fix some comment spelling errors
  scripts/: fix some comment spelling errors
  docs/: fix some comment spelling errors
  migration/: fix some comment spelling errors
  qemu/: fix some comment spelling errors
  scripts/git.orderfile: Display meson files along with buildsys ones
  hw/timer/hpet: Fix debug format strings
  hw/timer/hpet: Remove unused functions hpet_ram_readb, hpet_ram_readw
  meson: remove empty else and duplicated gio deps
  manual: escape backslashes in "parsed-literal" blocks
  ui/spice-input: Remove superfluous forward declaration
  hw/ppc/ppc4xx_pci: Replace magic value by the PCI_NUM_PINS definition
  hw/gpio/max7310: Remove impossible check

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
1  2 
configure
docs/system/arm/aspeed.rst
hw/gpio/max7310.c
hw/ppc/ppc4xx_pci.c
hw/timer/hpet.c
migration/rdma.c
scsi/pr-manager-helper.c
util/osdep.c

diff --combined configure
index 756447900855e0b886ec6eb4e6b6aecf48c20a97,c74d79bfbc245701bf1a709335bdd045d2bd57cb..e8e8e984f245578b07955caaaf4dfbd40fce2727
+++ b/configure
@@@ -280,9 -280,6 +280,9 @@@ supported_whpx_target() 
      return 1
  }
  
 +deprecated_targets_list=ppc64abi32-linux-user,tilegx-linux-user,lm32-softmmu,unicore32-softmmu
 +deprecated_features=""
 +
  supported_target() {
      case "$1" in
          *-softmmu)
              return 1
              ;;
      esac
 +
 +    # if a deprecated target is enabled we note it here
 +    if echo "$deprecated_targets_list" | grep -q "$1"; then
 +        add_to deprecated_features $1
 +    fi
 +
      test "$tcg" = "yes" && return 0
      supported_kvm_target "$1" && return 0
      supported_xen_target "$1" && return 0
@@@ -551,6 -542,8 +551,6 @@@ gettext="
  bogus_os="no"
  malloc_trim=""
  
 -deprecated_features=""
 -
  # parse CC options first
  for opt do
    optarg=$(expr "x$opt" : 'x[^=]*=\(.*\)')
@@@ -1729,19 -1722,22 +1729,19 @@@ if [ "$bsd_user" = "yes" ]; the
      mak_wilds="${mak_wilds} $source_path/default-configs/*-bsd-user.mak"
  fi
  
 -if test -z "$target_list_exclude" -a -z "$target_list"; then
 -    # if the user doesn't specify anything lets skip deprecating stuff
 -    target_list_exclude=ppc64abi32-linux-user
 +# If the user doesn't explicitly specify a deprecated target we will
 +# skip it.
 +if test -z "$target_list"; then
 +    if test -z "$target_list_exclude"; then
 +        target_list_exclude="$deprecated_targets_list"
 +    else
 +        target_list_exclude="$target_list_exclude,$deprecated_targets_list"
 +    fi
  fi
  
 -exclude_list=$(echo "$target_list_exclude" | sed -e 's/,/ /g')
  for config in $mak_wilds; do
      target="$(basename "$config" .mak)"
 -    exclude="no"
 -    for excl in $exclude_list; do
 -        if test "$excl" = "$target"; then
 -            exclude="yes"
 -            break;
 -        fi
 -    done
 -    if test "$exclude" = "no"; then
 +    if echo "$target_list_exclude" | grep -vq "$target"; then
          default_target_list="${default_target_list} $target"
      fi
  done
@@@ -3415,7 -3411,7 +3415,7 @@@ EO
      xfs="yes"
    else
      if test "$xfs" = "yes" ; then
-       feature_not_found "xfs" "Instal xfsprogs/xfslibs devel"
+       feature_not_found "xfs" "Install xfsprogs/xfslibs devel"
      fi
      xfs=no
    fi
@@@ -7672,6 -7668,7 +7672,6 @@@ case "$target_name" i
      TARGET_SYSTBL_ABI=common,nospu,32
      echo "TARGET_ABI32=y" >> $config_target_mak
      gdb_xml_files="power64-core.xml power-fpu.xml power-altivec.xml power-spe.xml power-vsx.xml"
 -    deprecated_features="ppc64abi32 ${deprecated_features}"
    ;;
    riscv32)
      TARGET_BASE_ARCH=riscv
index 2d33d023453e62660f329c650300d1dbce3a4f3a,fe45840fbe15df9be4ff18fa00e76b2421323e25..b7a176659cb271ff13040873e11ff46c2efd05e4
@@@ -72,7 -72,7 +72,7 @@@ Boot option
  ------------
  
  The Aspeed machines can be started using the -kernel option to load a
- Linux kernel or from a firmare image which can be downloaded from the
+ Linux kernel or from a firmware image which can be downloaded from the
  OpenPOWER jenkins :
  
     https://openpower.xyz/
@@@ -83,21 -83,3 +83,21 @@@ The image should be attached as an MTD 
  
    $ qemu-system-arm -M romulus-bmc -nic user \
        -drive file=flash-romulus,format=raw,if=mtd -nographic
 +
 +Options specific to Aspeed machines are :
 +
 + * ``execute-in-place`` which emulates the boot from the CE0 flash
 +   device by using the FMC controller to load the instructions, and
 +   not simply from RAM. This takes a little longer.
 +
 + * ``fmc-model`` to change the FMC Flash model. FW needs support for
 +   the chip model to boot.
 +
 + * ``spi-model`` to change the SPI Flash model.
 +
 +For instance, to start the ``ast2500-evb`` machine with a different
 +FMC chip and a bigger (64M) SPI chip, use :
 +
 +.. code-block:: bash
 +
 +  -M ast2500-evb,fmc-model=mx25l25635e,spi-model=mx66u51235f
diff --combined hw/gpio/max7310.c
index 256d833c3a5be7c3a08236ab042beef220ba7506,de375892ef111362002a2f185e073182c96d6a0d..db6b5e3d764e5a970207b68856c08495c94586a6
@@@ -8,9 -8,7 +8,7 @@@
   */
  
  #include "qemu/osdep.h"
- #include "hw/hw.h"
  #include "hw/i2c/i2c.h"
- #include "hw/hw.h"
  #include "hw/irq.h"
  #include "migration/vmstate.h"
  #include "qemu/log.h"
@@@ -18,7 -16,9 +16,7 @@@
  #include "qom/object.h"
  
  #define TYPE_MAX7310 "max7310"
 -typedef struct MAX7310State MAX7310State;
 -DECLARE_INSTANCE_CHECKER(MAX7310State, MAX7310,
 -                         TYPE_MAX7310)
 +OBJECT_DECLARE_SIMPLE_TYPE(MAX7310State, MAX7310)
  
  struct MAX7310State {
      I2CSlave parent_obj;
@@@ -173,8 -173,7 +171,7 @@@ static const VMStateDescription vmstate
  static void max7310_gpio_set(void *opaque, int line, int level)
  {
      MAX7310State *s = (MAX7310State *) opaque;
-     if (line >= ARRAY_SIZE(s->handler) || line  < 0)
-         hw_error("bad GPIO line");
+     assert(line >= 0 && line < ARRAY_SIZE(s->handler));
  
      if (level)
          s->level |= s->direction & (1 << line);
diff --combined hw/ppc/ppc4xx_pci.c
index c812d3408f45e56b129bfd02dc21f45d297098c6,ca2553bf8b75bc8ef26266afc422bda920b9e830..28724c06f8822933472c4d55081d49a54119fb6a
@@@ -44,7 -44,9 +44,7 @@@ struct PCITargetMap 
      uint32_t la;
  };
  
 -typedef struct PPC4xxPCIState PPC4xxPCIState;
 -DECLARE_INSTANCE_CHECKER(PPC4xxPCIState, PPC4xx_PCI_HOST_BRIDGE,
 -                         TYPE_PPC4xx_PCI_HOST_BRIDGE)
 +OBJECT_DECLARE_SIMPLE_TYPE(PPC4xxPCIState, PPC4xx_PCI_HOST_BRIDGE)
  
  #define PPC4xx_PCI_NR_PMMS 3
  #define PPC4xx_PCI_NR_PTMS 2
@@@ -54,7 -56,7 +54,7 @@@ struct PPC4xxPCIState 
  
      struct PCIMasterMap pmm[PPC4xx_PCI_NR_PMMS];
      struct PCITargetMap ptm[PPC4xx_PCI_NR_PTMS];
-     qemu_irq irq[4];
+     qemu_irq irq[PCI_NUM_PINS];
  
      MemoryRegion container;
      MemoryRegion iomem;
diff --combined hw/timer/hpet.c
index b5d40724909a720cf8f679c4302b621a8c18f146,edaa5a0adfb51e1bb042c93ff0ec66a5652ecc4d..05fd86af817278c5a20cdd9e01b6adf08f1451f4
@@@ -48,7 -48,9 +48,7 @@@
  
  #define HPET_MSI_SUPPORT        0
  
 -typedef struct HPETState HPETState;
 -DECLARE_INSTANCE_CHECKER(HPETState, HPET,
 -                         TYPE_HPET)
 +OBJECT_DECLARE_SIMPLE_TYPE(HPETState, HPET)
  
  struct HPETState;
  typedef struct HPETTimer {  /* timers */
@@@ -417,20 -419,6 +417,6 @@@ static void hpet_del_timer(HPETTimer *t
      update_irq(t, 0);
  }
  
- #ifdef HPET_DEBUG
- static uint32_t hpet_ram_readb(void *opaque, hwaddr addr)
- {
-     printf("qemu: hpet_read b at %" PRIx64 "\n", addr);
-     return 0;
- }
- static uint32_t hpet_ram_readw(void *opaque, hwaddr addr)
- {
-     printf("qemu: hpet_read w at %" PRIx64 "\n", addr);
-     return 0;
- }
- #endif
  static uint64_t hpet_ram_read(void *opaque, hwaddr addr,
                                unsigned size)
  {
@@@ -510,7 -498,8 +496,8 @@@ static void hpet_ram_write(void *opaque
      HPETState *s = opaque;
      uint64_t old_val, new_val, val, index;
  
-     DPRINTF("qemu: Enter hpet_ram_writel at %" PRIx64 " = %#x\n", addr, value);
+     DPRINTF("qemu: Enter hpet_ram_writel at %" PRIx64 " = 0x%" PRIx64 "\n",
+             addr, value);
      index = addr;
      old_val = hpet_ram_read(opaque, addr, 4);
      new_val = value;
          uint8_t timer_id = (addr - 0x100) / 0x20;
          HPETTimer *timer = &s->timer[timer_id];
  
-         DPRINTF("qemu: hpet_ram_writel timer_id = %#x\n", timer_id);
+         DPRINTF("qemu: hpet_ram_writel timer_id = 0x%x\n", timer_id);
          if (timer_id > s->num_timers) {
              DPRINTF("qemu: timer id out of range\n");
              return;
              }
              s->hpet_counter =
                  (s->hpet_counter & 0xffffffff00000000ULL) | value;
-             DPRINTF("qemu: HPET counter written. ctr = %#x -> %" PRIx64 "\n",
-                     value, s->hpet_counter);
+             DPRINTF("qemu: HPET counter written. ctr = 0x%" PRIx64 " -> "
+                     "%" PRIx64 "\n", value, s->hpet_counter);
              break;
          case HPET_COUNTER + 4:
              if (hpet_enabled(s)) {
              }
              s->hpet_counter =
                  (s->hpet_counter & 0xffffffffULL) | (((uint64_t)value) << 32);
-             DPRINTF("qemu: HPET counter + 4 written. ctr = %#x -> %" PRIx64 "\n",
-                     value, s->hpet_counter);
+             DPRINTF("qemu: HPET counter + 4 written. ctr = 0x%" PRIx64 " -> "
+                     "%" PRIx64 "\n", value, s->hpet_counter);
              break;
          default:
              DPRINTF("qemu: invalid hpet_ram_writel\n");
diff --combined migration/rdma.c
index 6546509ebf58051e7547f962c919dfe6c3fd407b,8f43d69b066de59912851418a4e8d552d45c302c..3bd30d46ad9e9f6dce732281101b552e48eeeed3
@@@ -398,7 -398,9 +398,7 @@@ typedef struct RDMAContext 
  } RDMAContext;
  
  #define TYPE_QIO_CHANNEL_RDMA "qio-channel-rdma"
 -typedef struct QIOChannelRDMA QIOChannelRDMA;
 -DECLARE_INSTANCE_CHECKER(QIOChannelRDMA, QIO_CHANNEL_RDMA,
 -                         TYPE_QIO_CHANNEL_RDMA)
 +OBJECT_DECLARE_SIMPLE_TYPE(QIOChannelRDMA, QIO_CHANNEL_RDMA)
  
  
  
@@@ -1509,7 -1511,7 +1509,7 @@@ static int qemu_rdma_wait_comp_channel(
      } else {
          /* This is the source side, we're in a separate thread
           * or destination prior to migration_fd_process_incoming()
-          * after postcopy, the destination also in a seprate thread.
+          * after postcopy, the destination also in a separate thread.
           * we can't yield; so we have to poll the fd.
           * But we need to be able to handle 'cancel' or an error
           * without hanging forever.
@@@ -2266,7 -2268,7 +2266,7 @@@ static inline int qemu_rdma_buffer_merg
   *    chunk, then start a new chunk and flush() the old chunk.
   * 3. To keep the hardware busy, we also group chunks into batches
   *    and only require that a batch gets acknowledged in the completion
-  *    qeueue instead of each individual chunk.
+  *    queue instead of each individual chunk.
   */
  static int qemu_rdma_write(QEMUFile *f, RDMAContext *rdma,
                             uint64_t block_offset, uint64_t offset,
@@@ -3148,7 -3150,7 +3148,7 @@@ static size_t qemu_rdma_save_page(QEMUF
      if (size > 0) {
          /*
           * Add this page to the current 'chunk'. If the chunk
-          * is full, or the page doen't belong to the current chunk,
+          * is full, or the page doesn't belong to the current chunk,
           * an actual RDMA write will occur and a new chunk will be formed.
           */
          ret = qemu_rdma_write(f, rdma, block_offset, offset, size);
@@@ -4101,7 -4103,7 +4101,7 @@@ void rdma_start_outgoing_migration(voi
          goto err;
      }
  
-     /* RDMA postcopy need a seprate queue pair for return path */
+     /* RDMA postcopy need a separate queue pair for return path */
      if (migrate_postcopy()) {
          rdma_return_path = qemu_rdma_data_init(host_port, errp);
  
diff --combined scsi/pr-manager-helper.c
index b531dae2e88b9db040667888382116df32d46c6a,685ce7f92d22d7c6083a84fd2bc3e8281cb2fce4..451c7631b76f36b60e581c3e7edc60c1853d7854
@@@ -27,7 -27,9 +27,7 @@@
  
  #define TYPE_PR_MANAGER_HELPER "pr-manager-helper"
  
 -typedef struct PRManagerHelper PRManagerHelper;
 -DECLARE_INSTANCE_CHECKER(PRManagerHelper, PR_MANAGER_HELPER,
 -                         TYPE_PR_MANAGER_HELPER)
 +OBJECT_DECLARE_SIMPLE_TYPE(PRManagerHelper, PR_MANAGER_HELPER)
  
  struct PRManagerHelper {
      /* <private> */
@@@ -125,7 -127,7 +125,7 @@@ static int pr_manager_helper_initialize
      qio_channel_set_delay(QIO_CHANNEL(sioc), false);
      pr_mgr->ioc = QIO_CHANNEL(sioc);
  
-     /* A simple feature negotation protocol, even though there is
+     /* A simple feature negotiation protocol, even though there is
       * no optional feature right now.
       */
      r = pr_manager_helper_read(pr_mgr, &flags, sizeof(flags), errp);
diff --combined util/osdep.c
index 8ea7a807c13731c13b3d16c298de131fdacb36af,e50dc2214e36d50eebb5eaf8f6d3d379c2ebbdd2..66d01b9160fb93e0265f53ae410b8a72535e3275
@@@ -22,7 -22,6 +22,7 @@@
   * THE SOFTWARE.
   */
  #include "qemu/osdep.h"
 +#include "qapi/error.h"
  
  /* Needed early for CONFIG_BSD etc. */
  
@@@ -123,7 -122,7 +123,7 @@@ static int fcntl_op_getlk = -1
  /*
   * Dups an fd and sets the flags
   */
 -static int qemu_dup_flags(int fd, int flags)
 +int qemu_dup_flags(int fd, int flags)
  {
      int ret;
      int serrno;
@@@ -280,27 -279,13 +280,27 @@@ int qemu_lock_fd_test(int fd, int64_t s
  }
  #endif
  
 +static int qemu_open_cloexec(const char *name, int flags, mode_t mode)
 +{
 +    int ret;
 +#ifdef O_CLOEXEC
 +    ret = open(name, flags | O_CLOEXEC, mode);
 +#else
 +    ret = open(name, flags, mode);
 +    if (ret >= 0) {
 +        qemu_set_cloexec(ret);
 +    }
 +#endif
 +    return ret;
 +}
 +
  /*
   * Opens a file with FD_CLOEXEC set
   */
 -int qemu_open(const char *name, int flags, ...)
 +static int
 +qemu_open_internal(const char *name, int flags, mode_t mode, Error **errp)
  {
      int ret;
 -    int mode = 0;
  
  #ifndef _WIN32
      const char *fdset_id_str;
      /* Attempt dup of fd from fd set */
      if (strstart(name, "/dev/fdset/", &fdset_id_str)) {
          int64_t fdset_id;
 -        int fd, dupfd;
 +        int dupfd;
  
          fdset_id = qemu_parse_fdset(fdset_id_str);
          if (fdset_id == -1) {
 +            error_setg(errp, "Could not parse fdset %s", name);
              errno = EINVAL;
              return -1;
          }
  
 -        fd = monitor_fdset_get_fd(fdset_id, flags);
 -        if (fd < 0) {
 -            errno = -fd;
 -            return -1;
 -        }
 -
 -        dupfd = qemu_dup_flags(fd, flags);
 +        dupfd = monitor_fdset_dup_fd_add(fdset_id, flags);
          if (dupfd == -1) {
 -            return -1;
 -        }
 -
 -        ret = monitor_fdset_dup_fd_add(fdset_id, dupfd);
 -        if (ret == -1) {
 -            close(dupfd);
 -            errno = EINVAL;
 +            error_setg_errno(errp, errno, "Could not dup FD for %s flags %x",
 +                             name, flags);
              return -1;
          }
  
      }
  #endif
  
 -    if (flags & O_CREAT) {
 -        va_list ap;
 +    ret = qemu_open_cloexec(name, flags, mode);
  
 -        va_start(ap, flags);
 -        mode = va_arg(ap, int);
 -        va_end(ap);
 +    if (ret == -1) {
 +        const char *action = flags & O_CREAT ? "create" : "open";
 +#ifdef O_DIRECT
 +        /* Give more helpful error message for O_DIRECT */
 +        if (errno == EINVAL && (flags & O_DIRECT)) {
 +            ret = open(name, flags & ~O_DIRECT, mode);
 +            if (ret != -1) {
 +                close(ret);
 +                error_setg(errp, "Could not %s '%s': "
 +                           "filesystem does not support O_DIRECT",
 +                           action, name);
 +                errno = EINVAL; /* restore first open()'s errno */
 +                return -1;
 +            }
 +        }
 +#endif /* O_DIRECT */
 +        error_setg_errno(errp, errno, "Could not %s '%s'",
 +                         action, name);
      }
  
 -#ifdef O_CLOEXEC
 -    ret = open(name, flags | O_CLOEXEC, mode);
 -#else
 -    ret = open(name, flags, mode);
 -    if (ret >= 0) {
 -        qemu_set_cloexec(ret);
 +    return ret;
 +}
 +
 +
 +int qemu_open(const char *name, int flags, Error **errp)
 +{
 +    assert(!(flags & O_CREAT));
 +
 +    return qemu_open_internal(name, flags, 0, errp);
 +}
 +
 +
 +int qemu_create(const char *name, int flags, mode_t mode, Error **errp)
 +{
 +    assert(!(flags & O_CREAT));
 +
 +    return qemu_open_internal(name, flags | O_CREAT, mode, errp);
 +}
 +
 +
 +int qemu_open_old(const char *name, int flags, ...)
 +{
 +    va_list ap;
 +    mode_t mode = 0;
 +    int ret;
 +
 +    va_start(ap, flags);
 +    if (flags & O_CREAT) {
 +        mode = va_arg(ap, int);
      }
 -#endif
 +    va_end(ap);
 +
 +    ret = qemu_open_internal(name, flags, mode, NULL);
  
  #ifdef O_DIRECT
      if (ret == -1 && errno == EINVAL && (flags & O_DIRECT)) {
@@@ -436,7 -392,7 +436,7 @@@ int qemu_unlink(const char *name
   * Set errno if fewer than `count' bytes are written.
   *
   * This function don't work with non-blocking fd's.
-  * Any of the possibilities with non-bloking fd's is bad:
+  * Any of the possibilities with non-blocking fd's is bad:
   *   - return a short write (then name is wrong)
   *   - busy wait adding (errno == EAGAIN) to the loop
   */