any better way to treat device-detach timeout ?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,all:

   I find that we remove devices only after DEVICE_DELETED event.(patch:3fbf78bd).
   And it treats TIMEOUT as success. The detailed codes are shown as below:
        rc = qemuDomainWaitForDeviceRemoval(vm);
        if (rc == 0 || rc == 1)
          ret = qemuDomainRemoveDiskDevice(driver, vm, detach);
        else
          ret = 0;


   Here comes the problem:
   If 
   1. We pass flags=3(VIR_DOMAIN_AFFECT_LIVE|VIR_DOMAIN_AFFECT_CONFIG) to virDomainDetachDeviceFlags,  
   2. It timed out to receive DEVICE_DELETED event, virDomainDetachDeviceFlags api will return 0(succeed).
     Please be aware that:  vm->newdef(persistent) removes the device while vm->def(transient) keeps it untouched.
   3. Then we try to attach the same device with flag 3, because it differs in newDef and def, the API virDomainDetachDeviceFlags() returns ERROR.
     Consequent attach/detach jobs all fail after then.

   So, shall we make it return FAIL when it fails in qemuDomainWaitForDeviceRemoval()? Or just remove the device in def after we get the DEVICE_DELETED event? 
   Any ideas, thanks!


--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list



[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]