Where does "cmd" initailize in qemu_command.c?

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

 



Hi,

         Excuse me, I have a question when I reading the libvirt source codes.

         I have known the process of how libvirt start/manage qemu, since I need to write a driver based on libvirt. But one thing also confused, please give me some tips.

         1.

In qemu_command.c, there is a function call “cmd = virCommandNewArgList(emulator, "-S", NULL);”, which initializes pointer “cmd”. However, I don’t find the initial value of “cmd->args”, which represents the input of virFindFileInPath in Util.c. Through virFindFileInPath, one could find a requested executable file in the PATH env to start specified hypervisors.

So could you please tell me what the value of args[0] is? Or where does cmd->args initialize?

         2.

         In qemu_driver.c, there is a function call “vm = virDomainFindByUUID(&driver->domains, dom->uuid);”, whose returned value “vm” is important in the next functions. Then we could get the “vm”’s value in hash.c which is the end part to lookup domains saved in hashtable.

May I know where does HashTable initialize? I mean where can I set the hashtable’s values in detail, if I want to modify some values?

         3.

         This might be the same as question 1.

         In command.c, “execve(cmd->args[0], cmd->args, cmd->env)” is a way to exec command. About qemu_driver, what is the value of those three inputs?

 

         Thanks a lot!

 

         Regard,

         Corey

_______________________________________________
libvirt-users mailing list
libvirt-users@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvirt-users

[Index of Archives]     [Virt Tools]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Yosemite News]     [KDE Users]

  Powered by Linux