This is a patch to show the generic nic properties in VBoxManage showvminfo.

I hope this follows all coding conventions, and it's generally clean and
works.

--
Christophe
Index: src/VBox/Frontends/VBoxManage/VBoxManageInfo.cpp
===================================================================
--- src/VBox/Frontends/VBoxManage/VBoxManageInfo.cpp	(revision 37206)
+++ src/VBox/Frontends/VBoxManage/VBoxManageInfo.cpp	(working copy)
@@ -1001,8 +1001,22 @@
                             RTPrintf("generic%d=\"%lS\"\n", currentNIC + 1, strGenericDriver.raw());
                             strAttachment = "Generic";
                         }
-                        else
+                        else {
                             strAttachment = Utf8StrFmt("Generic '%lS'", strGenericDriver.raw());
+
+                            // show the generic properties
+                            com::SafeArray<BSTR> aProperties;
+                            com::SafeArray<BSTR> aValues;
+                            if (SUCCEEDED(nic->COMGETTER(Properties)(NULL, ComSafeArrayAsOutParam(aProperties), ComSafeArrayAsOutParam(aValues)))) {
+                              strAttachment += " { ";
+                              unsigned i;
+                              for (i = 0; i < aProperties.size(); ++i) {
+                                strAttachment += Utf8StrFmt("%lS='%lS'", aProperties[i], aValues[i]);
+                                if (i != aProperties.size() - 1) strAttachment += ", ";
+                              }
+                              strAttachment += " }";
+                            }
+                        }
                         break;
                     }
                     default:
_______________________________________________
vbox-dev mailing list
[email protected]
http://vbox.innotek.de/mailman/listinfo/vbox-dev

Reply via email to