<div class="zcontentRow"> <p><span style="font-family: Arial, 宋体, 'Microsoft Yahei', 'Lucida Grande', Verdana, Lucida, Helvetica, sans-serif; font-size: 12px; line-height: 17.142858505249px; background-color: rgb(255, 255, 255);"></span></p><p><span style="font-size: 12px;"></span></p><p>Hi all,</p><p>Could someone review my patch please?</p><p><span style="font-size: 12px;"></span><br></p><p>> Libvirt forgets to remove inactive vm when failed to start a defined vm.</p><p>> That may result in residual domain in driver->domains on such condition:</p><p>> during the process of starting a vm, undefine it, and qemu exit because</p><p>> of some exception. As we undefined the vm successfully, the vm->persistent</p><p>> was set to 0, we will always fail to undefine it until restart libvirtd.</p><p>> </p><p>> Signed-off-by: Yi Wang <wang.yi59@zte.com.cn></p><p>> ---</p><p>>  src/qemu/qemu_driver.c | 2 ++</p><p>>  1 file changed, 2 insertions(+)</p><p>> </p><p>> diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c</p><p>> index cdb727b..af8afab 100644</p><p>> --- a/src/qemu/qemu_driver.c</p><p>> +++ b/src/qemu/qemu_driver.c</p><p>> @@ -7185,6 +7185,8 @@ qemuDomainCreateWithFlags(virDomainPtr dom, unsigned int flags)</p><p>>  </p><p>>   endjob:</p><p>>      qemuProcessEndJob(driver, vm);</p><p>> +    if (ret < 0)</p><p>> +        qemuDomainRemoveInactive(driver, vm);</p><p>>  </p><p>>   cleanup:</p><p>>      virDomainObjEndAPI(&vm);</p><p>> -- </p><p>> 1.8.3.1</p><p><br></p><p><br></p><div class="zMailSign"><div><div><p>---</p><p>Best wishes</p><p>Yi Wang</p></div></div></div><p><br></p></div>