
On 16/05/13 01:23, Laine Stump wrote:
On 05/15/2013 11:25 AM, Osier Yang wrote:
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. Then instead of the very specific callback function you've added, why not add a "sysfsroot" that would be accessed by any commandline-building function that needed access to sysfs?
That's what I did in v1, or I misunderstood you (because I saw you looked at this after v1, from the time)
This patch is needed to fix a regression, so this may not be the best time to be discussing what is the optimum design, but we should try to keep it as simple as possible, and having a callback object that must be completely filled in by any caller seems complicated (I notice you didn't check for the possibility of the callback pointers being NULL).
The only place needs to check if the callback pointer is NULL or not is qemuBuildSCSIHostdevDrvStr. I can make the change if we get an agreement.
Has anyone enumerated exactly what are the actions currently performed inside qemuBuildCommandLine() that shouldn't be there?
-- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list