On 02/29/2012 07:26 PM, Ansis Atteka wrote:
Unfortunately this isn't an option. Files in the util directory can't reference anything in the conf directory (or anywhere else). See the followon to this patch I just posted: https://www.redhat.com/archives/libvir-list/2012-March/msg00043.html (I actually found this extra #include when doing a grep of #includes in the conf directory to make sure I was correctly remembering this restriction) I've actually been thinking about this in the back of my mind ever since your original patch. I think the solution for the "discourage" bool may be to replace the existing "bool up" parameter of virNetDevTapCreateInBridgePort with a "flags" parameter, then add the following two flags: typedef enum { /* bring the interface up */ VIR_NETDEV_TAP_CREATE_IFUP = 1 << 0, /* Set this interface's MAC as the bridge's MAC address */ VIR_NETDEV_TAP_CREATE_USE_MAC_FOR_BRIDGE = 1 << 1, } virNetDevTapCreateFlags; In the general case of virNetDevTapCreateInBridgePort, flags would be (VIR_NETDEV_TAP_CREATE_IFUP), but in the one "odd" case (where we are creating the tap device just so that the bridge would have the provided MAC address, flags would be (VIR_NETDEV_TAP_CREATE_USE_MAC_FOR_BRIDGE) (since the dummy tap device created for this purpose doesn't get ifup'ed). I'm going for a short walk, then will modify your original patch to do this and post it back to the list. That doesn't help you with the uuid problem (which again can't be solved in the way you're describing because nothing from the conf directory can be used in the util directory). For that case, I think the least controversial way would be adding it to the arglist all the way down the call chain. I am curious, though, if anyone else has an opinion on the idea of putting a "hidden" value into virNetDevVPortProfile - this would just be a sub-struct at the end called "hidden" that would never be used by the parse or format function, but could be used to carry around things like a copy of the domain's uuid to all the places that use a virtPortProfile; seems like it might be generally useful. |
-- libvir-list mailing list libvir-list@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/libvir-list