Dear Michal After I fix the local libvirt master branch follow your patch, and build rpm for CentOS 7.4. virDomainUpdateDeviceFlags as bellow: ================================================ 2018-02-27 09:27:43.782+0000: 16656: debug : virDomainUpdateDeviceFlags:8326 : dom=0x7f2084000c50, (VM: name=6ec499397d594e f2a64fcfc938f38225, uuid=6ec49939-7d59-4ef2-a64f-cfc938f38225), xml=<disk device="cdrom" type="network"><source name="zstac k/08085a31f8c43f278ed2f649ee166b1f@08085a31f8c43f278ed2f649ee166b1f" protocol="rbd"><host name="10.0.229.181" port="6789" / ></source><auth username="zstack"><secret type="ceph" uuid="9b06bb70-dc13-4338-88fd-b0c72d5ab9e9" /></auth><target bus="ide " dev="hdc" /><readonly /></disk>, flags=0x1 ... 2018-02-27 09:27:43.788+0000: 16656: info : virObjectNew:254 : OBJECT_NEW: obj=0x7f2084003cc0 classname=qemuDomainStorageSourcePrivate 2018-02-27 09:27:43.788+0000: 16656: debug : virConnectOpen:1169 : name=secret:///system 2018-02-27 09:27:43.788+0000: 16656: info : virObjectNew:254 : OBJECT_NEW: obj=0x7f20840008c0 classname=virConnect 2018-02-27 09:27:43.788+0000: 16656: debug : virConfLoadConfig:1576 : Loading config file '/etc/libvirt/libvirt.conf' 2018-02-27 09:27:43.788+0000: 16656: debug : virConfReadFile:752 : filename=/etc/libvirt/libvirt.conf 2018-02-27 09:27:43.788+0000: 16656: debug : virFileClose:110 : Closed fd 28 2018-02-27 09:27:43.788+0000: 16656: debug : virConfGetValueStringList:946 : Get value string list (nil) 0 2018-02-27 09:27:43.788+0000: 16656: debug : virConnectOpenInternal:1033 : Split "secret:///system" to URI components: scheme secret server <null> user <null> port 0 path /system .. 2018-02-27 09:27:43.788+0000: 16656: info : virObjectRef:388 : OBJECT_REF: obj=0x563fa24f2360 2018-02-27 09:27:43.788+0000: 16656: info : virObjectUnref:350 : OBJECT_UNREF: obj=0x563fa24f2360 2018-02-27 09:27:43.788+0000: 16656: debug : virConnectOpenInternal:1098 : driver 7 secret returned SUCCESS 2018-02-27 09:27:43.788+0000: 16656: error : qemuDomainGetSecretAESAlias:729 : invalid argument: encrypted secret alias requires valid source alias 2018-02-27 09:27:43.788+0000: 16656: info : virObjectUnref:350 : OBJECT_UNREF: obj=0x7f20840008c0 2018-02-27 09:27:43.788+0000: 16656: info : virObjectUnref:352 : OBJECT_DISPOSE: obj=0x7f20840008c0 2018-02-27 09:27:43.788+0000: 16656: info : virObjectUnref:350 : OBJECT_UNREF: obj=0x7f2030101cb0 2018-02-27 09:27:43.788+0000: 16656: debug : qemuDomainObjEndJob:5594 : Stopping job: modify (async=none vm=0x7f20300fa6e0 name=6ec499397d594ef2a64fcfc938f38225) ====================================================== But it fails. Best Regards, Star Guo -----邮件原件----- 发件人: Michal Privoznik [mailto:mprivozn@xxxxxxxxxx] 发送时间: 2018年2月27日 16:53 收件人: Star Guo <starg@xxxxxxx>; libvirt-users@xxxxxxxxxx 抄送: John Ferlan <jferlan@xxxxxxxxxx> 主题: Re: Fail in virDomainUpdateDeviceFlags (libvirt-4.0.0 + Qemu-kvm 2.9.0 + Ceph 10.2.10) On 02/27/2018 03:06 AM, Star Guo wrote: > Hello Everyone, > > > > My pc run in CentOS 7.4 and install libvirt-4.0.0 + Qemu-kvm 2.9.0 + > Ceph > 10.2.10 ALL-in-One. > > > > I use python-sdk with libvirt and run > [self.domain.updateDeviceFlags(xml, > libvirt.VIR_DOMAIN_AFFECT_LIVE)] on CDROM (I want to change media path). > However, I enable libvirt debug log , the log as below: > > <snip/> > > I see the flow is virDomainUpdateDeviceFlags -> > qemuMonitorChangeMedia, but the cephx auth is drop, so make update error. Anybody meet this error? Yes, this is a libvirt bug. I think this fixes the issue: diff --git i/src/qemu/qemu_driver.c w/src/qemu/qemu_driver.c index 96454c17c..0e5ad9971 100644 --- i/src/qemu/qemu_driver.c +++ w/src/qemu/qemu_driver.c @@ -7842,6 +7842,8 @@ qemuDomainChangeDiskLive(virDomainObjPtr vm, virQEMUDriverPtr driver, bool force) { + virQEMUDriverConfigPtr cfg = virQEMUDriverGetConfig(driver); + qemuDomainObjPrivatePtr priv = vm->privateData; virDomainDiskDefPtr disk = dev->data.disk; virDomainDiskDefPtr orig_disk = NULL; virDomainDeviceDef oldDev = { .type = dev->type }; @@ -7850,6 +7852,9 @@ qemuDomainChangeDiskLive(virDomainObjPtr vm, if (virDomainDiskTranslateSourcePool(disk) < 0) goto cleanup; + if (qemuDomainPrepareDiskSource(disk, priv, cfg) < 0) + goto cleanup; + if (qemuDomainDetermineDiskChain(driver, vm, disk, false, true) < 0) goto cleanup; @@ -7898,6 +7903,7 @@ qemuDomainChangeDiskLive(virDomainObjPtr vm, ret = 0; cleanup: + virObjectUnref(cfg); return ret; } Can you check and confirm? Michal _______________________________________________ libvirt-users mailing list libvirt-users@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/libvirt-users