On Sun, Oct 31, 2021 at 22:06:08 +0800, longguang.yue wrote: > > Hi, all: > in my case, i need to add device via qmp. but for rbd drive needs a secret object. Could you please explain what you are trying to achieve? Or why libvirt hotplug API is not sufficient to you? > how to produce secret object. > 'base64 -d' outputs unreadable code . The secret data is encrypted by a per-VM key (see keyid masterKey0). For testing purposes you can add also secrets in plaintext (format=plain). I can point you to qemu documentation on secrets if you want, but first I want to know why you are not using libvirt APIs directly. > > -object > secret,id=virtio-disk0-secret0,data=2YVH6svMZa42RfVx8MbIIVjtU6iGO8QzFADuDnLk7BU=,keyid=masterKey0,iv=/m3QyHQ33NeMEfDDMuDEeg==,format=base64 > > > thanks >