You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// NewNetworkBlockDeviceStorageDeviceAttachment creates a new network block device storage attachment from an NBD
419
+
// Uniform Resource Indicator (URI) represented as a URL, timeout value, and read-only and synchronization modes
420
+
// that you provide.
421
+
//
422
+
// - url is the NBD server URI. The format specified by https://github.com/NetworkBlockDevice/nbd/blob/master/doc/uri.md
423
+
// - timeout is the duration for the connection between the client and server. When the timeout expires, an attempt to reconnect with the server takes place.
424
+
// - forcedReadOnly if true forces the disk attachment to be read-only, regardless of whether or not the NBD server supports write requests.
425
+
// - syncMode is one of the available DiskSynchronizationMode options.
426
+
//
427
+
// This is only supported on macOS 14 and newer, error will
Copy file name to clipboardExpand all lines: virtualization_14.m
+33Lines changed: 33 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -50,4 +50,37 @@
50
50
}
51
51
#endif
52
52
RAISE_UNSUPPORTED_MACOS_EXCEPTION();
53
+
}
54
+
55
+
/*!
56
+
@abstract Initialize a network block device storage attachment from an NBD URI.
57
+
@param uri The NBD’s URI represented as a URL.
58
+
@param timeout The timeout value in seconds for the connection between the client and server. When the timeout expires, an attempt to reconnect with the server takes place.
59
+
@param forcedReadOnly If YES, the framework forces the disk attachment to be read-only, regardless of whether or not the NBD server supports write requests.
60
+
@param synchronizationMode Defines how the disk synchronizes with the underlying storage when the guest operating system flushes data.
61
+
@param error If not nil, assigned with the error if the initialization failed.
62
+
@return An initialized `VZDiskBlockDeviceStorageDeviceAttachment` or nil if there was an error.
63
+
@discussion
64
+
The forcedReadOnly parameter affects how framework exposes the NBD client to the guest operating
65
+
system by the storage controller. As part of the NBD protocol, the NBD server advertises whether
66
+
or not the disk exposed by the NBD client is read-only during the handshake phase of the protocol.
67
+
68
+
Setting forcedReadOnly to YES forces the NBD client to show up as read-only to the guest
69
+
regardless of whether or not the NBD server advertises itself as read-only.
0 commit comments