Re: [libvirt] [PATCH resend V10 01/12] Resctrl: Add some utils functions
On Wed, Mar 29, 2017 at 05:59:47PM +0800, Eli Qiao wrote: On Wednesday, 29 March 2017 at 5:47 PM, Martin Kletzander wrote: On Wed, Mar 29, 2017 at 05:31:42PM +0800, Eli Qiao wrote: > > > -- > Best regards > Eli > > 天涯无处不重逢 > a leaf duckweed belongs to the sea, where not to meet in life > > Sent with Sparrow (http://www.sparrowmailapp.com/?sig) OK, please do something with your client. Having the footer here on top for every reply is *so* bothersome when you are replying inline (that part is fine). Sorry, I removed footer, better now? Way better, thank you very much. I always didn't know whether to look for the rest of the message or not. And as you can see, after some replies, it's hard to read what was discussed: > On Wednesday, 29 March 2017 at 5:19 PM, Martin Kletzander wrote: > > > On Wed, Mar 29, 2017 at 04:22:16PM +0800, Eli Qiao wrote: > > > > > > > > > -- > > > Best regards > > > Eli > > > > > > 天涯无处不重逢 > > > a leaf duckweed belongs to the sea, where not to meet in life > > > > > > Sent with Sparrow (http://www.sparrowmailapp.com/?sig) > > > > > > > > > On Wednesday, 29 March 2017 at 3:45 PM, Martin Kletzander wrote: > > > > > > > On Tue, Mar 28, 2017 at 03:22:34PM +0800, Eli Qiao wrote: Look hoe much space it took ^^, and that's only once in there ;) > > > > > hi Martin > > > > > > > > > > (cc libvir-list) > > > > > > > > > > I am a little confused about cat support. > > > > > > > > > > I am currently rebasing my code on top of pre-cat branch from your private github repo, today when I check it you have removed it and create a cat branch and there are some related code pushed[1], can I know what ’s your plan for my patch set for CAT support ? should I continue my rebasing work? your though? > > > > > > > > So we can work together on that. Since the rework of the sysfs > > > > functions, some patches are easier to write from scratch then rewrite, > > > > but I'm now just trying to setup the test suite, so that we have > > > > something to test on, at least some of the code. So where are you in > > > > the rebase right now? Do you think anything from the virsysfs.c code > > > > could be enhanced? > > > > > > > > > > > > > > > > > > > > > > Not so fast, only the first patch [1], I found that nodeinfo.c is removed :( > > > > > > I think we need to extend virResCtrlGetInfoStr and virResCtrlGetInfoUint to virsysfs.c > > > > > > thought ? > > > > Yeah, we should wrap around /sys/fs/resctrl as we do with > > /sys/devices/system so that it can be easily tested. > > > > Sure, working on it, and done, will push it for review. > > Also I will push some fake data for resctrl testing.. > > > > > > Also I got another idea about keeping the resource info. There is no > > need for any global data to be stored as you are re-reading almost all > > of it. The only info that stays the same is caches (that is already > > saved in capabilities) and what caches are available for resource > > control (that will be there as well). So I don't think we need yet > > another global data storage. > > > > > Do you mean, we re-create all struct (reading them from /sys/fs/resctrl) when we create/destroy instance? > also, for get free cache ? > You have to update that for every request anyway, so what's the point of keeping the data when they immediately become old? I was thought that may reduce the time costing, not all of the content be refreshed, anyway, I will try to avoid global files in my later version. Well, if there is something that does not need refreshing, then you might consider adding it to capabilities (if it is helpful to the user in any way). signature.asc Description: Digital signature -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH resend V10 01/12] Resctrl: Add some utils functions
On Wednesday, 29 March 2017 at 5:47 PM, Martin Kletzander wrote: > On Wed, Mar 29, 2017 at 05:31:42PM +0800, Eli Qiao wrote: > > > > > > -- > > Best regards > > Eli > > > > 天涯无处不重逢 > > a leaf duckweed belongs to the sea, where not to meet in life > > > > Sent with Sparrow (http://www.sparrowmailapp.com/?sig) > > OK, please do something with your client. Having the footer here on top > for every reply is *so* bothersome when you are replying inline > (that part is fine). > Sorry, I removed footer, better now? > > > On Wednesday, 29 March 2017 at 5:19 PM, Martin Kletzander wrote: > > > > > On Wed, Mar 29, 2017 at 04:22:16PM +0800, Eli Qiao wrote: > > > > > > > > > > > > -- > > > > Best regards > > > > Eli > > > > > > > > 天涯无处不重逢 > > > > a leaf duckweed belongs to the sea, where not to meet in life > > > > > > > > Sent with Sparrow (http://www.sparrowmailapp.com/?sig) > > > > > > > > > > > > On Wednesday, 29 March 2017 at 3:45 PM, Martin Kletzander wrote: > > > > > > > > > On Tue, Mar 28, 2017 at 03:22:34PM +0800, Eli Qiao wrote: > > > > > > hi Martin > > > > > > > > > > > > (cc libvir-list) > > > > > > > > > > > > I am a little confused about cat support. > > > > > > > > > > > > I am currently rebasing my code on top of pre-cat branch from your > > > > > > private github repo, today when I check it you have removed it and > > > > > > create a cat branch and there are some related code pushed[1], can > > > > > > I know what ’s your plan for my patch set for CAT support ? should > > > > > > I continue my rebasing work? your though? > > > > > > > > > > So we can work together on that. Since the rework of the sysfs > > > > > functions, some patches are easier to write from scratch then rewrite, > > > > > but I'm now just trying to setup the test suite, so that we have > > > > > something to test on, at least some of the code. So where are you in > > > > > the rebase right now? Do you think anything from the virsysfs.c code > > > > > could be enhanced? > > > > > > > > > > > > > > > > > > > > > > > > > > > > > Not so fast, only the first patch [1], I found that nodeinfo.c is > > > > removed :( > > > > > > > > I think we need to extend virResCtrlGetInfoStr and > > > > virResCtrlGetInfoUint to virsysfs.c > > > > > > > > thought ? > > > > > > Yeah, we should wrap around /sys/fs/resctrl as we do with > > > /sys/devices/system so that it can be easily tested. > > > > > > > Sure, working on it, and done, will push it for review. > > > > Also I will push some fake data for resctrl testing.. > > > > > > > > > > Also I got another idea about keeping the resource info. There is no > > > need for any global data to be stored as you are re-reading almost all > > > of it. The only info that stays the same is caches (that is already > > > saved in capabilities) and what caches are available for resource > > > control (that will be there as well). So I don't think we need yet > > > another global data storage. > > > > > > > > > Do you mean, we re-create all struct (reading them from /sys/fs/resctrl) > > when we create/destroy instance? > > also, for get free cache ? > > > > > You have to update that for every request anyway, so what's the point of > keeping the data when they immediately become old? > I was thought that may reduce the time costing, not all of the content be refreshed, anyway, I will try to avoid global files in my later version. LoL lots of rebasing :( Thanks for your suggestion. > > > This is what I did in my early PoC, that will much easier… but please keep > > in mind that only one thread can read/write to /sys/fs/resctrl at one time. > > > Yeah, that's what we have locks for. > > > the neck bottle is /sys/fs/resctrl > > Sure you mean bottleneck, right? :) yes, bottleneck, -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH resend V10 01/12] Resctrl: Add some utils functions
On Wed, Mar 29, 2017 at 05:31:42PM +0800, Eli Qiao wrote: -- Best regards Eli 天涯无处不重逢 a leaf duckweed belongs to the sea, where not to meet in life Sent with Sparrow (http://www.sparrowmailapp.com/?sig) OK, please do something with your client. Having the footer here on top for every reply is *so* bothersome when you are replying inline (that part is fine). On Wednesday, 29 March 2017 at 5:19 PM, Martin Kletzander wrote: On Wed, Mar 29, 2017 at 04:22:16PM +0800, Eli Qiao wrote: > > > -- > Best regards > Eli > > 天涯无处不重逢 > a leaf duckweed belongs to the sea, where not to meet in life > > Sent with Sparrow (http://www.sparrowmailapp.com/?sig) > > > On Wednesday, 29 March 2017 at 3:45 PM, Martin Kletzander wrote: > > > On Tue, Mar 28, 2017 at 03:22:34PM +0800, Eli Qiao wrote: > > > hi Martin > > > > > > (cc libvir-list) > > > > > > I am a little confused about cat support. > > > > > > I am currently rebasing my code on top of pre-cat branch from your private github repo, today when I check it you have removed it and create a cat branch and there are some related code pushed[1], can I know what ’s your plan for my patch set for CAT support ? should I continue my rebasing work? your though? > > > > So we can work together on that. Since the rework of the sysfs > > functions, some patches are easier to write from scratch then rewrite, > > but I'm now just trying to setup the test suite, so that we have > > something to test on, at least some of the code. So where are you in > > the rebase right now? Do you think anything from the virsysfs.c code > > could be enhanced? > > > > > > > Not so fast, only the first patch [1], I found that nodeinfo.c is removed :( > > I think we need to extend virResCtrlGetInfoStr and virResCtrlGetInfoUint to virsysfs.c > > thought ? Yeah, we should wrap around /sys/fs/resctrl as we do with /sys/devices/system so that it can be easily tested. Sure, working on it, and done, will push it for review. Also I will push some fake data for resctrl testing.. Also I got another idea about keeping the resource info. There is no need for any global data to be stored as you are re-reading almost all of it. The only info that stays the same is caches (that is already saved in capabilities) and what caches are available for resource control (that will be there as well). So I don't think we need yet another global data storage. Do you mean, we re-create all struct (reading them from /sys/fs/resctrl) when we create/destroy instance? also, for get free cache ? You have to update that for every request anyway, so what's the point of keeping the data when they immediately become old? This is what I did in my early PoC, that will much easier… but please keep in mind that only one thread can read/write to /sys/fs/resctrl at one time. Yeah, that's what we have locks for. the neck bottle is /sys/fs/resctrl Sure you mean bottleneck, right? :) signature.asc Description: Digital signature -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH resend V10 01/12] Resctrl: Add some utils functions
-- Best regards Eli 天涯无处不重逢 a leaf duckweed belongs to the sea, where not to meet in life Sent with Sparrow (http://www.sparrowmailapp.com/?sig) On Wednesday, 29 March 2017 at 5:19 PM, Martin Kletzander wrote: > On Wed, Mar 29, 2017 at 04:22:16PM +0800, Eli Qiao wrote: > > > > > > -- > > Best regards > > Eli > > > > 天涯无处不重逢 > > a leaf duckweed belongs to the sea, where not to meet in life > > > > Sent with Sparrow (http://www.sparrowmailapp.com/?sig) > > > > > > On Wednesday, 29 March 2017 at 3:45 PM, Martin Kletzander wrote: > > > > > On Tue, Mar 28, 2017 at 03:22:34PM +0800, Eli Qiao wrote: > > > > hi Martin > > > > > > > > (cc libvir-list) > > > > > > > > I am a little confused about cat support. > > > > > > > > I am currently rebasing my code on top of pre-cat branch from your > > > > private github repo, today when I check it you have removed it and > > > > create a cat branch and there are some related code pushed[1], can I > > > > know what ’s your plan for my patch set for CAT support ? should I > > > > continue my rebasing work? your though? > > > > > > So we can work together on that. Since the rework of the sysfs > > > functions, some patches are easier to write from scratch then rewrite, > > > but I'm now just trying to setup the test suite, so that we have > > > something to test on, at least some of the code. So where are you in > > > the rebase right now? Do you think anything from the virsysfs.c code > > > could be enhanced? > > > > > > > > > > > > > Not so fast, only the first patch [1], I found that nodeinfo.c is removed :( > > > > I think we need to extend virResCtrlGetInfoStr and virResCtrlGetInfoUint to > > virsysfs.c > > > > thought ? > > Yeah, we should wrap around /sys/fs/resctrl as we do with > /sys/devices/system so that it can be easily tested. > Sure, working on it, and done, will push it for review. Also I will push some fake data for resctrl testing.. > > Also I got another idea about keeping the resource info. There is no > need for any global data to be stored as you are re-reading almost all > of it. The only info that stays the same is caches (that is already > saved in capabilities) and what caches are available for resource > control (that will be there as well). So I don't think we need yet > another global data storage. > > Do you mean, we re-create all struct (reading them from /sys/fs/resctrl) when we create/destroy instance? also, for get free cache ? This is what I did in my early PoC, that will much easier… but please keep in mind that only one thread can read/write to /sys/fs/resctrl at one time. the neck bottle is /sys/fs/resctrl > > > -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH resend V10 01/12] Resctrl: Add some utils functions
On Wed, Mar 29, 2017 at 04:22:16PM +0800, Eli Qiao wrote: -- Best regards Eli 天涯无处不重逢 a leaf duckweed belongs to the sea, where not to meet in life Sent with Sparrow (http://www.sparrowmailapp.com/?sig) On Wednesday, 29 March 2017 at 3:45 PM, Martin Kletzander wrote: On Tue, Mar 28, 2017 at 03:22:34PM +0800, Eli Qiao wrote: > hi Martin > > (cc libvir-list) > > I am a little confused about cat support. > > I am currently rebasing my code on top of pre-cat branch from your private github repo, today when I check it you have removed it and create a cat branch and there are some related code pushed[1], can I know what ’s your plan for my patch set for CAT support ? should I continue my rebasing work? your though? So we can work together on that. Since the rework of the sysfs functions, some patches are easier to write from scratch then rewrite, but I'm now just trying to setup the test suite, so that we have something to test on, at least some of the code. So where are you in the rebase right now? Do you think anything from the virsysfs.c code could be enhanced? Not so fast, only the first patch [1], I found that nodeinfo.c is removed :( I think we need to extend virResCtrlGetInfoStr and virResCtrlGetInfoUint to virsysfs.c thought ? Yeah, we should wrap around /sys/fs/resctrl as we do with /sys/devices/system so that it can be easily tested. Also I got another idea about keeping the resource info. There is no need for any global data to be stored as you are re-reading almost all of it. The only info that stays the same is caches (that is already saved in capabilities) and what caches are available for resource control (that will be there as well). So I don't think we need yet another global data storage. signature.asc Description: Digital signature -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH resend V10 01/12] Resctrl: Add some utils functions
-- Best regards Eli 天涯无处不重逢 a leaf duckweed belongs to the sea, where not to meet in life Sent with Sparrow (http://www.sparrowmailapp.com/?sig) On Wednesday, 29 March 2017 at 3:45 PM, Martin Kletzander wrote: > On Tue, Mar 28, 2017 at 03:22:34PM +0800, Eli Qiao wrote: > > hi Martin > > > > (cc libvir-list) > > > > I am a little confused about cat support. > > > > I am currently rebasing my code on top of pre-cat branch from your private > > github repo, today when I check it you have removed it and create a cat > > branch and there are some related code pushed[1], can I know what ’s your > > plan for my patch set for CAT support ? should I continue my rebasing work? > > your though? > > So we can work together on that. Since the rework of the sysfs > functions, some patches are easier to write from scratch then rewrite, > but I'm now just trying to setup the test suite, so that we have > something to test on, at least some of the code. So where are you in > the rebase right now? Do you think anything from the virsysfs.c code > could be enhanced? > > Not so fast, only the first patch [1], I found that nodeinfo.c is removed :( I think we need to extend virResCtrlGetInfoStr and virResCtrlGetInfoUint to virsysfs.c thought ? [1]https://github.com/taget/libvirt/commits/cdp_v11 > > > [1] > > https://github.com/nertpinx/libvirt/commit/c335de47a4efeca87f23e641a93587b1e036e558 > > > > Thanks Eli. > > > > > > > > -- > > Best regards > > Eli > > > > 天涯无处不重逢 > > a leaf duckweed belongs to the sea, where not to meet in life > > > > Sent with Sparrow (http://www.sparrowmailapp.com/?sig) > > > > > > On Friday, 24 March 2017 at 3:42 PM, Martin Kletzander wrote: > > > > > On Fri, Mar 24, 2017 at 09:35:33AM +0800, Eli Qiao wrote: > > > > > > > > > > > > -- > > > > Best regards > > > > Eli > > > > > > > > 天涯无处不重逢 > > > > a leaf duckweed belongs to the sea, where not to meet in life > > > > > > > > Sent with Sparrow (http://www.sparrowmailapp.com/?sig) > > > > > > > > > > > > On Thursday, 16 March 2017 at 3:52 PM, Eli Qiao wrote: > > > > > > > > > > > > > > > > > > > -- > > > > > Best regards > > > > > Eli > > > > > > > > > > 天涯无处不重逢 > > > > > a leaf duckweed belongs to the sea, where not to meet in life > > > > > > > > > > Sent with Sparrow (http://www.sparrowmailapp.com/?sig) > > > > > > > > > > > > > > > On Wednesday, 15 March 2017 at 7:57 PM, Martin Kletzander wrote: > > > > > > > > > > > On Mon, Mar 06, 2017 at 06:06:30PM +0800, Eli Qiao wrote: > > > > > > > This patch adds some utils struct and functions to expose resctrl > > > > > > > information. > > > > > > > > > > > > > > virResCtrlAvailable: if resctrl interface exist on host. > > > > > > > virResCtrlGet: get specific type resource control information. > > > > > > > virResCtrlInit: initialize resctrl struct from the host's sys fs. > > > > > > > resctrlall[]: an array to maintain resource control information. > > > > > > > > > > > > > > Some of host cpu related information methods was added in > > > > > > > virhostcpu.c > > > > > > > > > > > > So to be able to test all this we need to make a bit different > > > > > > approach. > > > > > > I'm not in favour of pushing this without proper tests. Some paths > > > > > > need > > > > > > to be configurable, some readings should be unified. Unfortunately > > > > > > lot > > > > > > of the code is just copy-paste mess from the past. Fortunately for > > > > > > you, > > > > > > > > > > > > > > > > > > > > > > > > I'm working on cleaning this up, at least a little bit, so that we > > > > > > can > > > > > > > > > > Good news. > > > > > > add the tests easily. I got almost up to the test (I stumbled upon > > > > > > few > > > > > > rabbit holes on the way and some clean-ups went wrong along the > > > > > > way), so > > > > > > it should be pretty easy for you to modify this code to use what > > > > > > I'll be > > > > > > proposing to add. It's not ready yet, but you can start rebasing > > > > > > your > > > > > > series on top of my branch pre-cat from my github repo [1]. The > > > > > > commits > > > > > > are not very well described right now (for some temporary ones I > > > > > > used > > > > > > whatthecommit.com (http://whatthecommit.com), sorry), but I'll fix > > > > > > all that. I'll be updating the > > > > > > branch, but it will be done with force pushes, so be careful when > > > > > > rebasing on top of newer versions. > > > > > > > > > > > > I can do that if you don't want, just let me know so we can > > > > > > coordinate. > > > > > of cause we can do some coordinate, but I am glad that you can help > > > > > on this to speed up the progress to merge them, as you know this > > > > > patch is in V10 already, and it has 12 patch set, kinds of hard to > > > > > doing rebase… :( > > > > > > > > > > > > > > > > Just a quick heads-up, there will be virsysfs that will be used for > > > > > >
Re: [libvirt] [PATCH resend V10 01/12] Resctrl: Add some utils functions
On Tue, Mar 28, 2017 at 03:22:34PM +0800, Eli Qiao wrote: hi Martin (cc libvir-list) I am a little confused about cat support. I am currently rebasing my code on top of pre-cat branch from your private github repo, today when I check it you have removed it and create a cat branch and there are some related code pushed[1], can I know what ’s your plan for my patch set for CAT support ? should I continue my rebasing work? your though? So we can work together on that. Since the rework of the sysfs functions, some patches are easier to write from scratch then rewrite, but I'm now just trying to setup the test suite, so that we have something to test on, at least some of the code. So where are you in the rebase right now? Do you think anything from the virsysfs.c code could be enhanced? [1] https://github.com/nertpinx/libvirt/commit/c335de47a4efeca87f23e641a93587b1e036e558 Thanks Eli. -- Best regards Eli 天涯无处不重逢 a leaf duckweed belongs to the sea, where not to meet in life Sent with Sparrow (http://www.sparrowmailapp.com/?sig) On Friday, 24 March 2017 at 3:42 PM, Martin Kletzander wrote: On Fri, Mar 24, 2017 at 09:35:33AM +0800, Eli Qiao wrote: > > > -- > Best regards > Eli > > 天涯无处不重逢 > a leaf duckweed belongs to the sea, where not to meet in life > > Sent with Sparrow (http://www.sparrowmailapp.com/?sig) > > > On Thursday, 16 March 2017 at 3:52 PM, Eli Qiao wrote: > > > > > > > -- > > Best regards > > Eli > > > > 天涯无处不重逢 > > a leaf duckweed belongs to the sea, where not to meet in life > > > > Sent with Sparrow (http://www.sparrowmailapp.com/?sig) > > > > > > On Wednesday, 15 March 2017 at 7:57 PM, Martin Kletzander wrote: > > > > > On Mon, Mar 06, 2017 at 06:06:30PM +0800, Eli Qiao wrote: > > > > This patch adds some utils struct and functions to expose resctrl > > > > information. > > > > > > > > virResCtrlAvailable: if resctrl interface exist on host. > > > > virResCtrlGet: get specific type resource control information. > > > > virResCtrlInit: initialize resctrl struct from the host's sys fs. > > > > resctrlall[]: an array to maintain resource control information. > > > > > > > > Some of host cpu related information methods was added in virhostcpu.c > > > > > > So to be able to test all this we need to make a bit different approach. > > > I'm not in favour of pushing this without proper tests. Some paths need > > > to be configurable, some readings should be unified. Unfortunately lot > > > of the code is just copy-paste mess from the past. Fortunately for you, > > > > > > > > > > > > I'm working on cleaning this up, at least a little bit, so that we can > > > > Good news. > > > add the tests easily. I got almost up to the test (I stumbled upon few > > > rabbit holes on the way and some clean-ups went wrong along the way), so > > > it should be pretty easy for you to modify this code to use what I'll be > > > proposing to add. It's not ready yet, but you can start rebasing your > > > series on top of my branch pre-cat from my github repo [1]. The commits > > > are not very well described right now (for some temporary ones I used > > > whatthecommit.com (http://whatthecommit.com), sorry), but I'll fix all that. I'll be updating the > > > branch, but it will be done with force pushes, so be careful when > > > rebasing on top of newer versions. > > > > > > I can do that if you don't want, just let me know so we can coordinate. > > of cause we can do some coordinate, but I am glad that you can help on this to speed up the progress to merge them, as you know this patch is in V10 already, and it has 12 patch set, kinds of hard to doing rebase… :( > > > > > > > Just a quick heads-up, there will be virsysfs that will be used for the > > > reads, some additional helper functions in virhostcpu and virfile, test > > > that scans copy of /sys/devices/system (with that path faked thanks to > > > using the aforementioned virsysfs) and outputs capabilities so that we > > > can check the capability XML and so on. > > > > > > > > > > > Ah, that’s a good news.. > > > > > > Martin > > > > > > [1] https://github.com/nertpinx/libvirt > > hi Martin > > So, if I understand you correctly , you want all my patch set to rebased on top of pre-cat branch [1] , I checked that the last commit is 15th March, I wonder if that ’s ready to merged into master? > so that I can start doing the rebasing > I forgot to do the usual push, it's updated now. The test fails in one occasion, but it's the code's fault, the test is fine. That's the last thing I'm looking at now, after that I'll send it to the list. Look at the changes and see what you can use, it will help simplifying your code a lot, I thing. You can start rebasing on top of that, I'll do that as well after it's posted and I'll be either using and modifying your patches or maybe doing some myself. Martin signature.asc Description: Digital signature -- libvir-list mailing list libvir-list@redhat.com
Re: [libvirt] [PATCH resend V10 01/12] Resctrl: Add some utils functions
hi Martin (cc libvir-list) I am a little confused about cat support. I am currently rebasing my code on top of pre-cat branch from your private github repo, today when I check it you have removed it and create a cat branch and there are some related code pushed[1], can I know what ’s your plan for my patch set for CAT support ? should I continue my rebasing work? your though? [1] https://github.com/nertpinx/libvirt/commit/c335de47a4efeca87f23e641a93587b1e036e558 Thanks Eli. -- Best regards Eli 天涯无处不重逢 a leaf duckweed belongs to the sea, where not to meet in life Sent with Sparrow (http://www.sparrowmailapp.com/?sig) On Friday, 24 March 2017 at 3:42 PM, Martin Kletzander wrote: > On Fri, Mar 24, 2017 at 09:35:33AM +0800, Eli Qiao wrote: > > > > > > -- > > Best regards > > Eli > > > > 天涯无处不重逢 > > a leaf duckweed belongs to the sea, where not to meet in life > > > > Sent with Sparrow (http://www.sparrowmailapp.com/?sig) > > > > > > On Thursday, 16 March 2017 at 3:52 PM, Eli Qiao wrote: > > > > > > > > > > > -- > > > Best regards > > > Eli > > > > > > 天涯无处不重逢 > > > a leaf duckweed belongs to the sea, where not to meet in life > > > > > > Sent with Sparrow (http://www.sparrowmailapp.com/?sig) > > > > > > > > > On Wednesday, 15 March 2017 at 7:57 PM, Martin Kletzander wrote: > > > > > > > On Mon, Mar 06, 2017 at 06:06:30PM +0800, Eli Qiao wrote: > > > > > This patch adds some utils struct and functions to expose resctrl > > > > > information. > > > > > > > > > > virResCtrlAvailable: if resctrl interface exist on host. > > > > > virResCtrlGet: get specific type resource control information. > > > > > virResCtrlInit: initialize resctrl struct from the host's sys fs. > > > > > resctrlall[]: an array to maintain resource control information. > > > > > > > > > > Some of host cpu related information methods was added in virhostcpu.c > > > > > > > > So to be able to test all this we need to make a bit different approach. > > > > I'm not in favour of pushing this without proper tests. Some paths need > > > > to be configurable, some readings should be unified. Unfortunately lot > > > > of the code is just copy-paste mess from the past. Fortunately for you, > > > > > > > > > > > > > > > > I'm working on cleaning this up, at least a little bit, so that we can > > > > > > Good news. > > > > add the tests easily. I got almost up to the test (I stumbled upon few > > > > rabbit holes on the way and some clean-ups went wrong along the way), so > > > > it should be pretty easy for you to modify this code to use what I'll be > > > > proposing to add. It's not ready yet, but you can start rebasing your > > > > series on top of my branch pre-cat from my github repo [1]. The commits > > > > are not very well described right now (for some temporary ones I used > > > > whatthecommit.com (http://whatthecommit.com), sorry), but I'll fix all > > > > that. I'll be updating the > > > > branch, but it will be done with force pushes, so be careful when > > > > rebasing on top of newer versions. > > > > > > > > I can do that if you don't want, just let me know so we can coordinate. > > > of cause we can do some coordinate, but I am glad that you can help on > > > this to speed up the progress to merge them, as you know this patch is in > > > V10 already, and it has 12 patch set, kinds of hard to doing rebase… :( > > > > > > > > > > Just a quick heads-up, there will be virsysfs that will be used for the > > > > reads, some additional helper functions in virhostcpu and virfile, test > > > > that scans copy of /sys/devices/system (with that path faked thanks to > > > > using the aforementioned virsysfs) and outputs capabilities so that we > > > > can check the capability XML and so on. > > > > > > > > > > > > > > > > Ah, that’s a good news.. > > > > > > > > Martin > > > > > > > > [1] https://github.com/nertpinx/libvirt > > > > hi Martin > > > > So, if I understand you correctly , you want all my patch set to rebased on > > top of pre-cat branch [1] , I checked that the last commit is 15th March, I > > wonder if that ’s ready to merged into master? > > so that I can start doing the rebasing > > > > > I forgot to do the usual push, it's updated now. The test fails in one > occasion, but it's the code's fault, the test is fine. That's the last > thing I'm looking at now, after that I'll send it to the list. > > Look at the changes and see what you can use, it will help simplifying > your code a lot, I thing. You can start rebasing on top of that, I'll > do that as well after it's posted and I'll be either using and modifying > your patches or maybe doing some myself. > > Martin -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH resend V10 01/12] Resctrl: Add some utils functions
On Fri, Mar 24, 2017 at 09:35:33AM +0800, Eli Qiao wrote: -- Best regards Eli 天涯无处不重逢 a leaf duckweed belongs to the sea, where not to meet in life Sent with Sparrow (http://www.sparrowmailapp.com/?sig) On Thursday, 16 March 2017 at 3:52 PM, Eli Qiao wrote: -- Best regards Eli 天涯无处不重逢 a leaf duckweed belongs to the sea, where not to meet in life Sent with Sparrow (http://www.sparrowmailapp.com/?sig) On Wednesday, 15 March 2017 at 7:57 PM, Martin Kletzander wrote: > On Mon, Mar 06, 2017 at 06:06:30PM +0800, Eli Qiao wrote: > > This patch adds some utils struct and functions to expose resctrl > > information. > > > > virResCtrlAvailable: if resctrl interface exist on host. > > virResCtrlGet: get specific type resource control information. > > virResCtrlInit: initialize resctrl struct from the host's sys fs. > > resctrlall[]: an array to maintain resource control information. > > > > Some of host cpu related information methods was added in virhostcpu.c > > So to be able to test all this we need to make a bit different approach. > I'm not in favour of pushing this without proper tests. Some paths need > to be configurable, some readings should be unified. Unfortunately lot > of the code is just copy-paste mess from the past. Fortunately for you, > > > > I'm working on cleaning this up, at least a little bit, so that we can > > > Good news. > add the tests easily. I got almost up to the test (I stumbled upon few > rabbit holes on the way and some clean-ups went wrong along the way), so > it should be pretty easy for you to modify this code to use what I'll be > proposing to add. It's not ready yet, but you can start rebasing your > series on top of my branch pre-cat from my github repo [1]. The commits > are not very well described right now (for some temporary ones I used > whatthecommit.com (http://whatthecommit.com), sorry), but I'll fix all that. I'll be updating the > branch, but it will be done with force pushes, so be careful when > rebasing on top of newer versions. > > I can do that if you don't want, just let me know so we can coordinate. > of cause we can do some coordinate, but I am glad that you can help on this to speed up the progress to merge them, as you know this patch is in V10 already, and it has 12 patch set, kinds of hard to doing rebase… :( > Just a quick heads-up, there will be virsysfs that will be used for the > reads, some additional helper functions in virhostcpu and virfile, test > that scans copy of /sys/devices/system (with that path faked thanks to > using the aforementioned virsysfs) and outputs capabilities so that we > can check the capability XML and so on. > > > Ah, that’s a good news.. > > Martin > > [1] https://github.com/nertpinx/libvirt hi Martin So, if I understand you correctly , you want all my patch set to rebased on top of pre-cat branch [1] , I checked that the last commit is 15th March, I wonder if that ’s ready to merged into master? so that I can start doing the rebasing I forgot to do the usual push, it's updated now. The test fails in one occasion, but it's the code's fault, the test is fine. That's the last thing I'm looking at now, after that I'll send it to the list. Look at the changes and see what you can use, it will help simplifying your code a lot, I thing. You can start rebasing on top of that, I'll do that as well after it's posted and I'll be either using and modifying your patches or maybe doing some myself. Martin signature.asc Description: Digital signature -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH resend V10 01/12] Resctrl: Add some utils functions
-- Best regards Eli 天涯无处不重逢 a leaf duckweed belongs to the sea, where not to meet in life Sent with Sparrow (http://www.sparrowmailapp.com/?sig) On Thursday, 16 March 2017 at 3:52 PM, Eli Qiao wrote: > > > -- > Best regards > Eli > > 天涯无处不重逢 > a leaf duckweed belongs to the sea, where not to meet in life > > Sent with Sparrow (http://www.sparrowmailapp.com/?sig) > > > On Wednesday, 15 March 2017 at 7:57 PM, Martin Kletzander wrote: > > > On Mon, Mar 06, 2017 at 06:06:30PM +0800, Eli Qiao wrote: > > > This patch adds some utils struct and functions to expose resctrl > > > information. > > > > > > virResCtrlAvailable: if resctrl interface exist on host. > > > virResCtrlGet: get specific type resource control information. > > > virResCtrlInit: initialize resctrl struct from the host's sys fs. > > > resctrlall[]: an array to maintain resource control information. > > > > > > Some of host cpu related information methods was added in virhostcpu.c > > > > So to be able to test all this we need to make a bit different approach. > > I'm not in favour of pushing this without proper tests. Some paths need > > to be configurable, some readings should be unified. Unfortunately lot > > of the code is just copy-paste mess from the past. Fortunately for you, > > > > > > > > I'm working on cleaning this up, at least a little bit, so that we can > > > > > > > > Good news. > > add the tests easily. I got almost up to the test (I stumbled upon few > > rabbit holes on the way and some clean-ups went wrong along the way), so > > it should be pretty easy for you to modify this code to use what I'll be > > proposing to add. It's not ready yet, but you can start rebasing your > > series on top of my branch pre-cat from my github repo [1]. The commits > > are not very well described right now (for some temporary ones I used > > whatthecommit.com (http://whatthecommit.com), sorry), but I'll fix all > > that. I'll be updating the > > branch, but it will be done with force pushes, so be careful when > > rebasing on top of newer versions. > > > > I can do that if you don't want, just let me know so we can coordinate. > > > of cause we can do some coordinate, but I am glad that you can help on this > to speed up the progress to merge them, as you know this patch is in V10 > already, and it has 12 patch set, kinds of hard to doing rebase… :( > > > > Just a quick heads-up, there will be virsysfs that will be used for the > > reads, some additional helper functions in virhostcpu and virfile, test > > that scans copy of /sys/devices/system (with that path faked thanks to > > using the aforementioned virsysfs) and outputs capabilities so that we > > can check the capability XML and so on. > > > > > > > > > Ah, that’s a good news.. > > > > Martin > > > > [1] https://github.com/nertpinx/libvirt hi Martin So, if I understand you correctly , you want all my patch set to rebased on top of pre-cat branch [1] , I checked that the last commit is 15th March, I wonder if that ’s ready to merged into master? so that I can start doing the rebasing Thx Eli. > > > > > Signed-off-by: Eli Qiao> > (mailto:liyong.q...@intel.com)> > > > --- > > > include/libvirt/virterror.h | 1 + > > > po/POTFILES.in (http://POTFILES.in) | 1 + > > > src/Makefile.am (http://Makefile.am) | 1 + > > > src/libvirt_private.syms | 4 + > > > src/util/virerror.c | 1 + > > > src/util/virhostcpu.c | 186 > > > src/util/virhostcpu.h | 6 ++ > > > src/util/virresctrl.c | 201 > > > src/util/virresctrl.h | 78 + > > > 9 files changed, 462 insertions(+), 17 deletions(-) > > > create mode 100644 src/util/virresctrl.c > > > create mode 100644 src/util/virresctrl.h > > > > > > diff --git a/include/libvirt/virterror.h b/include/libvirt/virterror.h > > > index 2efee8f..3dd2d08 100644 > > > --- a/include/libvirt/virterror.h > > > +++ b/include/libvirt/virterror.h > > > @@ -132,6 +132,7 @@ typedef enum { > > > > > > VIR_FROM_PERF = 65, /* Error from perf */ > > > VIR_FROM_LIBSSH = 66, /* Error from libssh connection transport */ > > > + VIR_FROM_RESCTRL = 67, /* Error from resource control */ > > > > > > # ifdef VIR_ENUM_SENTINELS > > > VIR_ERR_DOMAIN_LAST > > > diff --git a/po/POTFILES.in (http://POTFILES.in) b/po/POTFILES.in > > > (http://POTFILES.in) > > > index 7c7f530..4147bc6 100644 > > > --- a/po/POTFILES.in (http://POTFILES.in) > > > +++ b/po/POTFILES.in (http://POTFILES.in) > > > @@ -241,6 +241,7 @@ src/util/virportallocator.c > > > src/util/virprocess.c > > > src/util/virqemu.c > > > src/util/virrandom.c > > > +src/util/virresctrl.c > > > src/util/virrotatingfile.c > > > src/util/virscsi.c > > > src/util/virscsihost.c > > > diff --git a/src/Makefile.am (http://Makefile.am) b/src/Makefile.am > > > (http://Makefile.am) > > > index 7d42eac..edb946a 100644 > > > ---
Re: [libvirt] [PATCH resend V10 01/12] Resctrl: Add some utils functions
-- Best regards Eli 天涯无处不重逢 a leaf duckweed belongs to the sea, where not to meet in life Sent with Sparrow (http://www.sparrowmailapp.com/?sig) On Wednesday, 15 March 2017 at 7:57 PM, Martin Kletzander wrote: > On Mon, Mar 06, 2017 at 06:06:30PM +0800, Eli Qiao wrote: > > This patch adds some utils struct and functions to expose resctrl > > information. > > > > virResCtrlAvailable: if resctrl interface exist on host. > > virResCtrlGet: get specific type resource control information. > > virResCtrlInit: initialize resctrl struct from the host's sys fs. > > resctrlall[]: an array to maintain resource control information. > > > > Some of host cpu related information methods was added in virhostcpu.c > > So to be able to test all this we need to make a bit different approach. > I'm not in favour of pushing this without proper tests. Some paths need > to be configurable, some readings should be unified. Unfortunately lot > of the code is just copy-paste mess from the past. Fortunately for you, > > > I'm working on cleaning this up, at least a little bit, so that we can > > Good news. > add the tests easily. I got almost up to the test (I stumbled upon few > rabbit holes on the way and some clean-ups went wrong along the way), so > it should be pretty easy for you to modify this code to use what I'll be > proposing to add. It's not ready yet, but you can start rebasing your > series on top of my branch pre-cat from my github repo [1]. The commits > are not very well described right now (for some temporary ones I used > whatthecommit.com (http://whatthecommit.com), sorry), but I'll fix all that. > I'll be updating the > branch, but it will be done with force pushes, so be careful when > rebasing on top of newer versions. > > I can do that if you don't want, just let me know so we can coordinate. > of cause we can do some coordinate, but I am glad that you can help on this to speed up the progress to merge them, as you know this patch is in V10 already, and it has 12 patch set, kinds of hard to doing rebase… :( > > Just a quick heads-up, there will be virsysfs that will be used for the > reads, some additional helper functions in virhostcpu and virfile, test > that scans copy of /sys/devices/system (with that path faked thanks to > using the aforementioned virsysfs) and outputs capabilities so that we > can check the capability XML and so on. > > Ah, that’s a good news.. > > Martin > > [1] https://github.com/nertpinx/libvirt > > > Signed-off-by: Eli Qiao> (mailto:liyong.q...@intel.com)> > > --- > > include/libvirt/virterror.h | 1 + > > po/POTFILES.in (http://POTFILES.in) | 1 + > > src/Makefile.am (http://Makefile.am) | 1 + > > src/libvirt_private.syms | 4 + > > src/util/virerror.c | 1 + > > src/util/virhostcpu.c | 186 > > src/util/virhostcpu.h | 6 ++ > > src/util/virresctrl.c | 201 > > src/util/virresctrl.h | 78 + > > 9 files changed, 462 insertions(+), 17 deletions(-) > > create mode 100644 src/util/virresctrl.c > > create mode 100644 src/util/virresctrl.h > > > > diff --git a/include/libvirt/virterror.h b/include/libvirt/virterror.h > > index 2efee8f..3dd2d08 100644 > > --- a/include/libvirt/virterror.h > > +++ b/include/libvirt/virterror.h > > @@ -132,6 +132,7 @@ typedef enum { > > > > VIR_FROM_PERF = 65, /* Error from perf */ > > VIR_FROM_LIBSSH = 66, /* Error from libssh connection transport */ > > + VIR_FROM_RESCTRL = 67, /* Error from resource control */ > > > > # ifdef VIR_ENUM_SENTINELS > > VIR_ERR_DOMAIN_LAST > > diff --git a/po/POTFILES.in (http://POTFILES.in) b/po/POTFILES.in > > (http://POTFILES.in) > > index 7c7f530..4147bc6 100644 > > --- a/po/POTFILES.in (http://POTFILES.in) > > +++ b/po/POTFILES.in (http://POTFILES.in) > > @@ -241,6 +241,7 @@ src/util/virportallocator.c > > src/util/virprocess.c > > src/util/virqemu.c > > src/util/virrandom.c > > +src/util/virresctrl.c > > src/util/virrotatingfile.c > > src/util/virscsi.c > > src/util/virscsihost.c > > diff --git a/src/Makefile.am (http://Makefile.am) b/src/Makefile.am > > (http://Makefile.am) > > index 7d42eac..edb946a 100644 > > --- a/src/Makefile.am (http://Makefile.am) > > +++ b/src/Makefile.am (http://Makefile.am) > > @@ -162,6 +162,7 @@ UTIL_SOURCES = \ > > util/virprocess.c util/virprocess.h \ > > util/virqemu.c util/virqemu.h \ > > util/virrandom.h util/virrandom.c \ > > + util/virresctrl.h util/virresctrl.c \ > > util/virrotatingfile.h util/virrotatingfile.c \ > > util/virscsi.c util/virscsi.h \ > > util/virscsihost.c util/virscsihost.h \ > > diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms > > index aed1d3d..bb7c3ad 100644 > > --- a/src/libvirt_private.syms > > +++ b/src/libvirt_private.syms > > @@ -2320,6 +2320,10 @@ virRandomGenerateWWN; > > virRandomInt; > > > > > > +# util/virresctrl.h > > +virResCtrlAvailable; > >
Re: [libvirt] [PATCH resend V10 01/12] Resctrl: Add some utils functions
-- Best regards Eli 天涯无处不重逢 a leaf duckweed belongs to the sea, where not to meet in life Sent with Sparrow (http://www.sparrowmailapp.com/?sig) On Wednesday, 15 March 2017 at 8:20 PM, Martin Kletzander wrote: > On Mon, Mar 06, 2017 at 06:06:30PM +0800, Eli Qiao wrote: > > This patch adds some utils struct and functions to expose resctrl > > information. > > > > virResCtrlAvailable: if resctrl interface exist on host. > > virResCtrlGet: get specific type resource control information. > > virResCtrlInit: initialize resctrl struct from the host's sys fs. > > resctrlall[]: an array to maintain resource control information. > > > > Some of host cpu related information methods was added in virhostcpu.c > > > > Signed-off-by: Eli Qiao> (mailto:liyong.q...@intel.com)> > > --- > > include/libvirt/virterror.h | 1 + > > po/POTFILES.in (http://POTFILES.in) | 1 + > > src/Makefile.am (http://Makefile.am) | 1 + > > src/libvirt_private.syms | 4 + > > src/util/virerror.c | 1 + > > src/util/virhostcpu.c | 186 > > src/util/virhostcpu.h | 6 ++ > > src/util/virresctrl.c | 201 > > src/util/virresctrl.h | 78 + > > 9 files changed, 462 insertions(+), 17 deletions(-) > > create mode 100644 src/util/virresctrl.c > > create mode 100644 src/util/virresctrl.h > > > > diff --git a/src/util/virerror.c b/src/util/virerror.c > > index ef17fb5..0ba15e6 100644 > > --- a/src/util/virerror.c > > +++ b/src/util/virerror.c > > @@ -139,6 +139,7 @@ VIR_ENUM_IMPL(virErrorDomain, VIR_ERR_DOMAIN_LAST, > > > > "Perf", /* 65 */ > > "Libssh transport layer", > > + "Resouce Control", > > > > > s/resouce/resource/ > > > diff --git a/src/util/virresctrl.c b/src/util/virresctrl.c > > new file mode 100644 > > index 000..44a47cc > > --- /dev/null > > +++ b/src/util/virresctrl.c > > @@ -0,0 +1,201 @@ > > > > > [...] > > > + > > +static unsigned int host_id; > > + > > +static virResCtrl resctrlall[] = { > > + { > > + .name = "L3", > > + .cache_level = "l3", > > + }, > > + { > > + .name = "L3DATA", > > + .cache_level = "l3", > > + }, > > + { > > + .name = "L3CODE", > > + .cache_level = "l3", > > + }, > > + { > > + .name = "L2", > > + .cache_level = "l2", > > + }, > > +}; > > + > > > > > You are using global variables, still. But I *still* see no locking. > What if yet another driver (not just QEMU) will want to use resctrl? > Bunch of these accesses can happen at the same time and break > everything. How much of this information do we really need to keep (and > not reload)? > Yes, we need to maintain a global one as /sys/fs/resctrl is a global one. most of these information are in-mutble and don’t need to reload. > > For example host_id can screw up a lot of things. I might be discussing > in the latter patches as well. > > yep. I see them. -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH resend V10 01/12] Resctrl: Add some utils functions
On Mon, Mar 06, 2017 at 06:06:30PM +0800, Eli Qiao wrote: This patch adds some utils struct and functions to expose resctrl information. virResCtrlAvailable: if resctrl interface exist on host. virResCtrlGet: get specific type resource control information. virResCtrlInit: initialize resctrl struct from the host's sys fs. resctrlall[]: an array to maintain resource control information. Some of host cpu related information methods was added in virhostcpu.c Signed-off-by: Eli Qiao--- include/libvirt/virterror.h | 1 + po/POTFILES.in | 1 + src/Makefile.am | 1 + src/libvirt_private.syms| 4 + src/util/virerror.c | 1 + src/util/virhostcpu.c | 186 src/util/virhostcpu.h | 6 ++ src/util/virresctrl.c | 201 src/util/virresctrl.h | 78 + 9 files changed, 462 insertions(+), 17 deletions(-) create mode 100644 src/util/virresctrl.c create mode 100644 src/util/virresctrl.h diff --git a/src/util/virerror.c b/src/util/virerror.c index ef17fb5..0ba15e6 100644 --- a/src/util/virerror.c +++ b/src/util/virerror.c @@ -139,6 +139,7 @@ VIR_ENUM_IMPL(virErrorDomain, VIR_ERR_DOMAIN_LAST, "Perf", /* 65 */ "Libssh transport layer", + "Resouce Control", s/resouce/resource/ diff --git a/src/util/virresctrl.c b/src/util/virresctrl.c new file mode 100644 index 000..44a47cc --- /dev/null +++ b/src/util/virresctrl.c @@ -0,0 +1,201 @@ [...] + +static unsigned int host_id; + +static virResCtrl resctrlall[] = { +{ +.name = "L3", +.cache_level = "l3", +}, +{ +.name = "L3DATA", +.cache_level = "l3", +}, +{ +.name = "L3CODE", +.cache_level = "l3", +}, +{ +.name = "L2", +.cache_level = "l2", +}, +}; + You are using global variables, still. But I *still* see no locking. What if yet another driver (not just QEMU) will want to use resctrl? Bunch of these accesses can happen at the same time and break everything. How much of this information do we really need to keep (and not reload)? For example host_id can screw up a lot of things. I might be discussing in the latter patches as well. signature.asc Description: Digital signature -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH resend V10 01/12] Resctrl: Add some utils functions
On Mon, Mar 06, 2017 at 06:06:30PM +0800, Eli Qiao wrote: This patch adds some utils struct and functions to expose resctrl information. virResCtrlAvailable: if resctrl interface exist on host. virResCtrlGet: get specific type resource control information. virResCtrlInit: initialize resctrl struct from the host's sys fs. resctrlall[]: an array to maintain resource control information. Some of host cpu related information methods was added in virhostcpu.c So to be able to test all this we need to make a bit different approach. I'm not in favour of pushing this without proper tests. Some paths need to be configurable, some readings should be unified. Unfortunately lot of the code is just copy-paste mess from the past. Fortunately for you, I'm working on cleaning this up, at least a little bit, so that we can add the tests easily. I got almost up to the test (I stumbled upon few rabbit holes on the way and some clean-ups went wrong along the way), so it should be pretty easy for you to modify this code to use what I'll be proposing to add. It's not ready yet, but you can start rebasing your series on top of my branch pre-cat from my github repo [1]. The commits are not very well described right now (for some temporary ones I used whatthecommit.com, sorry), but I'll fix all that. I'll be updating the branch, but it will be done with force pushes, so be careful when rebasing on top of newer versions. I can do that if you don't want, just let me know so we can coordinate. Just a quick heads-up, there will be virsysfs that will be used for the reads, some additional helper functions in virhostcpu and virfile, test that scans copy of /sys/devices/system (with that path faked thanks to using the aforementioned virsysfs) and outputs capabilities so that we can check the capability XML and so on. Martin [1] https://github.com/nertpinx/libvirt Signed-off-by: Eli Qiao--- include/libvirt/virterror.h | 1 + po/POTFILES.in | 1 + src/Makefile.am | 1 + src/libvirt_private.syms| 4 + src/util/virerror.c | 1 + src/util/virhostcpu.c | 186 src/util/virhostcpu.h | 6 ++ src/util/virresctrl.c | 201 src/util/virresctrl.h | 78 + 9 files changed, 462 insertions(+), 17 deletions(-) create mode 100644 src/util/virresctrl.c create mode 100644 src/util/virresctrl.h diff --git a/include/libvirt/virterror.h b/include/libvirt/virterror.h index 2efee8f..3dd2d08 100644 --- a/include/libvirt/virterror.h +++ b/include/libvirt/virterror.h @@ -132,6 +132,7 @@ typedef enum { VIR_FROM_PERF = 65, /* Error from perf */ VIR_FROM_LIBSSH = 66, /* Error from libssh connection transport */ +VIR_FROM_RESCTRL = 67, /* Error from resource control */ # ifdef VIR_ENUM_SENTINELS VIR_ERR_DOMAIN_LAST diff --git a/po/POTFILES.in b/po/POTFILES.in index 7c7f530..4147bc6 100644 --- a/po/POTFILES.in +++ b/po/POTFILES.in @@ -241,6 +241,7 @@ src/util/virportallocator.c src/util/virprocess.c src/util/virqemu.c src/util/virrandom.c +src/util/virresctrl.c src/util/virrotatingfile.c src/util/virscsi.c src/util/virscsihost.c diff --git a/src/Makefile.am b/src/Makefile.am index 7d42eac..edb946a 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -162,6 +162,7 @@ UTIL_SOURCES = \ util/virprocess.c util/virprocess.h \ util/virqemu.c util/virqemu.h \ util/virrandom.h util/virrandom.c \ + util/virresctrl.h util/virresctrl.c \ util/virrotatingfile.h util/virrotatingfile.c \ util/virscsi.c util/virscsi.h \ util/virscsihost.c util/virscsihost.h \ diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms index aed1d3d..bb7c3ad 100644 --- a/src/libvirt_private.syms +++ b/src/libvirt_private.syms @@ -2320,6 +2320,10 @@ virRandomGenerateWWN; virRandomInt; +# util/virresctrl.h +virResCtrlAvailable; +virResCtrlInit; + # util/virrotatingfile.h virRotatingFileReaderConsume; virRotatingFileReaderFree; diff --git a/src/util/virerror.c b/src/util/virerror.c index ef17fb5..0ba15e6 100644 --- a/src/util/virerror.c +++ b/src/util/virerror.c @@ -139,6 +139,7 @@ VIR_ENUM_IMPL(virErrorDomain, VIR_ERR_DOMAIN_LAST, "Perf", /* 65 */ "Libssh transport layer", + "Resouce Control", ) diff --git a/src/util/virhostcpu.c b/src/util/virhostcpu.c index f29f312..e6d5102 100644 --- a/src/util/virhostcpu.c +++ b/src/util/virhostcpu.c @@ -206,29 +206,21 @@ void virHostCPUSetSysFSSystemPathLinux(const char *path) sysfs_system_path = SYSFS_SYSTEM_PATH; } -/* Return the positive decimal contents of the given - * DIR/cpu%u/FILE, or -1 on error. If