1. 22 8月, 2011 1 次提交
    • B
      fdc: avoid structure holes spotted by pahole · 242cca4f
      Blue Swirl 提交于
      Edited report from pahole on amd64 host:
      struct FDCtrl {
      	uint8_t                    version;              /*     0     1 */
      
      	/* XXX 7 bytes hole, try to pack */
      
      	qemu_irq                   irq;                  /*     8     8 */
      	int                        dma_chann;            /*    16     4 */
      
      	/* XXX 4 bytes hole, try to pack */
      ...
      	uint8_t                    status2;              /*    42     1 */
      
      	/* XXX 5 bytes hole, try to pack */
      
      	uint8_t *                  fifo;                 /*    48     8 */
      ...
      	uint8_t                    pwrd;                 /*    76     1 */
      
      	/* XXX 3 bytes hole, try to pack */
      
      	int                        sun4m;                /*    80     4 */
      	uint8_t                    num_floppies;         /*    84     1 */
      
      	/* XXX 3 bytes hole, try to pack */
      
      	FDrive                     drives[2];            /*    88    64 */
      	/* --- cacheline 2 boundary (128 bytes) was 24 bytes ago --- */
      	int                        reset_sensei;         /*   152     4 */
      
      	/* size: 160, cachelines: 3 */
      	/* sum members: 134, holes: 5, sum holes: 22 */
      	/* padding: 4 */
      	/* last cacheline: 32 bytes */
      };	/* definitions: 1 */
      
      Fix by rearranging the structure to avoid padding.
      Signed-off-by: NBlue Swirl <blauwirbel@gmail.com>
      242cca4f
  2. 07 4月, 2011 1 次提交
  3. 21 3月, 2011 1 次提交
    • P
      change all other clock references to use nanosecond resolution accessors · 74475455
      Paolo Bonzini 提交于
      This was done with:
      
          sed -i 's/qemu_get_clock\>/qemu_get_clock_ns/' \
              $(git grep -l 'qemu_get_clock\>' )
          sed -i 's/qemu_new_timer\>/qemu_new_timer_ns/' \
              $(git grep -l 'qemu_new_timer\>' )
      
      after checking that get_clock and new_timer never occur twice
      on the same line.  There were no missed occurrences; however, even
      if there had been, they would have been caught by the compiler.
      
      There was exactly one false positive in qemu_run_timers:
      
           -    current_time = qemu_get_clock (clock);
           +    current_time = qemu_get_clock_ns (clock);
      
      which is of course not in this patch.
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      74475455
  4. 20 2月, 2011 3 次提交
  5. 12 12月, 2010 3 次提交
  6. 11 12月, 2010 1 次提交
    • A
      Add endianness as io mem parameter · 2507c12a
      Alexander Graf 提交于
      As stated before, devices can be little, big or native endian. The
      target endianness is not of their concern, so we need to push things
      down a level.
      
      This patch adds a parameter to cpu_register_io_memory that allows a
      device to choose its endianness. For now, all devices simply choose
      native endian, because that's the same behavior as before.
      Signed-off-by: NAlexander Graf <agraf@suse.de>
      Signed-off-by: NBlue Swirl <blauwirbel@gmail.com>
      2507c12a
  7. 24 8月, 2010 1 次提交
    • B
      Rearrange block headers · 2446333c
      Blue Swirl 提交于
      Changing block.h or blockdev.h resulted in recompiling most objects.
      
      Move DriveInfo typedef and BlockInterfaceType enum definitions
      to qemu-common.h and rearrange blockdev.h use to decrease churn.
      Signed-off-by: NBlue Swirl <blauwirbel@gmail.com>
      2446333c
  8. 06 7月, 2010 1 次提交
    • M
      fdc: Reject unimplemented error actions · b47b3525
      Markus Armbruster 提交于
      drive_init() doesn't permit them for if=floppy, but that's worthless:
      we get them via if=none and -global.
      
      This can make device initialization fail.  Since all callers of
      fdctrl_init_isa() ignore its value, change it to die instead of
      returning failure.  Without this, some callers would ignore the
      failure, and others would crash.
      
      Wart: unlike drive_init(), we don't reject the default action when
      it's explicitly specified.  That's because we can't distinguish "no
      rerror option" from "rerror=report", or "no werror" from
      "rerror=enospc".  Left for another day.
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      b47b3525
  9. 02 7月, 2010 3 次提交
    • M
      block: Fix virtual media change for if=none · 7d0d6950
      Markus Armbruster 提交于
      BlockDriverState member removable controls whether virtual media
      change (monitor commands change, eject) is allowed.  It is set when
      the "type hint" is BDRV_TYPE_CDROM or BDRV_TYPE_FLOPPY.
      
      The type hint is only set by drive_init().  It sets BDRV_TYPE_FLOPPY
      for if=floppy.  It sets BDRV_TYPE_CDROM for media=cdrom and if=ide,
      scsi, xen, or none.
      
      if=ide and if=scsi work, because the type hint makes it a CD-ROM.
      if=xen likewise, I think.
      
      For the same reason, if=none works when it's used by ide-drive or
      scsi-disk.  For other guest devices, there are problems:
      
      * fdc: you can't change virtual media
      
          $ qemu [...] -drive if=none,id=foo,... -global isa-fdc.driveA=foo
          QEMU 0.12.50 monitor - type 'help' for more information
          (qemu) eject foo
          Device 'foo' is not removable
      
        unless you add media=cdrom, but that makes it readonly.
      
      * virtio: if you add media=cdrom, you can change virtual media.  If
        you eject, the guest gets I/O errors.  If you change, the guest sees
        the drive's contents suddenly change.
      
      * scsi-generic: if you add media=cdrom, you can change virtual media.
        I didn't test what that does to the guest or the physical device,
        but it can't be pretty.
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      7d0d6950
    • M
      block: Catch attempt to attach multiple devices to a blockdev · 18846dee
      Markus Armbruster 提交于
      For instance, -device scsi-disk,drive=foo -device scsi-disk,drive=foo
      happily creates two SCSI disks connected to the same block device.
      It's all downhill from there.
      
      Device usb-storage deliberately attaches twice to the same blockdev,
      which fails with the fix in place.  Detach before the second attach
      there.
      
      Also catch attempt to delete while a guest device model is attached.
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      18846dee
    • M
      qdev: Decouple qdev_prop_drive from DriveInfo · f8b6cc00
      Markus Armbruster 提交于
      Make the property point to BlockDriverState, cutting out the DriveInfo
      middleman.  This prepares the ground for block devices that don't have
      a DriveInfo.
      
      Currently all user-defined ones have a DriveInfo, because the only way
      to define one is -drive & friends (they go through drive_init()).
      DriveInfo is closely tied to -drive, and like -drive, it mixes
      information about host and guest part of the block device.  I'm
      working towards a new way to define block devices, with clean
      host/guest separation, and I need to get DriveInfo out of the way for
      that.
      
      Fortunately, the device models are perfectly happy with
      BlockDriverState, except for two places: ide_drive_initfn() and
      scsi_disk_initfn() need to check the DriveInfo for a serial number set
      with legacy -drive serial=...  Use drive_get_by_blockdev() there.
      
      Device model code should now use DriveInfo only when explicitly
      dealing with drives defined the old way, i.e. without -device.
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      Reviewed-by: NChristoph Hellwig <hch@lst.de>
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      f8b6cc00
  10. 15 6月, 2010 1 次提交
  11. 04 6月, 2010 1 次提交
  12. 15 5月, 2010 1 次提交
  13. 18 4月, 2010 1 次提交
    • B
      Fix harmless if statements with empty body, spotted by clang · 3c83eb4f
      Blue Swirl 提交于
      These clang errors are harmless but worth fixing:
        CC    libhw64/fdc.o
      /src/qemu/hw/fdc.c:998:74: error: if statement has empty body [-Wempty-body]
              FLOPPY_DPRINTF("Floppy digital input register: 0x%02x\n", retval);
        CC    libhw64/cuda.o
      /src/qemu/hw/cuda.c:320:66: error: if statement has empty body [-Wempty-body]
              CUDA_DPRINTF("read: reg=0x%x val=%02x\n", (int)addr, val);
      Signed-off-by: NBlue Swirl <blauwirbel@gmail.com>
      3c83eb4f
  14. 21 3月, 2010 1 次提交
  15. 13 3月, 2010 1 次提交
  16. 07 2月, 2010 2 次提交
  17. 19 12月, 2009 2 次提交
  18. 13 12月, 2009 1 次提交
  19. 13 11月, 2009 1 次提交
  20. 09 11月, 2009 1 次提交
  21. 07 11月, 2009 1 次提交
  22. 28 10月, 2009 1 次提交
  23. 25 10月, 2009 1 次提交
  24. 07 10月, 2009 2 次提交
  25. 05 10月, 2009 4 次提交
  26. 02 10月, 2009 2 次提交
  27. 12 9月, 2009 1 次提交