On 08/16/2012 10:52 AM, He Xin wrote: > > 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? cmd->args is initialized by the constructor - in this case, you are using the virCommandNewArgList constructor, so cmd->args[0] will be a copy of your 'emulator' parameter. So, you merely need trace back up the call stack to see where 'emulator' was first determined (hint: it came from virDomainDefPtr def->emulator, which was populated during virDomainDefParseXML to either match the explicit <emulator> tag in your XML or fall back to the default stored in the virCapsPtr caps structure). > 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? The &driver->domains hash table is manipulated via functions in src/conf/domain_conf.c. > > 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? Yes, this is the same as question 1 - these values are determined by all the calls to the virCommand* functions acting on the cmd structure. Your questions seem to be more of a development nature about the libvirt source code, and less of a user nature about how to use the API in using the libvirt as a library in your own code. As such, you should probably take future questions of this nature to libvir-lists@xxxxxxxxxx. -- Eric Blake eblake@xxxxxxxxxx +1-919-301-3266 Libvirt virtualization library http://libvirt.org
Attachment:
signature.asc
Description: OpenPGP digital signature
_______________________________________________ libvirt-users mailing list libvirt-users@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/libvirt-users