From: VMware, Inc <> Date: Wed, 24 Feb 2010 22:14:18 +0000 (-0800) Subject: Internal branch sync. Included in this change: X-Git-Tag: 2010.02.23-236320~33 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1e313291c1b285efca4cb8b9beef8f3c01c01754;p=thirdparty%2Fopen-vm-tools.git Internal branch sync. Included in this change: . Fix crash in vmware-user: always provide valid data in clipboard data. . Changes in shared code that don't affect open-vm-tools functionality. Signed-off-by: Marcelo Vanzin --- diff --git a/open-vm-tools/lib/file/filePosix.c b/open-vm-tools/lib/file/filePosix.c index 019565213..84e6b7278 100644 --- a/open-vm-tools/lib/file/filePosix.c +++ b/open-vm-tools/lib/file/filePosix.c @@ -2099,8 +2099,9 @@ FilePosixCreateTestFileSize(ConstUnicode dirName, // IN: directory to create lar * * Check if the given file is on a VMFS supports such a file size * - * In the case of VMFS3/4, the largest supported file size is + * In the case of VMFS3, the largest supported file size is * 256 * 1024 * B bytes + * VMFS5 supports larger file sizes. * * where B represents the blocksize in bytes * @@ -2140,11 +2141,12 @@ File_VMFSSupportsFileSize(ConstUnicode pathName, // IN: } if (strcmp(fsType, "VMFS") == 0) { - if (version >= 3) { - /* Get ready for VMFS4 and perform sanity check on version */ - ASSERT(version == 3 || version == 4); - + if (version == 3) { maxFileSize = (VMFS3CONST * (uint64) blockSize * 1024); + } else { + /* Get ready for 64 TB on VMFS5 and perform sanity check on version */ + ASSERT(version == 5); + maxFileSize = (uint64) 0x400000000000ULL; } if (fileSize <= maxFileSize && maxFileSize != -1) { diff --git a/open-vm-tools/lib/include/util.h b/open-vm-tools/lib/include/util.h index 34a6dcf2b..6832f757e 100644 --- a/open-vm-tools/lib/include/util.h +++ b/open-vm-tools/lib/include/util.h @@ -72,12 +72,12 @@ typedef pid_t Util_ThreadID; #ifdef __APPLE__ EXTERN char *Util_CFStringToUTF8CString(CFStringRef s); -EXTERN char *Util_IORegGetStringProperty(io_object_t entry, CFStringRef property); +EXTERN char *Util_IORegCopyStringProperty(io_object_t entry, CFStringRef property); EXTERN Bool Util_IORegGetNumberProperty(io_object_t entry, CFStringRef property, CFNumberType type, void *val); EXTERN Bool Util_IORegGetBooleanProperty(io_object_t entry, CFStringRef property, Bool *boolVal); -EXTERN CFDataRef Util_IORegGetDataProperty(io_object_t entry, CFStringRef property); +EXTERN CFDataRef Util_IORegCopyDataProperty(io_object_t entry, CFStringRef property); EXTERN CFMutableDictionaryRef UtilMacos_CreateCFDictionary( unsigned int numPairs, ...); EXTERN io_service_t Util_IORegGetDeviceObjectByName(const char *deviceName); diff --git a/open-vm-tools/lib/include/vm_device_version.h b/open-vm-tools/lib/include/vm_device_version.h index e1d4a0704..f364ca0ec 100644 --- a/open-vm-tools/lib/include/vm_device_version.h +++ b/open-vm-tools/lib/include/vm_device_version.h @@ -67,6 +67,7 @@ #define PCI_DEVICE_ID_VMWARE_VMXNET3 0x07B0 #define PCI_DEVICE_ID_VMWARE_VMXWIFI 0x07B8 #define PCI_DEVICE_ID_VMWARE_PVSCSI 0x07C0 +#define PCI_DEVICE_ID_VMWARE_82574 0x07D0 /* The hypervisor device might grow. Please leave room * for 7 more subfunctions. @@ -112,6 +113,7 @@ #define PCI_DEVICE_ID_INTEL_82443BX_2 0x7192 /* Used when no AGP support */ #define PCI_DEVICE_ID_INTEL_82545EM 0x100f #define PCI_DEVICE_ID_INTEL_82546EB 0x1010 +#define PCI_DEVICE_ID_INTEL_82574 0x10d3 #define PCI_DEVICE_ID_INTEL_ICH7_16 0x27d8 #define PCI_DEVICE_ID_INTEL_HECI 0x2a74 diff --git a/open-vm-tools/vmware-user/copyPasteUI.cpp b/open-vm-tools/vmware-user/copyPasteUI.cpp index 6a4e3c038..8ffb5909f 100644 --- a/open-vm-tools/vmware-user/copyPasteUI.cpp +++ b/open-vm-tools/vmware-user/copyPasteUI.cpp @@ -279,6 +279,8 @@ CopyPasteUI::LocalGetFileRequestCB(Gtk::SelectionData& sd, // IN: VmTimeType curTime; mBlockAdded = false; + sd.set(sd.get_target().c_str(), ""); + curTime = GetCurrentTime(); /* @@ -442,6 +444,8 @@ void CopyPasteUI::LocalGetTextOrRTFRequestCB(Gtk::SelectionData& sd, // IN/OUT guint info) // Ignored { + sd.set(sd.get_target().c_str(), ""); + if (!mCP.IsCopyPasteAllowed()) { return; } @@ -669,7 +673,7 @@ again: if (refClipboard->wait_is_text_available()) { Debug("%s: ask for text\n", __FUNCTION__); Glib::ustring str = refClipboard->wait_for_text(); - bufSize = str.size(); + bufSize = str.bytes(); if (bufSize > 0 && bufSize <= (int)CPCLIPITEM_MAX_SIZE_V3 && CPClipboard_SetItem(&mClipboard, CPFORMAT_TEXT, @@ -760,6 +764,8 @@ CopyPasteUI::LocalGetFileContentsRequestCB(Gtk::SelectionData& sd, // IN utf::string pre; utf::string post; + sd.set(sd.get_target().c_str(), ""); + /* Provide URIs for each path in the guest's file list. */ if (FCP_TARGET_INFO_GNOME_COPIED_FILES == info) { uriList = "copy\n"; @@ -1050,7 +1056,7 @@ CopyPasteUI::GetRemoteClipboardCB(const CPClipboard *clip) // IN targets.push_back(plainText); targets.push_back(utf8Text); targets.push_back(compountText); - mHGTextData = utf::string((const char *)buf); + mHGTextData = utf::string((const char *)buf, STRING_ENCODING_UTF8); mIsClipboardOwner = TRUE; } @@ -1062,7 +1068,7 @@ CopyPasteUI::GetRemoteClipboardCB(const CPClipboard *clip) // IN targets.push_back(appRtf); targets.push_back(textRtf); - mHGRTFData = utf::string((const char *)buf); + mHGRTFData = utf::string((const char *)buf, STRING_ENCODING_UTF8); mIsClipboardOwner = TRUE; } diff --git a/open-vm-tools/vmware-user/dndUI.cpp b/open-vm-tools/vmware-user/dndUI.cpp index 6079d43a5..7598c75b1 100644 --- a/open-vm-tools/vmware-user/dndUI.cpp +++ b/open-vm-tools/vmware-user/dndUI.cpp @@ -820,7 +820,9 @@ DnDUI::GtkSourceDragDataGetCB(const Glib::RefPtr &dc, const utf::string target = selection_data.get_target().c_str(); - Debug("%s: enter\n", __FUNCTION__); + selection_data.set(target.c_str(), ""); + + Debug("%s: enter with target %s\n", __FUNCTION__, target.c_str()); if (!m_inHGDrag) { Debug("%s: not in drag, return\n", __FUNCTION__);