virtual-machine 0.4.2 → 0.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -217,17 +217,17 @@ if (!("encodeInto" in cachedTextEncoder)) {
217
217
  };
218
218
  }
219
219
  var WASM_VECTOR_LEN = 0;
220
- function wasm_bindgen__convert__closures_____invoke__h8f8124f6febb822b(arg0, arg1) {
221
- wasm.wasm_bindgen__convert__closures_____invoke__h8f8124f6febb822b(arg0, arg1);
220
+ function wasm_bindgen__convert__closures_____invoke__hb64b0e492ba30db3(arg0, arg1, arg2) {
221
+ wasm.wasm_bindgen__convert__closures_____invoke__hb64b0e492ba30db3(arg0, arg1, arg2);
222
222
  }
223
- function wasm_bindgen__convert__closures_____invoke__h260170fb96639bcf(arg0, arg1, arg2) {
224
- wasm.wasm_bindgen__convert__closures_____invoke__h260170fb96639bcf(arg0, arg1, arg2);
223
+ function wasm_bindgen__convert__closures_____invoke__h18739833ac56d704(arg0, arg1) {
224
+ wasm.wasm_bindgen__convert__closures_____invoke__h18739833ac56d704(arg0, arg1);
225
225
  }
226
- function wasm_bindgen__convert__closures_____invoke__hdb5f2c9fdbbad746(arg0, arg1) {
227
- wasm.wasm_bindgen__convert__closures_____invoke__hdb5f2c9fdbbad746(arg0, arg1);
226
+ function wasm_bindgen__convert__closures_____invoke__hba8efd9a01e74992(arg0, arg1) {
227
+ wasm.wasm_bindgen__convert__closures_____invoke__hba8efd9a01e74992(arg0, arg1);
228
228
  }
229
- function wasm_bindgen__convert__closures_____invoke__hc92ef0219c4477f2(arg0, arg1, arg2) {
230
- wasm.wasm_bindgen__convert__closures_____invoke__hc92ef0219c4477f2(arg0, arg1, arg2);
229
+ function wasm_bindgen__convert__closures_____invoke__h260170fb96639bcf(arg0, arg1, arg2) {
230
+ wasm.wasm_bindgen__convert__closures_____invoke__h260170fb96639bcf(arg0, arg1, arg2);
231
231
  }
232
232
  var __wbindgen_enum_WorkerType = ["classic", "module"];
233
233
  var WasmVmFinalization = typeof FinalizationRegistry === "undefined" ? { register: () => {
@@ -850,6 +850,31 @@ var WasmVm = class _WasmVm {
850
850
  const ret = wasm.wasmvm_entry_pc(this.__wbg_ptr);
851
851
  return BigInt.asUintN(64, ret);
852
852
  }
853
+ /**
854
+ * Enable VirtIO 9P device for host directory mounting.
855
+ *
856
+ * This exposes a host directory to the guest kernel at the specified
857
+ * mount point. The JavaScript side must provide a `window.p9Host` object
858
+ * with the following methods:
859
+ * - `read(path)` - Returns Uint8Array of file contents
860
+ * - `write(path, data)` - Writes data to file, returns boolean
861
+ * - `readdir(path)` - Returns array of `{name, isDir}` objects
862
+ * - `exists(path)` - Returns boolean
863
+ * - `isDir(path)` - Returns boolean
864
+ *
865
+ * # Arguments
866
+ * * `host_path` - Path prefix for the host directory
867
+ * * `mount_tag` - Mount tag for guest to identify the mount
868
+ * @param {string} host_path
869
+ * @param {string} mount_tag
870
+ */
871
+ enable_9p(host_path, mount_tag) {
872
+ const ptr0 = passStringToWasm0(host_path, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
873
+ const len0 = WASM_VECTOR_LEN;
874
+ const ptr1 = passStringToWasm0(mount_tag, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
875
+ const len1 = WASM_VECTOR_LEN;
876
+ wasm.wasmvm_enable_9p(this.__wbg_ptr, ptr0, len0, ptr1, len1);
877
+ }
853
878
  /**
854
879
  * Get the halt code if the VM has halted.
855
880
  * Code 0x5555 typically means successful shutdown (PASS).
@@ -1052,6 +1077,10 @@ function __wbg_get_imports() {
1052
1077
  const ret = typeof arg0 === "function";
1053
1078
  return ret;
1054
1079
  };
1080
+ imports.wbg.__wbg___wbindgen_is_null_dfda7d66506c95b5 = function(arg0) {
1081
+ const ret = arg0 === null;
1082
+ return ret;
1083
+ };
1055
1084
  imports.wbg.__wbg___wbindgen_is_undefined_f6b95eab589e0269 = function(arg0) {
1056
1085
  const ret = arg0 === void 0;
1057
1086
  return ret;
@@ -1158,6 +1187,10 @@ function __wbg_get_imports() {
1158
1187
  return ret;
1159
1188
  }, arguments);
1160
1189
  };
1190
+ imports.wbg.__wbg_get_6b7bd52aca3f9671 = function(arg0, arg1) {
1191
+ const ret = arg0[arg1 >>> 0];
1192
+ return ret;
1193
+ };
1161
1194
  imports.wbg.__wbg_get_af9dab7e9603ea93 = function() {
1162
1195
  return handleError(function(arg0, arg1) {
1163
1196
  const ret = Reflect.get(arg0, arg1);
@@ -1172,6 +1205,26 @@ function __wbg_get_imports() {
1172
1205
  const ret = arg0.hardwareConcurrency;
1173
1206
  return ret;
1174
1207
  };
1208
+ imports.wbg.__wbg_instanceof_Object_577e21051f7bcb79 = function(arg0) {
1209
+ let result;
1210
+ try {
1211
+ result = arg0 instanceof Object;
1212
+ } catch (_) {
1213
+ result = false;
1214
+ }
1215
+ const ret = result;
1216
+ return ret;
1217
+ };
1218
+ imports.wbg.__wbg_instanceof_Uint8Array_da54ccc9d3e09434 = function(arg0) {
1219
+ let result;
1220
+ try {
1221
+ result = arg0 instanceof Uint8Array;
1222
+ } catch (_) {
1223
+ result = false;
1224
+ }
1225
+ const ret = result;
1226
+ return ret;
1227
+ };
1175
1228
  imports.wbg.__wbg_instanceof_Window_b5cf7783caa68180 = function(arg0) {
1176
1229
  let result;
1177
1230
  try {
@@ -1182,6 +1235,10 @@ function __wbg_get_imports() {
1182
1235
  const ret = result;
1183
1236
  return ret;
1184
1237
  };
1238
+ imports.wbg.__wbg_isArray_51fd9e6422c0a395 = function(arg0) {
1239
+ const ret = Array.isArray(arg0);
1240
+ return ret;
1241
+ };
1185
1242
  imports.wbg.__wbg_length_22ac23eaec9d8053 = function(arg0) {
1186
1243
  const ret = arg0.length;
1187
1244
  return ret;
@@ -1190,6 +1247,10 @@ function __wbg_get_imports() {
1190
1247
  const ret = arg0.length;
1191
1248
  return ret;
1192
1249
  };
1250
+ imports.wbg.__wbg_length_d45040a40c570362 = function(arg0) {
1251
+ const ret = arg0.length;
1252
+ return ret;
1253
+ };
1193
1254
  imports.wbg.__wbg_load_f1dd26e734971d92 = function() {
1194
1255
  return handleError(function(arg0, arg1) {
1195
1256
  const ret = Atomics.load(arg0, arg1 >>> 0);
@@ -1431,30 +1492,30 @@ function __wbg_get_imports() {
1431
1492
  return ret;
1432
1493
  }, arguments);
1433
1494
  };
1434
- imports.wbg.__wbindgen_cast_041c77978d70bb0a = function(arg0, arg1) {
1435
- const ret = makeMutClosure(arg0, arg1, wasm.wasm_bindgen__closure__destroy__h747faf247e91d978, wasm_bindgen__convert__closures_____invoke__h8f8124f6febb822b);
1495
+ imports.wbg.__wbindgen_cast_1538354e022c36a6 = function(arg0, arg1) {
1496
+ const ret = makeMutClosure(arg0, arg1, wasm.wasm_bindgen__closure__destroy__h612f8e24953b61d5, wasm_bindgen__convert__closures_____invoke__h260170fb96639bcf);
1436
1497
  return ret;
1437
1498
  };
1438
1499
  imports.wbg.__wbindgen_cast_2241b6af4c4b2941 = function(arg0, arg1) {
1439
1500
  const ret = getStringFromWasm0(arg0, arg1);
1440
1501
  return ret;
1441
1502
  };
1442
- imports.wbg.__wbindgen_cast_3746c3321ab9df2b = function(arg0, arg1) {
1443
- const ret = makeMutClosure(arg0, arg1, wasm.wasm_bindgen__closure__destroy__h612f8e24953b61d5, wasm_bindgen__convert__closures_____invoke__h260170fb96639bcf);
1444
- return ret;
1445
- };
1446
- imports.wbg.__wbindgen_cast_46fd076aabb4c434 = function(arg0, arg1) {
1447
- const ret = makeClosure(arg0, arg1, wasm.wasm_bindgen__closure__destroy__h747faf247e91d978, wasm_bindgen__convert__closures_____invoke__hdb5f2c9fdbbad746);
1503
+ imports.wbg.__wbindgen_cast_2371841941b04e25 = function(arg0, arg1) {
1504
+ const ret = makeMutClosure(arg0, arg1, wasm.wasm_bindgen__closure__destroy__h75e3a518a3f3beb0, wasm_bindgen__convert__closures_____invoke__h18739833ac56d704);
1448
1505
  return ret;
1449
1506
  };
1450
- imports.wbg.__wbindgen_cast_d3f7166d7f91ad34 = function(arg0, arg1) {
1451
- const ret = makeMutClosure(arg0, arg1, wasm.wasm_bindgen__closure__destroy__h747faf247e91d978, wasm_bindgen__convert__closures_____invoke__hc92ef0219c4477f2);
1507
+ imports.wbg.__wbindgen_cast_31bf697c4579a85c = function(arg0, arg1) {
1508
+ const ret = makeMutClosure(arg0, arg1, wasm.wasm_bindgen__closure__destroy__h75e3a518a3f3beb0, wasm_bindgen__convert__closures_____invoke__hb64b0e492ba30db3);
1452
1509
  return ret;
1453
1510
  };
1454
1511
  imports.wbg.__wbindgen_cast_d6cd19b81560fd6e = function(arg0) {
1455
1512
  const ret = arg0;
1456
1513
  return ret;
1457
1514
  };
1515
+ imports.wbg.__wbindgen_cast_f68bb92101f7c0ce = function(arg0, arg1) {
1516
+ const ret = makeClosure(arg0, arg1, wasm.wasm_bindgen__closure__destroy__h75e3a518a3f3beb0, wasm_bindgen__convert__closures_____invoke__hba8efd9a01e74992);
1517
+ return ret;
1518
+ };
1458
1519
  imports.wbg.__wbindgen_init_externref_table = function() {
1459
1520
  const table = wasm.__wbindgen_externrefs;
1460
1521
  const offset = table.grow(4);