search for: get_status

Displaying 20 results from an estimated 435 matches for "get_status".

Did you mean: set_status
2015 Mar 05
3
[PATCH] virtio_mmio: generation support
...vice *vdev, unsigned offset, } } +static u32 vm_generation(struct virtio_device *vdev) +{ + struct virtio_mmio_device *vm_dev = to_virtio_mmio_device(vdev); + + if (vm_dev->version == 1) + return 0; + else + return readl(vm_dev->base + VIRTIO_MMIO_CONFIG_GENERATION); +} + static u8 vm_get_status(struct virtio_device *vdev) { struct virtio_mmio_device *vm_dev = to_virtio_mmio_device(vdev); @@ -503,6 +513,8 @@ static const char *vm_bus_name(struct virtio_device *vdev) static const struct virtio_config_ops virtio_mmio_config_ops = { .get = vm_get, .set = vm_set, + .generation = vm_g...
2015 Mar 05
3
[PATCH] virtio_mmio: generation support
...vice *vdev, unsigned offset, } } +static u32 vm_generation(struct virtio_device *vdev) +{ + struct virtio_mmio_device *vm_dev = to_virtio_mmio_device(vdev); + + if (vm_dev->version == 1) + return 0; + else + return readl(vm_dev->base + VIRTIO_MMIO_CONFIG_GENERATION); +} + static u8 vm_get_status(struct virtio_device *vdev) { struct virtio_mmio_device *vm_dev = to_virtio_mmio_device(vdev); @@ -503,6 +513,8 @@ static const char *vm_bus_name(struct virtio_device *vdev) static const struct virtio_config_ops virtio_mmio_config_ops = { .get = vm_get, .set = vm_set, + .generation = vm_g...
2007 Aug 23
6
Calling a method on class creation
I have a model User that has property called status. Status is just a string that can only be evaluated and not persisted. I.e. it doesn''t have a field in the user table. Anyways, I would like a method get_status to be called anytime I create a new instance of User. For example: user=User.new Since I created a new instance of User, I should now have access to the status property, e.g.: user.status =>"Ready" Here is my User class: class User < ActiveRecord::Base has_and_belongs_to_many...
2017 Oct 13
2
[PATCH net-next] virtio_net: implement VIRTIO_CONFIG_S_NEEDS_RESET
...rtio_device *vdev) { @@ -1952,6 +1954,40 @@ static int virtnet_restore_up(struct virtio_device *vdev) return err; } +static int virtnet_reset(struct virtnet_info *vi) +{ + struct virtio_device *dev = vi->vdev; + int ret; + + virtio_config_disable(dev); + dev->failed = dev->config->get_status(dev) & VIRTIO_CONFIG_S_FAILED; + virtnet_freeze_down(dev, true); + remove_vq_common(vi); + + virtio_add_status(dev, VIRTIO_CONFIG_S_ACKNOWLEDGE); + virtio_add_status(dev, VIRTIO_CONFIG_S_DRIVER); + + ret = virtio_finalize_features(dev); + if (ret) + goto err; + + ret = virtnet_restore_up(dev);...
2017 Oct 13
2
[PATCH net-next] virtio_net: implement VIRTIO_CONFIG_S_NEEDS_RESET
...rtio_device *vdev) { @@ -1952,6 +1954,40 @@ static int virtnet_restore_up(struct virtio_device *vdev) return err; } +static int virtnet_reset(struct virtnet_info *vi) +{ + struct virtio_device *dev = vi->vdev; + int ret; + + virtio_config_disable(dev); + dev->failed = dev->config->get_status(dev) & VIRTIO_CONFIG_S_FAILED; + virtnet_freeze_down(dev, true); + remove_vq_common(vi); + + virtio_add_status(dev, VIRTIO_CONFIG_S_ACKNOWLEDGE); + virtio_add_status(dev, VIRTIO_CONFIG_S_DRIVER); + + ret = virtio_finalize_features(dev); + if (ret) + goto err; + + ret = virtnet_restore_up(dev);...
2015 Mar 12
0
[PATCH] virtio_mmio: generation support
...vm_generation(struct virtio_device *vdev) > +{ > + struct virtio_mmio_device *vm_dev = to_virtio_mmio_device(vdev); > + > + if (vm_dev->version == 1) > + return 0; > + else > + return readl(vm_dev->base + VIRTIO_MMIO_CONFIG_GENERATION); > +} > + > static u8 vm_get_status(struct virtio_device *vdev) > { > struct virtio_mmio_device *vm_dev = to_virtio_mmio_device(vdev); > @@ -503,6 +513,8 @@ static const char *vm_bus_name(struct virtio_device *vdev) > static const struct virtio_config_ops virtio_mmio_config_ops = { > .get = vm_get, > .set...
2015 Mar 12
0
[PATCH] virtio_mmio: generation support
...vm_generation(struct virtio_device *vdev) > +{ > + struct virtio_mmio_device *vm_dev = to_virtio_mmio_device(vdev); > + > + if (vm_dev->version == 1) > + return 0; > + else > + return readl(vm_dev->base + VIRTIO_MMIO_CONFIG_GENERATION); > +} > + > static u8 vm_get_status(struct virtio_device *vdev) > { > struct virtio_mmio_device *vm_dev = to_virtio_mmio_device(vdev); > @@ -503,6 +513,8 @@ static const char *vm_bus_name(struct virtio_device *vdev) > static const struct virtio_config_ops virtio_mmio_config_ops = { > .get = vm_get, > .set...
2019 Jan 03
4
[PATCH 0/2] virtio: virtio_config_ops documentation
After the latest virtio-balloon changes, it became clear that it is not obvious that some of the virtio operations (e.g. reading or writing the config space) cannot be done from an atomic context for all transports. At least try to document that, and also fix some inconsistencies I noticed along the way. Cornelia Huck (2): virtio: fix virtio_config_ops description virtio: document
2019 Jan 03
4
[PATCH 0/2] virtio: virtio_config_ops documentation
After the latest virtio-balloon changes, it became clear that it is not obvious that some of the virtio operations (e.g. reading or writing the config space) cannot be done from an atomic context for all transports. At least try to document that, and also fix some inconsistencies I noticed along the way. Cornelia Huck (2): virtio: fix virtio_config_ops description virtio: document
2014 Nov 25
2
[PATCH v4 09/42] virtio: set FEATURES_OK
...r! */ add_status(dev, VIRTIO_CONFIG_S_DRIVER); @@ -183,18 +184,32 @@ static int virtio_dev_probe(struct device *_d) dev->config->finalize_features(dev); + if (virtio_has_feature(dev, VIRTIO_F_VERSION_1)) { + add_status(dev, VIRTIO_CONFIG_S_FEATURES_OK); + status = dev->config->get_status(dev); + if (!(status & VIRTIO_CONFIG_S_FEATURES_OK)) { + printk(KERN_ERR "virtio: device refuses features: %x\n", + status); + err = -ENODEV; + goto err; + } + } + err = drv->probe(dev); if (err) - add_status(dev, VIRTIO_CONFIG_S_FAILED); - else { - add_statu...
2014 Nov 25
2
[PATCH v4 09/42] virtio: set FEATURES_OK
...r! */ add_status(dev, VIRTIO_CONFIG_S_DRIVER); @@ -183,18 +184,32 @@ static int virtio_dev_probe(struct device *_d) dev->config->finalize_features(dev); + if (virtio_has_feature(dev, VIRTIO_F_VERSION_1)) { + add_status(dev, VIRTIO_CONFIG_S_FEATURES_OK); + status = dev->config->get_status(dev); + if (!(status & VIRTIO_CONFIG_S_FEATURES_OK)) { + printk(KERN_ERR "virtio: device refuses features: %x\n", + status); + err = -ENODEV; + goto err; + } + } + err = drv->probe(dev); if (err) - add_status(dev, VIRTIO_CONFIG_S_FAILED); - else { - add_statu...
2002 Nov 05
2
[PATCH] fix sftp to preserve permissions and uid/gid
...he file). Sftp also fails to preserve the uid/gid. Added code so that if is running as root, uid and gid are preserved. patch is based on Openssh 3.4p1. *** sftp-client.c@@\main\1 Tue Oct 1 17:26:20 2002 --- sftp-client.c Tue Nov 5 10:22:52 2002 *************** *** 666,672 **** status = get_status(conn->fd_in, id); if (status != SSH2_FX_OK) ! error("Couldn't rename file \"%s\" to \"%s\": %s", oldpath, newpath, fx2txt(status)); return(status); --- 666,672 ---- status = get_status(conn->fd_in, id); if (status != SSH2_FX_OK) !...
2018 May 30
2
[PATCH] virtio_pci: support enabling VFs
...pci_dev, int >> num_vfs) >> +{ >> + struct virtio_pci_device *vp_dev = pci_get_drvdata(pci_dev); >> + struct virtio_device *vdev = &vp_dev->vdev; >> + int (*sriov_configure)(struct pci_dev *pci_dev, int num_vfs); >> + >> + if (!(vdev->config->get_status(vdev) & VIRTIO_CONFIG_S_DRIVER_OK)) >> + return -EBUSY; >> + >> + if (!__virtio_test_bit(vdev, VIRTIO_F_SR_IOV)) >> + return -EINVAL; >> + >> + sriov_configure = pci_sriov_configure_simple; >> + if (sriov_configure == NULL) >> + return -ENOENT;...
2018 May 30
2
[PATCH] virtio_pci: support enabling VFs
...pci_dev, int >> num_vfs) >> +{ >> + struct virtio_pci_device *vp_dev = pci_get_drvdata(pci_dev); >> + struct virtio_device *vdev = &vp_dev->vdev; >> + int (*sriov_configure)(struct pci_dev *pci_dev, int num_vfs); >> + >> + if (!(vdev->config->get_status(vdev) & VIRTIO_CONFIG_S_DRIVER_OK)) >> + return -EBUSY; >> + >> + if (!__virtio_test_bit(vdev, VIRTIO_F_SR_IOV)) >> + return -EINVAL; >> + >> + sriov_configure = pci_sriov_configure_simple; >> + if (sriov_configure == NULL) >> + return -ENOENT;...
2019 Mar 08
0
Re: [PATCH nbdkit] Minimal implementation of NBD Structured Replies.
...ng whether sizeof binds with higher or lower precedence than +. > @@ -1317,40 +1449,33 @@ recv_request_send_reply (struct connection *conn) > > /* Send the reply packet. */ > send_reply: > - { > - ACQUIRE_LOCK_FOR_CURRENT_SCOPE (&conn->write_lock); > - if (get_status (conn) < 0) > - return -1; > - reply.magic = htobe32 (NBD_REPLY_MAGIC); > - reply.handle = request.handle; > - reply.error = htobe32 (nbd_errno (error)); > + if (get_status (conn) < 0) > + return -1; Hmm, previously get_status() was checked under lock. But...
2017 Nov 17
8
[RFC nbdkit PATCH 0/6] Enable full parallel request handling
I want to make my nbd forwarding plugin fully parallel - but to do that, I first need to make nbdkit itself fully parallel ;) With this series, I was finally able to demonstrate out-of-order responses when using qemu-io (which is great at sending back-to-back requests prior to waiting for responses) coupled with the nbd file plugin (which has a great feature of rdelay and wdelay, to make it
2014 Nov 13
2
[PATCH 1/2] virito: introduce methods of fixing device features
..., vdev->features); >> } >> >> +static inline void virtio_disable_feature(struct virtio_device *vdev, >> + unsigned int fbit) >> +{ >> + BUG_ON(fbit >= VIRTIO_TRANSPORT_F_START); >> + BUG_ON(vdev->config->get_status(vdev) & >> + ~(VIRTIO_CONFIG_S_ACKNOWLEDGE | VIRTIO_CONFIG_S_DRIVER)); > When we add virtio-1 support, we can add a check for FEATURES_OK here, > so we're really on the safe side. > If I read the spec correctly, FEATURES_OK was set only after writing the features bits...
2014 Nov 13
2
[PATCH 1/2] virito: introduce methods of fixing device features
..., vdev->features); >> } >> >> +static inline void virtio_disable_feature(struct virtio_device *vdev, >> + unsigned int fbit) >> +{ >> + BUG_ON(fbit >= VIRTIO_TRANSPORT_F_START); >> + BUG_ON(vdev->config->get_status(vdev) & >> + ~(VIRTIO_CONFIG_S_ACKNOWLEDGE | VIRTIO_CONFIG_S_DRIVER)); > When we add virtio-1 support, we can add a check for FEATURES_OK here, > so we're really on the safe side. > If I read the spec correctly, FEATURES_OK was set only after writing the features bits...
2020 Jun 29
3
[PATCH v3 1/1] s390: virtio: let arch accept devices without IOMMU feature
...virtio_has_feature(dev, VIRTIO_F_IOMMU_PLATFORM)) { > + dev_warn(&dev->dev, > + "virtio: device must provide VIRTIO_F_IOMMU_PLATFORM\n"); > + return -ENODEV; > + } > + > virtio_add_status(dev, VIRTIO_CONFIG_S_FEATURES_OK); > status = dev->config->get_status(dev); > if (!(status & VIRTIO_CONFIG_S_FEATURES_OK)) { Well don't you need to check it *before* VIRTIO_F_VERSION_1, not after? > diff --git a/include/linux/virtio.h b/include/linux/virtio.h > index a493eac08393..e8526ae3463e 100644 > --- a/include/linux/virtio.h > +++ b...
2020 Jun 29
3
[PATCH v3 1/1] s390: virtio: let arch accept devices without IOMMU feature
...virtio_has_feature(dev, VIRTIO_F_IOMMU_PLATFORM)) { > + dev_warn(&dev->dev, > + "virtio: device must provide VIRTIO_F_IOMMU_PLATFORM\n"); > + return -ENODEV; > + } > + > virtio_add_status(dev, VIRTIO_CONFIG_S_FEATURES_OK); > status = dev->config->get_status(dev); > if (!(status & VIRTIO_CONFIG_S_FEATURES_OK)) { Well don't you need to check it *before* VIRTIO_F_VERSION_1, not after? > diff --git a/include/linux/virtio.h b/include/linux/virtio.h > index a493eac08393..e8526ae3463e 100644 > --- a/include/linux/virtio.h > +++ b...