[libvirt-users] Where does "cmd" initailize in qemu_command.c?

He Xin core.he416 at gmail.com
Thu Aug 16 16:52:41 UTC 2012


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

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/libvirt-users/attachments/20120817/a1b6a72d/attachment.htm>


More information about the libvirt-users mailing list