Skip to content
This repository has been archived by the owner on May 12, 2021. It is now read-only.

Commit

Permalink
devices: fix attach count for vhost-user-blk
Browse files Browse the repository at this point in the history
Commit affd6e3 ("devices: add reference
count for devices.") introduced an attach count for devices.  The
vhost-user-blk device increments the counter instead of decrementing it
when detaching.

Fixes: #1259
Signed-off-by: Stefan Hajnoczi <[email protected]>
  • Loading branch information
stefanhaRH authored and Eric Ernst committed Feb 26, 2019
1 parent 3d7a9b0 commit efe96e8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion virtcontainers/device/drivers/vhost_user_blk.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ func (device *VhostUserBlkDevice) Attach(devReceiver api.DeviceReceiver) (err er
// Detach is standard interface of api.Device, it's used to remove device from some
// DeviceReceiver
func (device *VhostUserBlkDevice) Detach(devReceiver api.DeviceReceiver) error {
skip, err := device.bumpAttachCount(true)
skip, err := device.bumpAttachCount(false)
if err != nil {
return err
}
Expand Down

0 comments on commit efe96e8

Please sign in to comment.