Commit 3370d16097afd0e5b751b886a013a6af6ba4825e
- Diff rendering mode:
- inline
- side by side
|   | |||
| 7 | 7 | import org.libvirt.jna.DomainPointer; | |
| 8 | 8 | import org.libvirt.jna.InterfacePointer; | |
| 9 | 9 | import org.libvirt.jna.Libvirt; | |
| 10 | import org.libvirt.jna.NetworkFilterPointer; | ||
| 10 | 11 | import org.libvirt.jna.NetworkPointer; | |
| 11 | 12 | import org.libvirt.jna.SecretPointer; | |
| 12 | 13 | import org.libvirt.jna.StoragePoolPointer; | |
| … | … | ||
| 376 | 376 | } | |
| 377 | 377 | ||
| 378 | 378 | /** | |
| 379 | * Removes an event callback. | ||
| 380 | * | ||
| 381 | * @see <a | ||
| 382 | * href="http://www.libvirt.org/html/libvirt-libvirt.html#virConnectDomainEventDeregisterAny">Libvirt | ||
| 383 | * Documentation</a> | ||
| 384 | * @param callbackID | ||
| 385 | * the callback to deregister | ||
| 386 | * @return | ||
| 387 | * @throws LibvirtException | ||
| 388 | */ | ||
| 389 | public int domainEventDeregisterAny(int callbackID) throws LibvirtException { | ||
| 390 | int returnValue = libvirt.virConnectDomainEventDeregisterAny(VCP, callbackID); | ||
| 391 | processError(); | ||
| 392 | return returnValue; | ||
| 393 | } | ||
| 394 | |||
| 395 | /** | ||
| 396 | * Adds a callback to receive notifications of arbitrary domain events | ||
| 397 | * occurring on a domain. | ||
| 398 | * | ||
| 399 | * @see <a | ||
| 400 | * href="http://www.libvirt.org/html/libvirt-libvirt.html#virConnectDomainEventRegisterAny">Libvirt | ||
| 401 | * Documentation</a> | ||
| 402 | * @param domain | ||
| 403 | * option domain to limit the events monitored | ||
| 404 | * @param eventId | ||
| 405 | * the events to monitor | ||
| 406 | * @param cb | ||
| 407 | * the callback function to use. | ||
| 408 | * @return . The return value from this method is a positive integer | ||
| 409 | * identifier for the callback. -1 if an error | ||
| 410 | * @throws LibvirtException | ||
| 411 | */ | ||
| 412 | public int domainEventRegisterAny(Domain domain, int eventId, Libvirt.VirConnectDomainEventGenericCallback cb) | ||
| 413 | throws LibvirtException { | ||
| 414 | DomainPointer ptr = domain == null ? null : domain.VDP; | ||
| 415 | int returnValue = libvirt.virConnectDomainEventRegisterAny(VCP, ptr, eventId, cb, null, null); | ||
| 416 | processError(); | ||
| 417 | return returnValue; | ||
| 418 | } | ||
| 419 | |||
| 420 | /** | ||
| 379 | 421 | * Finds a domain based on the hypervisor ID number. | |
| 380 | 422 | * | |
| 381 | 423 | * @param id | |
| … | … | ||
| 899 | 899 | } | |
| 900 | 900 | ||
| 901 | 901 | /** | |
| 902 | * Lists the names of the network filters | ||
| 903 | * | ||
| 904 | * @return an Array of Strings that contains the names network filters | ||
| 905 | * @throws LibvirtException | ||
| 906 | */ | ||
| 907 | public String[] listNetworkFilters() throws LibvirtException { | ||
| 908 | int maxnames = numOfNetworkFilters(); | ||
| 909 | String[] names = new String[maxnames]; | ||
| 910 | if (maxnames > 0) { | ||
| 911 | libvirt.virConnectListNWFilters(VCP, names, maxnames); | ||
| 912 | processError(); | ||
| 913 | } | ||
| 914 | return names; | ||
| 915 | } | ||
| 916 | |||
| 917 | /** | ||
| 902 | 918 | * Lists the active networks. | |
| 903 | 919 | * | |
| 904 | 920 | * @return an Array of Strings that contains the names of the active | |
| … | … | ||
| 1005 | 1005 | } | |
| 1006 | 1006 | ||
| 1007 | 1007 | /** | |
| 1008 | * Defines a networkFilter | ||
| 1009 | * | ||
| 1010 | * @param xmlDesc | ||
| 1011 | * the descirption of the filter | ||
| 1012 | * @return the new filer | ||
| 1013 | * @throws LibvirtException | ||
| 1014 | * @see <a | ||
| 1015 | * href="http://www.libvirt.org/html/libvirt-libvirt.html#virNWFilterDefineXML" | ||
| 1016 | * > Libvirt Documentation </a> | ||
| 1017 | */ | ||
| 1018 | public NetworkFilter networkFilterDefineXML(String xmlDesc) throws LibvirtException { | ||
| 1019 | NetworkFilter returnValue = null; | ||
| 1020 | NetworkFilterPointer ptr = libvirt.virNWFilterDefineXML(VCP, xmlDesc); | ||
| 1021 | processError(); | ||
| 1022 | if (ptr != null) { | ||
| 1023 | returnValue = new NetworkFilter(this, ptr); | ||
| 1024 | } | ||
| 1025 | return returnValue; | ||
| 1026 | } | ||
| 1027 | |||
| 1028 | /** | ||
| 1029 | * Fetch a network filter based on its unique name | ||
| 1030 | * | ||
| 1031 | * @param name | ||
| 1032 | * name of network filter to fetch | ||
| 1033 | * @return network filter object | ||
| 1034 | * @throws LibvirtException | ||
| 1035 | * @see <a | ||
| 1036 | * href="http://www.libvirt.org/html/libvirt-libvirt.html#virNWFilterLookupByName" | ||
| 1037 | * > Libvirt Documentation </a> | ||
| 1038 | */ | ||
| 1039 | public NetworkFilter networkFilterLookupByName(String name) throws LibvirtException { | ||
| 1040 | NetworkFilter returnValue = null; | ||
| 1041 | NetworkFilterPointer ptr = libvirt.virNWFilterLookupByName(VCP, name); | ||
| 1042 | processError(); | ||
| 1043 | if (ptr != null) { | ||
| 1044 | returnValue = new NetworkFilter(this, ptr); | ||
| 1045 | } | ||
| 1046 | return returnValue; | ||
| 1047 | } | ||
| 1048 | |||
| 1049 | /** | ||
| 1050 | * Looks up a network filter based on its UUID in array form. The UUID Array | ||
| 1051 | * contains an unpacked representation of the UUID, each int contains only | ||
| 1052 | * one byte. | ||
| 1053 | * | ||
| 1054 | * @param UUID | ||
| 1055 | * the UUID as an unpacked int array | ||
| 1056 | * @return the network filter object | ||
| 1057 | * @throws LibvirtException | ||
| 1058 | */ | ||
| 1059 | public NetworkFilter networkFilterLookupByUUID(int[] UUID) throws LibvirtException { | ||
| 1060 | byte[] uuidBytes = Connect.createUUIDBytes(UUID); | ||
| 1061 | NetworkFilter returnValue = null; | ||
| 1062 | NetworkFilterPointer ptr = libvirt.virNWFilterLookupByUUID(VCP, uuidBytes); | ||
| 1063 | processError(); | ||
| 1064 | if (ptr != null) { | ||
| 1065 | returnValue = new NetworkFilter(this, ptr); | ||
| 1066 | } | ||
| 1067 | return returnValue; | ||
| 1068 | } | ||
| 1069 | |||
| 1070 | /** | ||
| 1071 | * Fetch a network filter based on its globally unique id | ||
| 1072 | * | ||
| 1073 | * @param UUID | ||
| 1074 | * a java UUID | ||
| 1075 | * @return a new network filter object | ||
| 1076 | * @throws LibvirtException | ||
| 1077 | */ | ||
| 1078 | public NetworkFilter networkFilterLookupByUUID(UUID uuid) throws LibvirtException { | ||
| 1079 | return networkFilterLookupByUUIDString(uuid.toString()); | ||
| 1080 | } | ||
| 1081 | |||
| 1082 | /** | ||
| 1083 | * Looks up a network filter based on its UUID in String form. | ||
| 1084 | * | ||
| 1085 | * @param UUID | ||
| 1086 | * the UUID in canonical String representation | ||
| 1087 | * @return the Network Filter object | ||
| 1088 | * @throws LibvirtException | ||
| 1089 | */ | ||
| 1090 | public NetworkFilter networkFilterLookupByUUIDString(String UUID) throws LibvirtException { | ||
| 1091 | NetworkFilter returnValue = null; | ||
| 1092 | NetworkFilterPointer ptr = libvirt.virNWFilterLookupByUUIDString(VCP, UUID); | ||
| 1093 | processError(); | ||
| 1094 | if (ptr != null) { | ||
| 1095 | returnValue = new NetworkFilter(this, ptr); | ||
| 1096 | } | ||
| 1097 | return returnValue; | ||
| 1098 | } | ||
| 1099 | |||
| 1100 | /** | ||
| 1008 | 1101 | * Looks up a network on the based on its name. | |
| 1009 | 1102 | * | |
| 1010 | 1103 | * @param name | |
| … | … | ||
| 1267 | 1267 | } | |
| 1268 | 1268 | ||
| 1269 | 1269 | /** | |
| 1270 | * Provides the number of network filters | ||
| 1271 | * | ||
| 1272 | * @return the number of network filters | ||
| 1273 | * @throws LibvirtException | ||
| 1274 | */ | ||
| 1275 | public int numOfNetworkFilters() throws LibvirtException { | ||
| 1276 | int returnValue = libvirt.virConnectNumOfNWFilters(VCP); | ||
| 1277 | processError(); | ||
| 1278 | return returnValue; | ||
| 1279 | } | ||
| 1280 | |||
| 1281 | /** | ||
| 1270 | 1282 | * Provides the number of active networks. | |
| 1271 | 1283 | * | |
| 1272 | 1284 | * @return the number of active networks | |
| … | … | ||
| 1560 | 1560 | * use Stream.VIR_STREAM_NONBLOCK if non-blocking is required | |
| 1561 | 1561 | * @return the new object | |
| 1562 | 1562 | */ | |
| 1563 | public Stream virStreamNew(int flags) throws LibvirtException { | ||
| 1563 | public Stream streamNew(int flags) throws LibvirtException { | ||
| 1564 | 1564 | StreamPointer sPtr = libvirt.virStreamNew(VCP, flags); | |
| 1565 | 1565 | processError(); | |
| 1566 | 1566 | return new Stream(this, sPtr); |
|   | |||
| 516 | 516 | /** | |
| 517 | 517 | * Determine if the domain has a snapshot | |
| 518 | 518 | * | |
| 519 | * @see <a href="http://www.libvirt.org/html/libvirt-libvirt.html#virDomainHasCurrentSnapshot>Libvirt | ||
| 520 | * Documentation</a> | ||
| 519 | * @see <a href="http://www.libvirt.org/html/libvirt-libvirt.html#virDomainHasCurrentSnapshot>Libvir | ||
| 520 | * t Documentation</a> | ||
| 521 | 521 | * @return 1 if running, 0 if inactive, -1 on error | |
| 522 | 522 | * @throws LibvirtException | |
| 523 | 523 | */ | |
| … | … | ||
| 528 | 528 | } | |
| 529 | 529 | ||
| 530 | 530 | /** | |
| 531 | * Determine if the domain has a managed save image | ||
| 532 | * | ||
| 533 | * @see <a href="http://www.libvirt.org/html/libvirt-libvirt.html#virDomainHasManagedSaveImage>Libvir | ||
| 534 | * t Documentation</a> | ||
| 535 | * @return 0 if no image is present, 1 if an image is present, and -1 in | ||
| 536 | * case of error | ||
| 537 | * @throws LibvirtException | ||
| 538 | */ | ||
| 539 | public int hasManagedSaveImage() throws LibvirtException { | ||
| 540 | int returnValue = libvirt.virDomainHasManagedSaveImage(VDP, 0); | ||
| 541 | processError(); | ||
| 542 | return returnValue; | ||
| 543 | } | ||
| 544 | |||
| 545 | /** | ||
| 531 | 546 | * Returns network interface stats for interfaces attached to this domain. | |
| 532 | 547 | * The path parameter is the name of the network interface. Domains may have | |
| 533 | 548 | * more than network interface. To get stats for each you should make | |
| … | … | ||
| 594 | 594 | } | |
| 595 | 595 | ||
| 596 | 596 | /** | |
| 597 | * suspend a domain and save its memory contents to a file on disk. | ||
| 598 | * | ||
| 599 | * @see <a | ||
| 600 | * href="http://www.libvirt.org/html/libvirt-libvirt.html#virDomainManagedSave">Libvirt | ||
| 601 | * Documentation</a> | ||
| 602 | * @return 0 in case of success or -1 in case of failure | ||
| 603 | * @throws LibvirtException | ||
| 604 | */ | ||
| 605 | public int managedSave() throws LibvirtException { | ||
| 606 | int returnValue = libvirt.virDomainManagedSave(VDP, 0); | ||
| 607 | processError(); | ||
| 608 | return returnValue; | ||
| 609 | } | ||
| 610 | |||
| 611 | /** | ||
| 612 | * Remove any managed save images from the domain | ||
| 613 | * | ||
| 614 | * @see <a | ||
| 615 | * href="http://www.libvirt.org/html/libvirt-libvirt.html#virDomainManagedSaveRemove">Libvirt | ||
| 616 | * Documentation</a> | ||
| 617 | * @return | ||
| 618 | * @throws LibvirtException | ||
| 619 | */ | ||
| 620 | public int managedSaveRemote() throws LibvirtException { | ||
| 621 | int returnValue = libvirt.virDomainManagedSaveRemove(VDP, 0); | ||
| 622 | processError(); | ||
| 623 | return returnValue; | ||
| 624 | } | ||
| 625 | |||
| 626 | /** | ||
| 597 | 627 | * This function provides memory statistics for the domain. | |
| 598 | 628 | * | |
| 599 | 629 | * @param number | |
| … | … | ||
| 696 | 696 | } | |
| 697 | 697 | ||
| 698 | 698 | /** | |
| 699 | * Sets maximum tolerable time for which the domain is allowed to be paused | ||
| 700 | * at the end of live migration. | ||
| 701 | * | ||
| 702 | * @see <a | ||
| 703 | * href="http://www.libvirt.org/html/libvirt-libvirt.html#virDomainMigrateSetMaxDowntime">LIbvirt | ||
| 704 | * Documentation</a> | ||
| 705 | * @param downtime | ||
| 706 | * the time to be down | ||
| 707 | * @return 0 in case of success, -1 otherwise. | ||
| 708 | * @throws LibvirtException | ||
| 709 | */ | ||
| 710 | public int migrateSetMaxDowntime(long downtime) throws LibvirtException { | ||
| 711 | int returnValue = libvirt.virDomainMigrateSetMaxDowntime(VDP, downtime, 0); | ||
| 712 | processError(); | ||
| 713 | return returnValue; | ||
| 714 | } | ||
| 715 | |||
| 716 | /** | ||
| 699 | 717 | * Migrate the domain object from its current host to the destination host | |
| 700 | 718 | * given by duri. | |
| 701 | 719 | * | |
| … | … | ||
| 1028 | 1028 | public void undefine() throws LibvirtException { | |
| 1029 | 1029 | libvirt.virDomainUndefine(VDP); | |
| 1030 | 1030 | processError(); | |
| 1031 | } | ||
| 1032 | |||
| 1033 | /** | ||
| 1034 | * Change a virtual device on a domain | ||
| 1035 | * | ||
| 1036 | * @see <a | ||
| 1037 | * href="http://www.libvirt.org/html/libvirt-libvirt.html#virDomainUpdateDeviceFlags">Libvirt | ||
| 1038 | * Documentation</a> | ||
| 1039 | * @param xml | ||
| 1040 | * the xml to update with | ||
| 1041 | * @param flags | ||
| 1042 | * controls the update | ||
| 1043 | * @return 0 in case of success, -1 in case of failure. | ||
| 1044 | * @throws LibvirtException | ||
| 1045 | */ | ||
| 1046 | public int updateDeviceFlags(String xml, int flags) throws LibvirtException { | ||
| 1047 | int returnValue = libvirt.virDomainUpdateDeviceFlags(VDP, xml, flags); | ||
| 1048 | processError(); | ||
| 1049 | return returnValue; | ||
| 1031 | 1050 | } | |
| 1032 | 1051 | ||
| 1033 | 1052 | } |
|   | |||
| 11 | 11 | DomainSnapshotPointer VDSP; | |
| 12 | 12 | ||
| 13 | 13 | /** | |
| 14 | * The Connect Object that represents the Hypervisor of this Domain | ||
| 14 | * The Connect Object that represents the Hypervisor of this Domain Snapshot | ||
| 15 | 15 | */ | |
| 16 | 16 | private Connect virConnect; | |
| 17 | 17 |
|   | |||
| 1 | package org.libvirt; | ||
| 2 | |||
| 3 | import org.libvirt.jna.Libvirt; | ||
| 4 | import org.libvirt.jna.NetworkFilterPointer; | ||
| 5 | |||
| 6 | import com.sun.jna.Native; | ||
| 7 | |||
| 8 | public class NetworkFilter { | ||
| 9 | /** | ||
| 10 | * the native virNWFilterPtr. | ||
| 11 | */ | ||
| 12 | NetworkFilterPointer NFP; | ||
| 13 | |||
| 14 | /** | ||
| 15 | * The Connect Object that represents the Hypervisor of this Filter | ||
| 16 | */ | ||
| 17 | private Connect virConnect; | ||
| 18 | |||
| 19 | /** | ||
| 20 | * The libvirt connection from the hypervisor | ||
| 21 | */ | ||
| 22 | protected Libvirt libvirt; | ||
| 23 | |||
| 24 | public NetworkFilter(Connect virConnect, NetworkFilterPointer NFP) { | ||
| 25 | this.NFP = NFP; | ||
| 26 | this.virConnect = virConnect; | ||
| 27 | libvirt = virConnect.libvirt; | ||
| 28 | } | ||
| 29 | |||
| 30 | @Override | ||
| 31 | public void finalize() throws LibvirtException { | ||
| 32 | free(); | ||
| 33 | } | ||
| 34 | |||
| 35 | /** | ||
| 36 | * Release the network filter handle. The underlying snapshot continues to | ||
| 37 | * exist. | ||
| 38 | * | ||
| 39 | * @throws LibvirtException | ||
| 40 | * @return 0 on success, or -1 on error. | ||
| 41 | */ | ||
| 42 | public int free() throws LibvirtException { | ||
| 43 | int success = 0; | ||
| 44 | if (NFP != null) { | ||
| 45 | success = libvirt.virNWFilterFree(NFP); | ||
| 46 | processError(); | ||
| 47 | NFP = null; | ||
| 48 | } | ||
| 49 | |||
| 50 | return success; | ||
| 51 | } | ||
| 52 | |||
| 53 | /** | ||
| 54 | * Gets the public name for this network filter | ||
| 55 | * | ||
| 56 | * @return the name | ||
| 57 | * @throws LibvirtException | ||
| 58 | */ | ||
| 59 | public String getName() throws LibvirtException { | ||
| 60 | String returnValue = libvirt.virNWFilterGetName(NFP); | ||
| 61 | processError(); | ||
| 62 | return returnValue; | ||
| 63 | } | ||
| 64 | |||
| 65 | /** | ||
| 66 | * Get the UUID for this network filter. | ||
| 67 | * | ||
| 68 | * @return the UUID as an unpacked int array | ||
| 69 | * @throws LibvirtException | ||
| 70 | * @see <a href="http://www.ietf.org/rfc/rfc4122.txt">rfc4122</a> | ||
| 71 | */ | ||
| 72 | public int[] getUUID() throws LibvirtException { | ||
| 73 | byte[] bytes = new byte[Libvirt.VIR_UUID_BUFLEN]; | ||
| 74 | int success = libvirt.virNWFilterGetUUID(NFP, bytes); | ||
| 75 | processError(); | ||
| 76 | int[] returnValue = new int[0]; | ||
| 77 | if (success == 0) { | ||
| 78 | returnValue = Connect.convertUUIDBytes(bytes); | ||
| 79 | } | ||
| 80 | return returnValue; | ||
| 81 | } | ||
| 82 | |||
| 83 | /** | ||
| 84 | * Gets the UUID for this network filter as string. | ||
| 85 | * | ||
| 86 | * @return the UUID in canonical String format | ||
| 87 | * @throws LibvirtException | ||
| 88 | * @see <a href="http://www.ietf.org/rfc/rfc4122.txt">rfc4122</a> | ||
| 89 | */ | ||
| 90 | public String getUUIDString() throws LibvirtException { | ||
| 91 | byte[] bytes = new byte[Libvirt.VIR_UUID_STRING_BUFLEN]; | ||
| 92 | int success = libvirt.virNWFilterGetUUIDString(NFP, bytes); | ||
| 93 | processError(); | ||
| 94 | String returnValue = null; | ||
| 95 | if (success == 0) { | ||
| 96 | returnValue = Native.toString(bytes); | ||
| 97 | } | ||
| 98 | return returnValue; | ||
| 99 | } | ||
| 100 | |||
| 101 | /** | ||
| 102 | * Fetches an XML document describing attributes of the network filter. | ||
| 103 | * | ||
| 104 | * @see <a | ||
| 105 | * href="http://www.libvirt.org/html/libvirt-libvirt.html#virNWFilterGetXMLDesc">Libvirt | ||
| 106 | * Documentation</a> | ||
| 107 | * @return the XML document | ||
| 108 | */ | ||
| 109 | public String getXMLDesc() throws LibvirtException { | ||
| 110 | String returnValue = libvirt.virNWFilterGetXMLDesc(NFP, 0); | ||
| 111 | processError(); | ||
| 112 | return returnValue; | ||
| 113 | } | ||
| 114 | |||
| 115 | /** | ||
| 116 | * Error handling logic to throw errors. Must be called after every libvirt | ||
| 117 | * call. | ||
| 118 | */ | ||
| 119 | protected void processError() throws LibvirtException { | ||
| 120 | virConnect.processError(); | ||
| 121 | } | ||
| 122 | |||
| 123 | /** | ||
| 124 | * undefine the network filter | ||
| 125 | * | ||
| 126 | * @throws LibvirtException | ||
| 127 | */ | ||
| 128 | public void undefine() throws LibvirtException { | ||
| 129 | libvirt.virNWFilterUndefine(NFP); | ||
| 130 | processError(); | ||
| 131 | } | ||
| 132 | } |
|   | |||
| 195 | 195 | processError(); | |
| 196 | 196 | return new StoragePool(virConnect, ptr); | |
| 197 | 197 | } | |
| 198 | |||
| 199 | /** | ||
| 200 | * Ensure data previously on a volume is not accessible to future reads | ||
| 201 | * | ||
| 202 | * @see <a | ||
| 203 | * href="http://www.libvirt.org/html/libvirt-libvirt.html#virStorageVolWipe">Libvirt | ||
| 204 | * Documentation</a> | ||
| 205 | * @return 0 on success, or -1 on error | ||
| 206 | * @throws LibvirtException | ||
| 207 | */ | ||
| 208 | public int wipe() throws LibvirtException { | ||
| 209 | int returnValue = libvirt.virStorageVolWipe(VSVP, 0); | ||
| 210 | processError(); | ||
| 211 | return returnValue; | ||
| 212 | } | ||
| 198 | 213 | } |
|   | |||
| 48 | 48 | * virSecretRef | |
| 49 | 49 | * | |
| 50 | 50 | * LIBVIRT_0.7.2 | |
| 51 | * virStreamRef | ||
| 51 | * virStreamRef | ||
| 52 | * | ||
| 53 | * LIBVIRT_0.8.0 | ||
| 54 | * virNWFilterRef | ||
| 55 | * | ||
| 52 | 56 | */ | |
| 53 | 57 | public interface Libvirt extends Library { | |
| 54 | 58 | // Callbacks | |
| … | … | ||
| 85 | 85 | public void eventCallback(StreamPointer virStreamPointer, int events, Pointer opaque) ; | |
| 86 | 86 | } | |
| 87 | 87 | ||
| 88 | /** | ||
| 89 | * Generic Callbacks | ||
| 90 | */ | ||
| 88 | 91 | interface VirFreeCallback extends Callback { | |
| 89 | 92 | public void freeCallback(Pointer opaque) ; | |
| 90 | 93 | } | |
| 91 | 94 | ||
| 95 | interface VirConnectDomainEventGenericCallback extends Callback { | ||
| 96 | public void eventCallback(ConnectionPointer virConnectPtr, DomainPointer virDomainPointer, Pointer opaque) ; | ||
| 97 | } | ||
| 98 | |||
| 92 | 99 | Libvirt INSTANCE = (Libvirt) Native.loadLibrary("virt", Libvirt.class); | |
| 93 | 100 | ||
| 94 | 101 | // Constants we need | |
| … | … | ||
| 108 | 108 | public int virConnCopyLastError(ConnectionPointer virConnectPtr, virError to); | |
| 109 | 109 | public int virConnectClose(ConnectionPointer virConnectPtr); | |
| 110 | 110 | public int virConnectCompareCPU(ConnectionPointer virConnectPtr, String xmlDesc, int flags); | |
| 111 | public int virConnectDomainEventRegisterAny(ConnectionPointer virConnectPtr, DomainPointer virDomainPtr, int eventID, Libvirt.VirConnectDomainEventGenericCallback cb, Pointer opaque, Libvirt.VirFreeCallback freecb); | ||
| 112 | public int virConnectDomainEventDeregisterAny(ConnectionPointer virConnectPtr, int callbackID) ; | ||
| 111 | 113 | public void virConnSetErrorFunc(ConnectionPointer virConnectPtr, Pointer userData, VirErrorCallback callback); | |
| 112 | 114 | public int virConnectIsEncrypted(ConnectionPointer virConnectPtr) ; | |
| 113 | 115 | public int virConnectIsSecure(ConnectionPointer virConnectPtr) ; | |
| … | … | ||
| 128 | 128 | public int virConnectListDomains(ConnectionPointer virConnectPtr, int[] ids, int maxnames); | |
| 129 | 129 | public int virConnectListInterfaces(ConnectionPointer virConnectPtr, String[] name, int maxNames); | |
| 130 | 130 | public int virConnectListNetworks(ConnectionPointer virConnectPtr, String[] name, int maxnames); | |
| 131 | public int virConnectListNWFilters(ConnectionPointer virConnectPtr, String[] name, int maxnames); | ||
| 131 | 132 | public int virConnectListSecrets(ConnectionPointer virConnectPtr, String[] uids, int maxUids); | |
| 132 | 133 | public int virConnectListStoragePools(ConnectionPointer virConnectPtr, String[] names, int maxnames); | |
| 133 | 134 | public int virConnectNumOfDefinedDomains(ConnectionPointer virConnectPtr); | |
| … | … | ||
| 138 | 138 | public int virConnectNumOfDomains(ConnectionPointer virConnectPtr); | |
| 139 | 139 | public int virConnectNumOfInterfaces(ConnectionPointer virConnectPtr); | |
| 140 | 140 | public int virConnectNumOfNetworks(ConnectionPointer virConnectPtr); | |
| 141 | public int virConnectNumOfNWFilters(ConnectionPointer virConnectPtr); | ||
| 141 | 142 | public int virConnectNumOfSecrets(ConnectionPointer virConnectPtr); | |
| 142 | 143 | public int virConnectNumOfStoragePools(ConnectionPointer virConnectPtr); | |
| 143 | 144 | public ConnectionPointer virConnectOpen(String name); | |
| … | … | ||
| 190 | 190 | public int virDomainGetVcpus(DomainPointer virDomainPtr, virVcpuInfo[] info, int maxInfo, byte[] cpumaps, int maplen); | |
| 191 | 191 | public String virDomainGetXMLDesc(DomainPointer virDomainPtr, int flags); | |
| 192 | 192 | public int virDomainHasCurrentSnapshot(DomainPointer virDomainPtr, int flags); | |
| 193 | public int virDomainHasManagedSaveImage(DomainPointer virDomainPtr, int flags); | ||
| 193 | 194 | public int virDomainInterfaceStats(DomainPointer virDomainPtr, String path, virDomainInterfaceStats stats, int size); | |
| 194 | 195 | public int virDomainIsActive(DomainPointer virDomainPtr); | |
| 195 | 196 | public int virDomainIsPersistent(DomainPointer virDomainPtr); | |
| … | … | ||
| 198 | 198 | public DomainPointer virDomainLookupByName(ConnectionPointer virConnectPtr, String name); | |
| 199 | 199 | public DomainPointer virDomainLookupByUUID(ConnectionPointer virConnectPtr, byte[] uuidBytes); | |
| 200 | 200 | public DomainPointer virDomainLookupByUUIDString(ConnectionPointer virConnectPtr, String uuidstr); | |
| 201 | public int virDomainManagedSave(DomainPointer virDomainPtr, int flags); | ||
| 202 | public int virDomainManagedSaveRemove(DomainPointer virDomainPtr, int flags); | ||
| 201 | 203 | public DomainPointer virDomainMigrate(DomainPointer virDomainPtr, ConnectionPointer virConnectPtr, | |
| 202 | 204 | NativeLong flags, String dname, String uri, NativeLong bandwidth); | |
| 205 | public int virDomainMigrateSetMaxDowntime(DomainPointer virDomainPtr, long downtime, int flags); | ||
| 203 | 206 | public int virDomainMigrateToURI(DomainPointer virDomainPtr, String duri, | |
| 204 | 207 | NativeLong flags, String dname, NativeLong bandwidth); | |
| 205 | 208 | public int virDomainMemoryStats(DomainPointer virDomainPtr, virDomainMemoryStats[] stats, int nr_stats, int flags); | |
| … | … | ||
| 219 | 219 | public int virDomainSetVcpus(DomainPointer virDomainPtr, int nvcpus); | |
| 220 | 220 | public int virDomainShutdown(DomainPointer virDomainPtr); | |
| 221 | 221 | public int virDomainSuspend(DomainPointer virDomainPtr); | |
| 222 | public int virDomainUpdateDeviceFlags(DomainPointer virDomainPtr, String xml, int flags); | ||
| 222 | 223 | public int virDomainUndefine(DomainPointer virDomainPtr); | |
| 223 | 224 | ||
| 224 | 225 | // Network functions | |
| … | … | ||
| 306 | 306 | public StorageVolPointer virStorageVolLookupByKey(ConnectionPointer virConnectPtr, String name); | |
| 307 | 307 | public StorageVolPointer virStorageVolLookupByName(StoragePoolPointer storagePoolPtr, String name); | |
| 308 | 308 | public StorageVolPointer virStorageVolLookupByPath(ConnectionPointer virConnectPtr, String path); | |
| 309 | public int virStorageVolWipe(StorageVolPointer storageVolPtr, int flags); | ||
| 309 | 310 | ||
| 310 | 311 | // Interface Methods | |
| 311 | 312 | public int virInterfaceCreate(InterfacePointer virDevicePointer); | |
| … | … | ||
| 359 | 359 | public int virDomainSnapshotListNames(DomainPointer virDomainPtr, String[] names, int nameslen, int flags); | |
| 360 | 360 | public DomainSnapshotPointer virDomainSnapshotLookupByName(DomainPointer virDomainPtr, String name, int flags); | |
| 361 | 361 | public int virDomainSnapshotNum(DomainPointer virDomainPtr, int flags); | |
| 362 | |||
| 363 | // Network Filter Methods | ||
| 364 | public String virNWFilterGetXMLDesc(NetworkFilterPointer virNWFilterPtr, int flags); | ||
| 365 | public NetworkFilterPointer virNWFilterDefineXML(ConnectionPointer virConnectPtr, String xml); | ||
| 366 | public int virNWFilterFree(NetworkFilterPointer virNWFilterPtr); | ||
| 367 | public NetworkFilterPointer virNWFilterLookupByName(ConnectionPointer virConnectPtr, String name); | ||
| 368 | public NetworkFilterPointer virNWFilterLookupByUUID(ConnectionPointer virConnectPtr, byte[] uuidBytes); | ||
| 369 | public NetworkFilterPointer virNWFilterLookupByUUIDString(ConnectionPointer virConnectPtr, String uuidstr); | ||
| 370 | public String virNWFilterGetName(NetworkFilterPointer virNWFilterPtr); | ||
| 371 | public int virNWFilterGetUUID(NetworkFilterPointer virNWFilterPtr, byte[] uuidString); | ||
| 372 | public int virNWFilterGetUUIDString(NetworkFilterPointer virNWFilterPtr, byte[] uuidString); | ||
| 373 | public int virNWFilterUndefine(NetworkFilterPointer virNWFilterPtr); | ||
| 362 | 374 | } |
|   | |||
| 1 | package org.libvirt.jna; | ||
| 2 | |||
| 3 | import com.sun.jna.PointerType; | ||
| 4 | |||
| 5 | public class NetworkFilterPointer extends PointerType { | ||
| 6 | } |

