1. 30 12月, 2008 1 次提交
  2. 21 10月, 2008 3 次提交
    • A
      [PATCH] switch virtio_blk · 4e109852
      Al Viro 提交于
      Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
      4e109852
    • A
      [PATCH] beginning of methods conversion · d4430d62
      Al Viro 提交于
      To keep the size of changesets sane we split the switch by drivers;
      to keep the damn thing bisectable we do the following:
      	1) rename the affected methods, add ones with correct
      prototypes, make (few) callers handle both.  That's this changeset.
      	2) for each driver convert to new methods.  *ALL* drivers
      are converted in this series.
      	3) kill the old (renamed) methods.
      
      Note that it _is_ a flagday; all in-tree drivers are converted and by the
      end of this series no trace of old methods remain.  The only reason why
      we do that this way is to keep the damn thing bisectable and allow per-driver
      debugging if anything goes wrong.
      
      New methods:
      	open(bdev, mode)
      	release(disk, mode)
      	ioctl(bdev, mode, cmd, arg)		/* Called without BKL */
      	compat_ioctl(bdev, mode, cmd, arg)
      	locked_ioctl(bdev, mode, cmd, arg)	/* Called with BKL, legacy */
      Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
      d4430d62
    • A
      [PATCH] switch scsi_cmd_ioctl() to passing fmode_t · 74f3c8af
      Al Viro 提交于
      Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
      74f3c8af
  3. 09 10月, 2008 2 次提交
  4. 25 7月, 2008 1 次提交
  5. 30 5月, 2008 2 次提交
  6. 02 5月, 2008 5 次提交
    • R
      virtio: add virtio disk geometry feature · 48e4043d
      Ryan Harper 提交于
      Rather than faking up some geometry, allow the backend to push the disk
      geometry via virtio pci config option.  Keep the old geo code around for
      compatibility.
      Signed-off-by: NRyan Harper <ryanh@us.ibm.com>
      Reviewed-by: NAnthony Liguori <aliguori@us.ibm.com>
      Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> (modified to single struct)
      48e4043d
    • R
      virtio: explicit advertisement of driver features · c45a6816
      Rusty Russell 提交于
      A recent proposed feature addition to the virtio block driver revealed
      some flaws in the API: in particular, we assume that feature
      negotiation is complete once a driver's probe function returns.
      
      There is nothing in the API to require this, however, and even I
      didn't notice when it was violated.
      
      So instead, we require the driver to specify what features it supports
      in a table, we can then move the feature negotiation into the virtio
      core.  The intersection of device and driver features are presented in
      a new 'features' bitmap in the struct virtio_device.
      
      Note that this highlights the difference between Linux unsigned-long
      bitmaps where each unsigned long is in native endian, and a
      straight-forward little-endian array of bytes.
      
      Drivers can still remove feature bits in their probe routine if they
      really have to.
      
      API changes:
      - dev->config->feature() no longer gets and acks a feature.
      - drivers should advertise their features in the 'feature_table' field
      - use virtio_has_feature() for extra sanity when checking feature bits
      Signed-off-by: NRusty Russell <rusty@rustcorp.com.au>
      c45a6816
    • R
      virtio: change config to guest endian. · 72e61eb4
      Rusty Russell 提交于
      A recent proposed feature addition to the virtio block driver revealed
      some flaws in the API, in particular how easy it is to break big
      endian machines.
      
      The virtio config space was originally chosen to be little-endian,
      because we thought the config might be part of the PCI config space
      for virtio_pci.  It's actually a separate mmio region, so that
      argument holds little water; as only x86 is currently using the virtio
      mechanism, we can change this (but must do so now, before the
      impending s390 merge).
      
      API changes:
      - __virtio_config_val() just becomes a striaght vdev->config_get() call.
      Signed-off-by: NRusty Russell <rusty@rustcorp.com.au>
      72e61eb4
    • M
      virtio-blk: fix remove oops · 2e895e4c
      Marcelo Tosatti 提交于
      Do not unregister the major at device remove, since there might be
      another device instances around.
      
      (qemu) pci_del 0 11
      (qemu) ACPI: PCI interrupt for device 0000:00:0b.0 disabled
      (qemu) pci_del 0 10
      (qemu) ------------[ cut here ]------------
      WARNING: at block/genhd.c:126 unregister_blkdev+0x74/0x9e()
      ACPI: PCI interrupt for device 0000:00:0a.0 disabled
      Signed-off-by: NMarcelo Tosatti <mtosatti@redhat.com>
      Signed-off-by: NRusty Russell <rusty@rustcorp.com.au>
      2e895e4c
    • R
      virtio: de-structify virtio_block status byte · cb38fa23
      Rusty Russell 提交于
      Ron Minnich points out that a struct containing a char is not always
      sizeof(char); simplest to remove the structure to avoid confusion.
      
      Cc: "ron minnich" <rminnich@gmail.com>
      Signed-off-by: NRusty Russell <rusty@rustcorp.com.au>
      cb38fa23
  7. 17 3月, 2008 1 次提交
  8. 04 2月, 2008 6 次提交
    • C
      virtio_blk: implement naming for vda-vdz,vdaa-vdzz,vdaaa-vdzzz · d50ed907
      Christian Borntraeger 提交于
      Am Freitag, 1. Februar 2008 schrieb Christian Borntraeger:
      > Right. I will fix that with an additional patch.
      
      This patch goes on top of the minor number patch. Please let me know if
      you want a merged patch:
      
      Currently virtio_blk creates the disk name combinging "vd"  with 'a'++.
      This will give strange names after vdz. I have implemented names up to
      vdzzz - inspired by the sd.c code. That should be sufficient for now.
      
      There is one driver in the kernel (driver/s390/block/dasd_genhd.c) that
      implements names from dasda-dasdzzzz allowing even more disks. Maybe
      a janitor can come up with a common implementation usable for all kind
      of block device drivers.
      
      I have tested this patch with 100 disks - seems to work.
      Signed-off-by: NChristian Borntraeger <borntraeger@de.ibm.com>
      Signed-off-by: NRusty Russell <rusty@rustcorp.com.au>
      d50ed907
    • C
      virtio_blk: Dont waste major numbers · 4f3bf19c
      Christian Borntraeger 提交于
      Rusty,
      
      currently virtio_blk uses one major number per device. While this works
      quite well on most systems it is wasteful and will exhaust major numbers
      on larger installations.
      
      This patch allocates a major number on init and will use 16 minor numbers
      for each disk. That will allow ~64k virtio_blk disks.
      Signed-off-by: NChristian Borntraeger <borntraeger@de.ibm.com>
      Signed-off-by: NRusty Russell <rusty@rustcorp.com.au>
      4f3bf19c
    • C
      virtio_blk: provide getgeo · 135da0b0
      Christian Borntraeger 提交于
      Rusty,
      
      I currently try to make my guest boot from an virtio root device
      without having an external kernel. Some of the tools that I tried
      expect HDIO_GETGEO to work. The most interesting value is likely
      the geo.start value to get the offset of a partition. This value
      is filled by block/ioctl.c if fops->getgeo is set. This patch also
      fills in some standard values for heads, sectors and cylinders.
      
      Makes sense?
      Signed-off-by: NChristian Borntraeger <borntraeger@de.ibm.com>
      Signed-off-by: NRusty Russell <rusty@rustcorp.com.au>
      135da0b0
    • R
      virtio: reset function · 6e5aa7ef
      Rusty Russell 提交于
      A reset function solves three problems:
      
      1) It allows us to renegotiate features, eg. if we want to upgrade a
         guest driver without rebooting the guest.
      
      2) It gives us a clean way of shutting down virtqueues: after a reset,
         we know that the buffers won't be used by the host, and
      
      3) It helps the guest recover from messed-up drivers.
      
      So we remove the ->shutdown hook, and the only way we now remove
      feature bits is via reset.
      
      We leave it to the driver to do the reset before it deletes queues:
      the balloon driver, for example, needs to chat to the host in its
      remove function.
      Signed-off-by: NRusty Russell <rusty@rustcorp.com.au>
      6e5aa7ef
    • R
      virtio: explicit enable_cb/disable_cb rather than callback return. · 18445c4d
      Rusty Russell 提交于
      It seems that virtio_net wants to disable callbacks (interrupts) before
      calling netif_rx_schedule(), so we can't use the return value to do so.
      
      Rename "restart" to "cb_enable" and introduce "cb_disable" hook: callback
      now returns void, rather than a boolean.
      Signed-off-by: NRusty Russell <rusty@rustcorp.com.au>
      18445c4d
    • R
      virtio: simplify config mechanism. · a586d4f6
      Rusty Russell 提交于
      Previously we used a type/len pair within the config space, but this
      seems overkill.  We now simply define a structure which represents the
      layout in the config space: the config space can now only be extended
      at the end.
      
      The main driver-visible changes:
      1) We indicate what fields are present with an explicit feature bit.
      2) Virtqueues are explicitly numbered, and not in the config space.
      Signed-off-by: NRusty Russell <rusty@rustcorp.com.au>
      a586d4f6
  9. 19 11月, 2007 1 次提交
  10. 24 10月, 2007 1 次提交
  11. 23 10月, 2007 1 次提交
    • R
      Block driver using virtio. · e467cde2
      Rusty Russell 提交于
      The block driver uses scatter-gather lists with sg[0] being the
      request information (struct virtio_blk_outhdr) with the type, sector
      and inbuf id.  The next N sg entries are the bio itself, then the last
      sg is the status byte.  Whether the N entries are in or out depends on
      whether it's a read or a write.
      
      We accept the normal (SCSI) ioctls: they get handed through to the other
      side which can then handle it or reply that it's unsupported.  It's
      not clear that this actually works in general, since I don't know
      if blk_pc_request() requests have an accurate rq_data_dir().
      
      Although we try to reply -ENOTTY on unsupported commands, ioctl(fd,
      CDROMEJECT) returns success to userspace.  This needs a separate
      patch.
      Signed-off-by: NRusty Russell <rusty@rustcorp.com.au>
      Cc: Jens Axboe <jens.axboe@oracle.com>
      e467cde2