VirtualBox

Ticket #11903: patch-src_VBox_Main_src-client_ConsoleImpl.cpp

File patch-src_VBox_Main_src-client_ConsoleImpl.cpp, 773 bytes (added by Derek Schrock, 4 years ago)

6.x version to add /VirtualBox/VirtualMachine/Name with VM's name viewed via guest VBoxControl

Line 
1--- src/VBox/Main/src-client/ConsoleImpl.cpp.orig 2021-03-27 01:43:21 UTC
2+++ src/VBox/Main/src-client/ConsoleImpl.cpp
3@@ -8801,6 +8801,18 @@ DECLCALLBACK(void) Console::i_vmstateChangeCallback(PU
4
5 switch (enmState)
6 {
7+ case VMSTATE_POWERING_ON:
8+ {
9+#ifdef VBOX_WITH_GUEST_PROPS
10+ Bstr bstr;
11+ that->mMachine->COMGETTER(Name)(bstr.asOutParam());
12+ that->mMachine->SetGuestProperty(Bstr("/VirtualBox/VirtualMachine/Name").raw(),
13+ bstr.raw(),
14+ Bstr("TRANSIENT, RDONLYGUEST").raw());
15+ that->mMachine->SaveSettings();
16+#endif
17+ break;
18+ }
19 /*
20 * The VM has terminated
21 */

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette