Skip to contentSkip to conversation

COMPARE_AND_WRITE support for rbd driver

Qemu-devel Yaowei Bai 2 participants 3 messages Sep 19, 2019 – Sep 20, 2019

lore
Share & tools
lore

Yaowei Bai

author
#0 lore raw

[email protected]
Bcc:
Subject: COMPARE_AND_WRITE support for rbd driver
Reply-To: [email protected]

Hey guys,

I noticed that COMPARE_AND_WRITE had been supported by CEPH/librbd since v12.1.1. And in my company, we use this COMPARE_AND_WRITE support in CEPH with the ISCSI protocol. More precisely, we use tgt and CEPH with this COMPARE_AND_WRITE support as the SCSI target and export it to the remote hosts. And then VMs on remote hosts can use these SCSI targets through ISCSI initiator support in QEMU directly or as local SCSI disks. But unfortunately, there're some issues with this tgt case. So i think maybe we could also add this COMPARE_AND_WRITE support into the rbd driver in QEMU so we can leave the ISCSI/tgt alone and use this COMPARE_AND_WRITE support with the scsi-disk <--> virtio-scsi <--> rbd driver path. This can also apply to the WRITESAME support in CEPH/librbd.

So is it suitable for doing this? I want to hear suggestions from you genius guys. Appreciate it.

#1 lore raw
Quoted 19 lines · Yaowei Bai

[email protected]
Bcc:
Subject: COMPARE_AND_WRITE support for rbd driver
Reply-To: [email protected]

Hey guys,

I noticed that COMPARE_AND_WRITE had been supported by CEPH/librbd since v12.1.1. And in my company, we use this COMPARE_AND_WRITE support in CEPH with the ISCSI protocol. More precisely, we use tgt and CEPH with this COMPARE_AND_WRITE support as the SCSI target and export it to the remote hosts. And then VMs on remote hosts can use these SCSI targets through ISCSI initiator support in QEMU directly or as local SCSI disks. But unfortunately, there're some issues with this tgt case. So i think maybe we could also add this COMPARE_AND_WRITE support into the rbd driver in QEMU so we can leave the ISCSI/tgt alone and use this COMPARE_AND_WRITE support with the scsi-disk <--> virtio-scsi <--> rbd driver path. This can also apply to the WRITESAME support in CEPH/librbd.

Quoted 1 line

So is it suitable for doing this?

Yes, it would be suitable. In a nutshell you would have to add support for COMPARE_AND_WRITE to block/io.c (calling into a new BlockDriver function pointer), block/rbd.c and hw/scsi/scsi-disk.c.

Paolo

author
#2 lore raw
Quoted 16 lines · Paolo Bonzini
Quoted 15 lines · Yaowei Bai

Hey guys,

I noticed that COMPARE_AND_WRITE had been supported by CEPH/librbd since v12.1.1. And in my company, we use this COMPARE_AND_WRITE support in CEPH with the ISCSI protocol. More precisely, we use tgt and CEPH with this COMPARE_AND_WRITE support as the SCSI target and export it to the remote hosts. And then VMs on remote hosts can use these SCSI targets through ISCSI initiator support in QEMU directly or as local SCSI disks. But unfortunately, there're some issues with this tgt case. So i think maybe we could also add this COMPARE_AND_WRITE support into the rbd driver in QEMU so we can leave the ISCSI/tgt alone and use this COMPARE_AND_WRITE support with the scsi-disk <--> virtio-scsi <--> rbd driver path. This can also apply to the WRITESAME support in CEPH/librbd.

Quoted 5 lines
Quoted 1 line

So is it suitable for doing this?

Yes, it would be suitable. In a nutshell you would have to add support for COMPARE_AND_WRITE to block/io.c (calling into a new BlockDriver function pointer), block/rbd.c and hw/scsi/scsi-disk.c.

OK, i'll try to implement this and send it out for review. Thanks Paolo.

Quoted 2 lines

Paolo