Re: [libvirt] Node.GetInfo error

?Ok, at first GetLastError return an Error object. So you should anything like : Errors.Error err = Errors.GetLastError(); MessageBox.Show(err.Message); For the NodeInfo structure, I think the problem is the same that was for DomainInfo, I'll check marshaling. Then respond you with the correct infos. Arnaud PS : can you also put libvirt-list@redhat.com in copy of your mails, to keep everyone in the loop ? From: 黄亮 Sent: Sunday, October 31, 2010 8:20 AM To: arnaud.champion Subject: Node.GetInfo error Hi, Sorry for disturbing again. But I get error while using Node.GetInfo. Code: NodeInfo aNodeInfo = new NodeInfo(); if (Node.GetInfo(con, aNodeInfo) < 0) { //MessageBox.Show("Node Info Error"); MessageBox.Show(Errors.GetLastError().ToString()); return 0f; } I'm sure con != IntPtr.Zero. I tried to use Errors.GetLastError(), it returns int. But I don't know what to do with it. So, any suggestions ? Thanks Regards 2010-10-31 -------------------------------------------------------------------------------- Lancer

OK, I'll try to get the error msg. And remember including the mail-list :-) Lancer 2010-10-31 黄亮 发件人: arnaud.champion@devatom.fr 发送时间: 2010-10-31 16:48:15 收件人: 黄亮 抄送: libvir-list@redhat.com 主题: Re: Node.GetInfo error Ok, at first GetLastError return an Error object. So you should anything like : Errors.Error err = Errors.GetLastError(); MessageBox.Show(err.Message); For the NodeInfo structure, I think the problem is the same that was for DomainInfo, I'll check marshaling. Then respond you with the correct infos. Arnaud PS : can you also put libvirt-list@redhat.com in copy of your mails, to keep everyone in the loop ? From: 黄亮 Sent: Sunday, October 31, 2010 8:20 AM To: arnaud.champion Subject: Node.GetInfo error Hi, Sorry for disturbing again. But I get error while using Node.GetInfo. Code: NodeInfo aNodeInfo = new NodeInfo(); if (Node.GetInfo(con, aNodeInfo) < 0) { //MessageBox.Show("Node Info Error"); MessageBox.Show(Errors.GetLastError().ToString()); return 0f; } I'm sure con != IntPtr.Zero. I tried to use Errors.GetLastError(), it returns int. But I don't know what to do with it. So, any suggestions ? Thanks Regards 2010-10-31 Lancer __________ Information from ESET Smart Security, version of virus signature database 5577 (20101030) __________ The message was checked by ESET Smart Security. http://www.eset.com

?Okay, the NodeInfo structure must be marshled in this way to make it works : /// <summary> /// Structure to handle node informations /// </summary> [StructLayout(LayoutKind.Sequential)] public class NodeInfo { /// <summary> /// String indicating the CPU model. /// </summary> [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 32)] public string model; /// <summary> /// Memory size in kilobytes /// </summary> [MarshalAs(UnmanagedType.SysUInt)] public UIntPtr memory; /// <summary> /// The number of active CPUs. /// </summary> [MarshalAs(UnmanagedType.SysUInt)] public UIntPtr cpus; /// <summary> /// Expected CPU frequency. /// </summary> [MarshalAs(UnmanagedType.SysUInt)] public UIntPtr mhz; /// <summary> /// The number of NUMA cell, 1 for uniform mem access. /// </summary> [MarshalAs(UnmanagedType.SysUInt)] public UIntPtr nodes; /// <summary> /// Number of CPU socket per node. /// </summary> [MarshalAs(UnmanagedType.SysUInt)] public UIntPtr sockets; /// <summary> /// Number of core per socket. /// </summary> [MarshalAs(UnmanagedType.SysUInt)] public UIntPtr cores; /// <summary> /// Number of threads per core. /// </summary> [MarshalAs(UnmanagedType.SysUInt)] public UIntPtr threads; } I will put it in next patches. Cheers, Arnaud From: arnaud.champion@devatom.fr Sent: Sunday, October 31, 2010 9:47 AM To: 黄亮 Cc: libvir-list@redhat.com Subject: Re: [libvirt] Node.GetInfo error Ok, at first GetLastError return an Error object. So you should anything like : Errors.Error err = Errors.GetLastError(); MessageBox.Show(err.Message); For the NodeInfo structure, I think the problem is the same that was for DomainInfo, I'll check marshaling. Then respond you with the correct infos. Arnaud PS : can you also put libvirt-list@redhat.com in copy of your mails, to keep everyone in the loop ? From: 黄亮 Sent: Sunday, October 31, 2010 8:20 AM To: arnaud.champion Subject: Node.GetInfo error Hi, Sorry for disturbing again. But I get error while using Node.GetInfo. Code: NodeInfo aNodeInfo = new NodeInfo(); if (Node.GetInfo(con, aNodeInfo) < 0) { //MessageBox.Show("Node Info Error"); MessageBox.Show(Errors.GetLastError().ToString()); return 0f; } I'm sure con != IntPtr.Zero. I tried to use Errors.GetLastError(), it returns int. But I don't know what to do with it. So, any suggestions ? Thanks Regards 2010-10-31 -------------------------------------------------------------------------------- Lancer -------------------------------------------------------------------------------- -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list

HI, I tried Errors.Error err = Errors.GetLastError(); MessageBox.Show(err.Message); But IDE shows compilation errors that there is no "Error" defination in "Errors", and "Errors.GetLastError()" returns int. I made a guess that maybe it was like this: Error err = Errors.SaveLastError(); MessageBox.Show("Get Info error: " + err.Message); It can be compiled but "err.Message" has nothing in it. Did I make a wrong assumption? Regards 2010-11-01 Lancer 发件人: arnaud.champion@devatom.fr 发送时间: 2010-10-31 16:48:15 收件人: 黄亮 抄送: libvir-list@redhat.com 主题: Re: Node.GetInfo error Ok, at first GetLastError return an Error object. So you should anything like : Errors.Error err = Errors.GetLastError(); MessageBox.Show(err.Message); For the NodeInfo structure, I think the problem is the same that was for DomainInfo, I'll check marshaling. Then respond you with the correct infos. Arnaud PS : can you also put libvirt-list@redhat.com in copy of your mails, to keep everyone in the loop ? From: 黄亮 Sent: Sunday, October 31, 2010 8:20 AM To: arnaud.champion Subject: Node.GetInfo error Hi, Sorry for disturbing again. But I get error while using Node.GetInfo. Code: NodeInfo aNodeInfo = new NodeInfo(); if (Node.GetInfo(con, aNodeInfo) < 0) { //MessageBox.Show("Node Info Error"); MessageBox.Show(Errors.GetLastError().ToString()); return 0f; } I'm sure con != IntPtr.Zero. I tried to use Errors.GetLastError(), it returns int. But I don't know what to do with it. So, any suggestions ? Thanks Regards 2010-10-31 Lancer __________ Information from ESET Smart Security, version of virus signature database 5577 (20101030) __________ The message was checked by ESET Smart Security. http://www.eset.com

?Hi, I think the solution is in the last patches I have send (which are not yet in the git). Have you tried the NodeInfoStructure I have sended yesterday ? Arnaud From: 黄亮 Sent: Monday, November 01, 2010 3:01 AM To: arnaud.champion@devatom.fr Cc: libvir-list Subject: SPAM-LOW: Re: Re: Node.GetInfo error HI, I tried Errors.Error err = Errors.GetLastError(); MessageBox.Show(err.Message); But IDE shows compilation errors that there is no "Error" defination in "Errors", and "Errors.GetLastError()" returns int. I made a guess that maybe it was like this: Error err = Errors.SaveLastError(); MessageBox.Show("Get Info error: " + err.Message); It can be compiled but "err.Message" has nothing in it. Did I make a wrong assumption? Regards 2010-11-01 -------------------------------------------------------------------------------- Lancer -------------------------------------------------------------------------------- 发件人: arnaud.champion@devatom.fr 发送时间: 2010-10-31 16:48:15 收件人: 黄亮 抄送: libvir-list@redhat.com 主题: Re: Node.GetInfo error Ok, at first GetLastError return an Error object. So you should anything like : Errors.Error err = Errors.GetLastError(); MessageBox.Show(err.Message); For the NodeInfo structure, I think the problem is the same that was for DomainInfo, I'll check marshaling. Then respond you with the correct infos. Arnaud PS : can you also put libvirt-list@redhat.com in copy of your mails, to keep everyone in the loop ? From: 黄亮 Sent: Sunday, October 31, 2010 8:20 AM To: arnaud.champion Subject: Node.GetInfo error Hi, Sorry for disturbing again. But I get error while using Node.GetInfo. Code: NodeInfo aNodeInfo = new NodeInfo(); if (Node.GetInfo(con, aNodeInfo) < 0) { //MessageBox.Show("Node Info Error"); MessageBox.Show(Errors.GetLastError().ToString()); return 0f; } I'm sure con != IntPtr.Zero. I tried to use Errors.GetLastError(), it returns int. But I don't know what to do with it. So, any suggestions ? Thanks Regards 2010-10-31 -------------------------------------------------------------------------------- Lancer __________ Information from ESET Smart Security, version of virus signature database 5577 (20101030) __________ The message was checked by ESET Smart Security. http://www.eset.com
participants (2)
-
arnaud.champion@devatom.fr
-
黄亮