]> xenbits.xensource.com Git - libvirt.git/commit
qemu: Add callback struct for qemuBuildCommandLine
authorOsier Yang <jyang@redhat.com>
Fri, 17 May 2013 10:34:24 +0000 (18:34 +0800)
committerOsier Yang <jyang@redhat.com>
Mon, 20 May 2013 12:14:19 +0000 (20:14 +0800)
commit3a6204cbbdf60b24f67ab48997598a88063264d6
tree88e9808968d09443641081c52c63953c2e406196
parent8b7b43a1d4888ec0041448d681982c9ad4c3d4ab
qemu: Add callback struct for qemuBuildCommandLine

Since 0d70656afded, it starts to access the sysfs files to build
the qemu command line (by virSCSIDeviceGetSgName, which is to find
out the scsi generic device name by adpater:bus:target:unit), there
is no way to work around, qemu wants to see the scsi generic device
like "/dev/sg6" anyway.

And there might be other places which need to access sysfs files
when building qemu command line in future.

Instead of increasing the arguments of qemuBuildCommandLine, this
introduces a new callback for qemuBuildCommandLine, and thus tests
can register their own callbacks for sysfs test input files accessing.

* src/qemu/qemu_command.h: (New callback struct
                            qemuBuildCommandLineCallbacks;
                            extern buildCommandLineCallbacks)
* src/qemu/qemu_command.c: (wire up the callback struct)
* src/qemu/qemu_driver.c: (Use the new syntax of qemuBuildCommandLine)
* src/qemu/qemu_hotplug.c: Likewise
* src/qemu/qemu_process.c: Likewise
* tests/testutilsqemu.[ch]: (Helper testSCSIDeviceGetSgName;
                             callback struct testCallbacks;)
* tests/qemuxml2argvtest.c: (Use testCallbacks)
* src/tests/qemuxmlnstest.c: (Like above)
src/qemu/qemu_command.c
src/qemu/qemu_command.h
src/qemu/qemu_driver.c
src/qemu/qemu_hotplug.c
src/qemu/qemu_process.c
tests/qemuxml2argvtest.c
tests/qemuxmlnstest.c
tests/testutilsqemu.c
tests/testutilsqemu.h