\u4f7f\u7528KVM\u7684\u524d\u63d0\u6761\u4ef6\uff1a<\/div>\n
1.qemu-kvm-release.tar.gz\r\n2.kvm-kmod-release.tar.bz2,\u81ea\u5df1\u7f16\u8bd1\u5185\u6838\u6a21\u5757\u7684\u9700\u8981\u8fd9\u4e2a\u4e1c\u4e1c\r\n3.\u652f\u6301VT\u6280\u672f\u7684Intel\u5904\u7406\u5668\u6216\u652f\u6301SVM\u6280\u672f\u7684AMD\u5904\u7406\u5668<\/pre>\n\u4f7f\u7528qemu\u524d\u63d0\u6761\u4ef6\uff1a<\/strong><\/div>\n1.zlib\u5e93\u53ca\u5934\u6587\u4ef6\r\n2.sdl\u5e93\u53ca\u5934\u6587\u4ef6\r\n3.alsa\u5e93\u53ca\u5934\u6587\u4ef6\uff0c\u8fd9\u4e2a\u662f\u7528\u6765\u63d0\u4f9b\u865a\u62df\u5316\u97f3\u9891\u76f8\u5173\u529f\u80fd\uff0c\u9ed8\u8ba4\u662f\u7981\u7528\u7684\uff0c\u73b0\u5728\u4e0d\u77e5\u9053\u4ec0\u4e48\u72b6\u6001\u4e86\uff0c\u53ef\u4ee5\u4f7f\u7528--enable-alsa\u6765\u542f\u7528\r\n4.gnutls\u5e93\u53ca\u5934\u6587\u4ef6\uff0c\u53ef\u9009\u7684VNC TLS\u652f\u6301\uff0c\u9ed8\u8ba4\u6b64\u529f\u80fd\u662f\u5f00\u542f\u7684\uff0c\u53ef\u4ee5\u7528--disable-vnc-tls\u5173\u95ed\r\n5.kernel\u5934\u6587\u4ef6\r\n\r\n*\u521b\u5efa\uff0c\u5b89\u88c5\uff0c\u8fd0\u884cKVM\u865a\u673a\uff0c\u9700\u8981\u4f7f\u7528QEMU\u63d0\u4f9b\u7684\u7528\u6237\u7a7a\u95f4\u5de5\u5177\uff0c\u4ee5\u524d\u662f\u5206\u5f00\u53d1\u5e03\u7684\uff0c\u73b0\u5728\u5206\u652f\u5df2\u7ecf\u5408\u5e76\uff0c\u6210\u4e3aqemu-kvm\u3002\r\n*libvirt\u4e3a\u7528\u6237\u63d0\u4f9b\u4e86\u540c\u4e0d\u540c\u865a\u62df\u5316\u6280\u672f\u4ea4\u4e92\u7684\u62bd\u8c61\u63a5\u53e3\u3002<\/pre>\nlibvirt\u57fa\u672c\u7406\u5ff5\uff1a<\/strong><\/div>\n1.\u540clinux\u865a\u62df\u5316\u6280\u672f\u8fdb\u884c\u4ea4\u4e92\r\n2.\u514d\u8d39\uff0c\u81ea\u7531\r\n3.\u7a33\u5b9a\u7684C\u8bed\u8a00API\r\n4.\u5176\u4ed6\u901a\u7528\u8bed\u8a00\u7684\u7ed1\u5b9a\u5f00\u53d1\u63a5\u53e3\uff08java\uff0cpython\uff0cperl\uff0cphp\u3002\u3002\u3002\uff09\r\n5.\u9488\u5bf9DMTF\u865a\u62df\u98ce\u683c\r\n6.QMF\u4ee3\u7406\uff0c\u7528\u4e8eAMQP\u3001QPID\u4fe1\u606f\u7cfb\u7edf<\/pre>\nlibivrt\u652f\u6301\u5ea6\uff1a<\/strong><\/div>\n\u865a\u62df\u6280\u672f\uff1akvm\/qemu, \u00a0XEN, LXC, OpenVZ, UserModeLinux, VB, ESX, HyperV, PowerVM, Parallels, Bhyre<\/p>\n
\u865a\u62df\u7f51\u7edc\uff1a\u6865\u63a5\uff0cNAT\uff0cVEPA\uff0cVNLINK<\/p>\n
\u5b58\u50a8\uff1aIDE\u3001SCSI\uff0cUSB\uff0cFC\uff0cLVM\uff0cISCSI\uff0cNFS\uff0cFS<\/p>\n
libvirt\u5bf9\u5404\u79cd\u5f00\u53d1\u8bed\u8a00\u7684\u652f\u6301\uff1a<\/strong><\/div>\n1.\u76f4\u63a5\u652f\u6301c\u548cc++\uff0c\u5176\u4ed6\u901a\u8fc7\u7ed1\u5b9a\u652f\u6301 \r\n2.C#\uff0cJAVA\uff0cOCAML\uff0cPerl\uff0cPHP\uff0cPython \r\n3.libvirt\u76f4\u63a5\u652f\u6301python\uff0c\u5982\u679c\u662f\u901a\u8fc7\u5b89\u88c5\u5305\u5b89\u88c5\u800c\u4e0d\u662f\u6e90\u7801\u7f16\u8bd1\u7684\uff0c\u9700\u8981\u786e\u4fdd\u5b89\u88c5\u5408\u9002\u7684\u5305\uff0c\u5728RHEL\u4e2d\uff0c\u53eblibvirt-python\uff0c\u5728ubuntu\u4e2d\u53ebpython-libvirt\uff0c\u5176\u4ed6\u5e73\u53f0\u53ef\u80fd\u6709\u4e0d\u540c\u7684\u540d\u5b57\u3002<\/pre>\nURI\uff1a\u7528\u4e8e\u8fde\u63a5\u6216\u8fdc\u7a0b\u8fde\u63a5\u5230\u5bbf\u4e3b\u673a\u7684libvirt\u865a\u62df\u73af\u5883\uff0c\u7c7b\u4f3c\u6570\u636e\u5e93\u7684\u8fde\u63a5\u5b57\u7b26\u4e32<\/strong><\/div>\n1.\u6307\u5b9aURI\u8fde\u63a5\u5230libvirt\uff1a\u901a\u8fc7\u628aname\u53c2\u6570\u4f20\u9012\u5230virConnectOpen\u6216virConnectOpenReadOnly\u65b9\u6cd5\uff1a virConnectPtr conn = virConnectOpenReadOnly(\"xxx:\/\/\/default\"); \r\n2.\u4e3a\u8282\u7701\u7ba1\u7406\u5458\u65f6\u95f4\uff0c\u53ef\u4ee5\u5728libvirt\u5ba2\u6237\u7aef\u914d\u7f6e\u6587\u4ef6\u4e2d\u914d\u7f6eURI\u522b\u540d\uff0c\r\n\u914d\u7f6e\u6587\u4ef6\u4f4d\u7f6e\/etc\/libvirt\/libvirt.conf(\u9488\u5bf9root\u7528\u6237)\u6216$XDG_CONFIG_HOME\/libvirt\/libvirt.conf(\u9488\u5bf9\u975e\u7279\u6743\u7528\u6237)\uff0c\u53ef\u7528\u4e0b\u9762\u8bed\u6cd5\u8bbe\u7f6e\u522b\u540d uri_aliases = [ \"miaomiao=xxx:\/\/xxx@www.xxx.com.cn\/system\", \"wangwang=xxx:\/\/xxx@www.xxx.com\/system\" ] \u522b\u540d\u7531a-z\uff0c0-9,_\u7b49\u5b57\u7b26\u7ec4\u6210\uff0cURI\u522b\u540d\u4f1a\u5e94\u7528\u5230\u4efb\u4f55\u6253\u5f00libvirt\u8fde\u63a5\u7684\u5e94\u7528\u4e2d\uff0c\u9664\u975e\u628a\u53c2\u6570VIR_CONNECT_NO_ALIASES\u4f20\u7ed9virConnectOpenAuth\uff0c\r\n\u5982\u679c\u522b\u540d\u4e2d\u5305\u542b\u975e\u6cd5\u5b57\u7b26\uff0c\u5219\u4e0d\u505a\u4efb\u4f55\u522b\u540d\u67e5\u627e\u3002 \r\n\u5982\u679cURI\u4f20\u9012\u7ed9virConnectOpen\u53c2\u6570\u4e3aNULL\uff0c\u5219libvirt\u4f1a\u7528\u4e0b\u9762\u89c4\u5219\u786e\u5b9aURI\uff1a \r\n 1.\u73af\u5883\u53d8\u91cf\uff1aLIBVIRT_DEFAULT_URI \r\n 2.\u5ba2\u6237\u7aef\u914d\u7f6e\u6587\u4ef6\uff1auri_default\u53c2\u6570\r\n 3.\u63a2\u6d4b\u6bcf\u4e2a\u865a\u673a\u7ba1\u7406\u5668\u77e5\u9053\u627e\u5230\u4e00\u4e2a\u53ef\u7528\u7684<\/pre>\nlibvirt\u57fa\u672c\u6982\u5ff5\uff1a<\/strong><\/div>\nnode\uff1a\u8282\u70b9\uff0c\u5bbf\u4e3b\u673a\uff0c\u4e00\u4e2anode\u662f\u4e00\u4e2a\u5355\u72ec\u7684\u7269\u7406\u673a\uff0c\u7528\u4e8e\u8fd0\u884c\u865a\u673a<\/p>\n
hypervisor\uff1a\u4e00\u4e2a\u8f6f\u4ef6\u5c42\uff0c\u53ef\u4ee5\u628a\u4e00\u4e2a\u7269\u7406\u673a\u7528\u4e0d\u540c\u7684\u914d\u7f6e\u865a\u62df\u5316\u4e3a\u591a\u4e2a\u865a\u673a\u7684\u96c6\u5408<\/p>\n
domain\uff1a\u865a\u62df\u673a\uff0c\u5728\u5bb9\u5668\u7ea7\u865a\u62df\u5316\u60c5\u51b5\u4e2d\uff0c\u662f\u4e00\u4e2a\u5b50\u7cfb\u7edf\uff0c\u8fd0\u884c\u5728\u7531hypervisor\u63d0\u4f9b\u7684\u673a\u5668\u4e0a<\/p>\n
libvirt\uff1a\u63d0\u4f9b\u4e00\u4e2a\u901a\u7528\u7684\u8f6f\u4ef6\u5c42\uff0c\u5b89\u5168\u9ad8\u6548\u7684\u7ba1\u7406node\u4e0a\u7684domain\uff0c\u540c\u65f6\u5b9e\u73b0\u8fdc\u7a0b\u7ba1\u7406\u529f\u80fd\u3002<\/p>\n
*\u5728windows\u7cfb\u7edf\u4e2d\u4f7f\u7528libvirt java\u7ed1\u5b9a\uff0c\u9700\u8981\u4f7f\u7528libvirt java\u5e93\uff0cjna.jar\u5e93\u53ca\u5bf9\u5e94\u5e73\u53f0\u7684dll\u6587\u4ef6\uff0c\u5982\u679c\u62a5\u9519\uff1a\u627e\u4e0d\u5230dll\u6216\u627e\u4e0d\u5230\u76f8\u5173\u6a21\u5757\u65f6,\u9700\u8981\u5b89\u88c5virtviewer \u5728java\u4ee3\u7801\u4e2d\u52a0\u5165\uff1a System.setProperty(\"jna.library.path\", \"c:\\\\program files\\\\VirtViewer\\\\bin\"); \u5e76\u9700\u8981\u5728\u4e0a\u9762\u8def\u5f84\u653e\u7f6e\u4e00\u4efdvirt-0.dll\u6587\u4ef6\u526f\u672c\uff0c\u547d\u540d\u4e3avirt.dll<\/p>\n
SPICE:<\/strong><\/div>\nSPICE\u670d\u52a1\u7aef\u662f\u4e00\u4e2a\u7528libspice\u5b9e\u73b0\u7684VDI\u5e93\uff0cVDI\u5b9a\u4e49\u4e86\u4e00\u7cfb\u5217\u63a5\u53e3\u6765\u53d1\u5e03\u865a\u62df\u8bbe\u5907\u3002\uff08\u5982\uff1a\u663e\u793a\u8bbe\u5907\uff0c\u952e\u76d8\uff0c\u9f20\u6807\uff09\u5e76\u4e14\u80fd\u8ba9\u4e0d\u540c\u7684spice\u7ec4\u4ef6\u548c\u8fd9\u4e9b\u8bbe\u5907\u4ea4\u4e92\uff0c\u4ece\u4e00\u65b9\u9762\u6765\u8bf4\uff0c\u670d\u52a1\u7aef\u4f7f\u7528spice\u534f\u8bae\u540c\u5ba2\u6237\u7aef\u901a\u4fe1\uff0c\u4ece\u53e6\u4e00\u65b9\u9762\u6765\u8bf4\uff0c\u670d\u52a1\u7aef\u540cVDI\u4e3b\u673a\u5e94\u7528\u8fdb\u884c\u4ea4\u4e92\u5982QEMU\u3002 SPICE\u5ba2\u6237\u7aef\u662f\u6700\u7ec8\u7528\u6237\u6240\u9762\u5bf9\u7684\u63a5\u53e3\u3002<\/p>\n
QXL\u8bbe\u5907\u548c\u9a71\u52a8<\/strong><\/div>\n\u5f53libspice\u4e0eqemu\u7ed3\u5408\u4f7f\u7528\u65f6\uff0cQEMU QXL PCI\u8bbe\u5907\u53ef\u4ee5\u7528\u6765\u63d0\u5347\u8fdc\u7aef\u663e\u793a\u6027\u80fd\uff0c\u589e\u5f3a\u5ba2\u6237\u673a\u7684\u56fe\u5f62\u7cfb\u7edf\u3002QXL\u8bbe\u5907\u9700\u8981\u5ba2\u6237\u673aQXL\u9a71\u52a8\u652f\u6301\u3002 SPICE\u534f\u8bae\u652f\u6301\u4e00\u79cd\u901a\u4fe1\u4fe1\u9053\uff0c\u6b64\u901a\u9053\u8fde\u63a5\u5ba2\u6237\u548c\u670d\u52a1\u7aef\u7684\u4ee3\u7406\uff0c\u5f53\u4f7f\u7528QEMU\u65f6\uff0cSPICE\u4ee3\u7406\u4f4d\u4e8e\u5ba2\u6237\u673a\uff0cVDI\u7aef\u53e3\u662f\u4e00\u4e2aQEMUPCI\u8bbe\u5907\uff0c\u53ef\u4ee5\u4e0e\u6b64\u4ee3\u7406\u8fdb\u884c\u901a\u4fe1\u3002<\/p>\n
SPICE\u6709\u516d\u5927\u901a\u9053\uff1a<\/strong><\/div>\n\u4e3b\u901a\u9053\uff1a\u63a7\u5236\u4e0e\u914d\u7f6e<\/p>\n
\u663e\u793a\u901a\u9053\uff1a\u56fe\u5f62\u547d\u4ee4\uff0c\u56fe\u5f62\uff0c\u89c6\u9891\u6d41<\/p>\n
\u8f93\u5165\u901a\u9053\uff1a\u952e\u76d8\u548c\u9f20\u6807\u8f93\u5165<\/p>\n
\u5149\u6807\u901a\u9053\uff1a\u5b9a\u4f4d\u8bbe\u5907\u7684\u4f4d\u7f6e\u4e0e\u5149\u6807\u5f62\u72b6<\/p>\n
\u56de\u653e\u901a\u9053\uff1a\u670d\u52a1\u7aef\u7684\u58f0\u97f3\u5728\u5ba2\u6237\u7aef\u64ad\u653e<\/p>\n
\u5f55\u5236\u901a\u9053\uff1a\u4ece\u5ba2\u6237\u7aef\u8fdb\u884c\u97f3\u9891\u6355\u83b7<\/p>\n
SPICE\u56fe\u50cf\u538b\u7f29\u529f\u80fd\uff1a<\/strong><\/div>\nSPICE\u672c\u8eab\u63d0\u4f9b\u4e86\u591a\u79cd\u56fe\u50cf\u538b\u7f29\u7b97\u6cd5\uff0c\u53ef\u4ee5\u5728\u670d\u52a1\u5668\u521d\u59cb\u5316\u65f6\u8fdb\u884c\u9009\u62e9\uff0c\u4e5f\u53ef\u4ee5\u5728\u8fd0\u884c\u671f\u52a8\u6001\u9009\u62e9. QUIC\u662fSPICE\u4e13\u6709\u7684\u56fe\u50cf\u538b\u7f29\u7b97\u6cd5\uff0c\u6b64\u6280\u672f\u57fa\u4e8eSFALIC\u7b97\u6cd5\uff0cLempel_zip(LZ)\u7b97\u6cd5\u540c\u6837\u4e5f\u662fSPICE\u652f\u6301\u7684\u7b97\u6cd5\u3002QUIC\u548cLZ\u90fd\u662f\u672c\u5730\u7b97\u6cd5\uff0c\u72ec\u7acb\u7f16\u7801\u6bcf\u4e00\u4e2a\u56fe\u50cf\u3002\u5168\u5c40LZ\uff08GLZ\uff09\u662f\u53e6\u4e00\u4e2aSPICE\u4e13\u6709\u7b97\u6cd5\uff0c\u4e0eLZ\u540c\u57fa\u4e8e\u5386\u53f2\u7684\u5168\u5c40\u5b57\u5178\u8868\u5171\u540c\u4f7f\u7528\uff0cGLZ\u53ef\u4ee5\u5728\u5927\u91cf\u56fe\u50cf\u4e4b\u95f4\u4f7f\u7528\u91cd\u590d\u8868\u8fbe\u5f0f\u6765\u964d\u4f4e\u6d41\u91cf\u6d88\u8017\uff0c\u4ece\u800c\u4fdd\u5b58\u5e26\u5bbd\u3002\u7279\u522b\u9002\u5408\u5728\u4f4e\u5e26\u5bbd\u7684\u5e7f\u57df\u7f51\u73af\u5883\u4e2d\u4f7f\u7528\u3002 SPICE\u540c\u6837\u63d0\u4f9b\u4e86\u4e00\u4e2a\u9488\u5bf9\u6bcf\u4e00\u4e2a\u56fe\u50cf\u81ea\u52a8\u9009\u62e9\u538b\u7f29\u7b97\u6cd5\u7684\u5de5\u4f5c\u6a21\u5f0f\uff0c\u901a\u8fc7\u56fe\u50cf\u5c5e\u6027\u542f\u53d1\u5f0f\u7684\u9009\u62e9LZ\uff0cGLZ\uff0cQUIC\u7b97\u6cd5\u3002 \u4ece\u7406\u8bba\u4e0a\u8bb2\uff0cLZ\u3001GLZ\u66f4\u9002\u5408\u538b\u7f29\u5408\u6210\u56fe\u50cf\uff0cQUIC\u66f4\u9002\u5408\u538b\u7f29\u771f\u5b9e\u56fe\u50cf.<\/p>\n
\u89c6\u9891\u538b\u7f29\uff1a<\/strong><\/div>\nSPICE\u4f7f\u7528\u4f4e\u635f\u538b\u7f29\u7b97\u6cd5\u538b\u7f29\u53d1\u9001\u5230\u5ba2\u6237\u7aef\u7684\u56fe\u50cf\uff0c\u4f46\u662f\u89c6\u9891\u6d41\u5374\u662f\u4f7f\u7528\u4e0d\u540c\u7684\u65b9\u6cd5\u6765\u5904\u7406\u3002SPICE\u670d\u52a1\u7aef\u4f7f\u7528\u81ea\u542f\u53d1\u65b9\u5f0f\u6807\u8bb0\u52a8\u6001\u89c6\u9891\u533a\u57df\u5e76\u628a\u4ed6\u4eec\u4f5c\u4e3a\u89c6\u9891\u6d41\u53d1\u9001\u51fa\u53bb\uff0c\u7f16\u7801\u4f7f\u7528mjpeg\uff0c\u8fd9\u79cd\u5904\u7406\u65b9\u6cd5\u5728\u67d0\u79cd\u7a0b\u5ea6\u4e0a\u8282\u7ea6\u4e86\u6d41\u91cf\uff0c\u63d0\u9ad8\u4e86spice\u6027\u80fd\uff0c\u5c24\u5176\u5728\u5e7f\u57df\u7f51\u73af\u5883\u4e2d\u3002\u53ef\u662f\u5728\u67d0\u4e9b\u60c5\u51b5\u4e0b\uff0c\u8fd9\u79cd\u542f\u53d1\u884c\u4e3a\u53ef\u80fd\u4f1a\u5bfc\u81f4\u4f4e\u8d28\u91cf\u7684\u56fe\u50cf\u6548\u679c\uff0c\u6bd4\u5982\u628a\u4e0d\u65ad\u66f4\u65b0\u7684\u6587\u672c\u533a\u57df\u8bc6\u522b\u4e3a\u89c6\u9891\u533a\u57df\uff0c\u4ece\u800c\u5bfc\u81f4\u90e8\u5206\u533a\u57df\u56fe\u50cf\u6548\u679c\u8d28\u91cf\u4f4e\u4e0b\u3002<\/p>\n
\u4ece\u6e90\u4ee3\u7801\u7f16\u8bd1\uff0c\u9700\u8981\u4ee5\u4e0b\u7ec4\u4ef6\uff1a<\/strong><\/div>\n*qpixman\uff1a\u4e00\u4e2a\u63a7\u5236\u50cf\u7d20\u533a\u57df\u7684\u901a\u7528\u5e93\uff0c\u5305\u62ec\u4f4e\u7ea7\u522b\u50cf\u7d20\u63a7\u5236\u7a0b\u5e8f\uff0c\u540c\u65f6\u4e5f\u88abcairo\u5e93\u4f7f\u7528\uff0ccairo\u662f\u4e00\u4e2a\u7528\u4e8e\u652f\u6301\u591a\u8f93\u51fa\u8bbe\u5907\u76842D\u56fe\u5f62\u5e93\uff0cqpixman\u662fpixman\u7684\u8f7b\u91cf\u7ea7\u4fee\u6539\u7248<\/p>\n
*qcairo\uff1acairo\u662f\u4e00\u4e2a\u77e2\u91cf\u56fe\u5f62\u8bbe\u5907\u65e0\u5173\u5e93\uff0cqcairo\u662fcairo\u7684\u8f7b\u91cf\u7ea7\u4fee\u6539\u7248 *celt\uff1aCELT\u662f\u4e00\u79cd\u97f3\u9891\u538b\u7f29\u7b97\u6cd5\uff0c\u4ee5\u9ad8\u8d28\u91cf\u4f20\u8f93\u97f3\u4e50\uff0c\u4fe1\u53f7\u4f1a\u6709\u975e\u5e38\u5c0f\u7684\u5ef6\u8fdf *ffmpeg\uff1a\u662f\u4e00\u4e2a\u7528\u4e8e\u97f3\u9891\u548c\u89c6\u9891\u91cd\u7f16\u7801\uff0c\u8f6c\u6362\uff0c\u6d41\u4f20\u8f93\u7684\u5e93\u3002\u5305\u62eclibarcodec\u97f3\u9891\u89c6\u9891\u7f16\u7801\u5e93 *log4cpp\u662f\u4e00\u4e2a\u7075\u6d3b\u7684\u65e5\u5fd7\u8bb0\u5f55\u5e93\uff0c\u53ef\u4ee5\u9488\u5bf9\u6587\u4ef6\uff0csyslog\u7b49\uff0c\u7ee7log4j\u4e4b\u540e\u6210\u578b<\/p>\n
*\u5173\u4e8ewindows\u865a\u673a\u5b89\u88c5virtio\u786c\u76d8\u9a71\u52a8\u7684\u95ee\u9898\uff0c\u4e00\u79cd\u65b9\u5f0f\u662f\u5728\u5b89\u88c5\u7cfb\u7edf\u7684\u8fc7\u7a0b\u4e2d\u52a0\u5728virtio\u9a71\u52a8\u5149\u76d8\u6216\u8f6f\u76d8\uff08winxp\uff09\uff0c\u5982\u679c\u7cfb\u7edf\u5df2\u7ecf\u88c5\u5b8c\uff0c\u53ef\u4ee5\u5148\u521b\u5efa\u4e00\u4e2a\u5c0f\u78c1\u76d8\u955c\u50cf\uff0c qemu-img create -f qcow2 xxx.img 1G \u7f16\u8f91\u865a\u673a\u914d\u7f6e\u6587\u4ef6\uff0c\u52a0\u5165\u6b64\u786c\u76d8\u955c\u50cf\uff0c\u8bbe\u7f6e\u53c2\u6570dev='vdc' bus='virtio'\u542f\u52a8\u7cfb\u7edf\u540e\u4f1a\u53d1\u73b0\u65b0\u786c\u4ef6\uff0c\u9009ISO\u955c\u50cf\u4e2d\u5bf9\u5e94\u7684virtiosto\u9a71\u52a8\u9009virtioscsi\u9a71\u52a8\u5173\u95edvm\uff0c\u4fee\u6539\u865a\u673a\u914d\u7f6e\uff0c\u5220\u9664\u5c0f\u786c\u76d8\u955c\u50cf\uff0c\u628a\u539f\u78c1\u76d8\u6539\u4e3adev='vda' bus='virtio'\u5e76\u5220\u9664\u5730\u5740\u90e8\u5206\uff0c\u542f\u52a8\u7cfb\u7edf\u67e5\u770b\u9a71\u52a8\u60c5\u51b5\u3002<\/p>\n
*\u5173\u4e8e\u5df2\u6709libvirt\u65f6\u81ea\u5df1\u7f16\u8bd1libvirt\u65f6\u5bfc\u81f4libvirt-sock\u4e0d\u5b58\u5728\u60c5\u51b5\uff0c\u8be5\u4f4d\u7f6e\u5728\/run\/user\/1000\/libvirt\/libvirt-sock\u6216\/usr\/local\/var\/run\/libvirt\/libvirt-sock,\u7f16\u8bd1\u540e\u52a0\u5728libvirtd\u5b88\u62a4\u8fdb\u7a0b\uff0c\u7528netstat\u67e5\u770blibvirt-sock\u662f\u5426\u5728\u914d\u7f6e\u6587\u4ef6\u5236\u5b9a\u4f4d\u7f6e\u4fa6\u542c\u3002<\/p>\n
\u4f7f\u7528java\u7684libvirt\u5f00\u53d1API\u65f6\u6ce8\u610f\uff1a<\/strong><\/div>\n* \u5728\u4f7f\u7528java\u7a0b\u5e8f\u7f16\u5199libvirt\u5e94\u7528\u65f6\uff0c\u5f53\u865a\u673a\u5904\u4e8epmsuspended\u72b6\u6001\u65f6\u662f\u65e0\u6cd5\u83b7\u53d6domainInfo\u4fe1\u606f\uff0c\u4f1a\u51fa\u73b0\u6570\u7ec4\u8d8a\u754c\u7684\u9519\u8bef\u63d0\u793a\u3002<\/p>\n
* \u4f7f\u7528attachDevice\u65b9\u6cd5\u6dfb\u52a0\u8bbe\u5907\u65f6\u8981\u6ce8\u610f\uff0cflag=0\u65f6\uff0c\u8868\u793a\u6267\u884c\u7ed3\u679c\u5f71\u54cd\u5f53\u524d\u72b6\u6001\uff0c\u5f53\u524d\u72b6\u6001\u4e3a\u8fd0\u884c\u72b6\u6001\uff0c\u5219\u53ea\u6709\u8fd0\u884c\u65f6\u5b58\u5728\uff0c\u5f53\u524d\u72b6\u6001\u4e3a\u5173\u95ed\u72b6\u6001\u5219\u5f71\u54cd\u5173\u673a\u914d\u7f6e\u6587\u4ef6\u3002flag=1\u65f6\uff0c\u8868\u793a\u5f71\u54cd\u8fd0\u884c\u65f6\u72b6\u6001\uff0c\u6267\u884c\u6b64\u65b9\u6cd5\u65f6\uff0c\u865a\u673a\u5fc5\u987b\u5904\u4e8eActive\u72b6\u6001\u3002flag=2\u65f6\uff0c\u8868\u793a\u5f71\u54cd\u865a\u673a\u6301\u4e45\u914d\u7f6e\u6587\u4ef6\uff0c\u4f46\u662f\u5728qemu\u73af\u5883\u4e2dflag=1\u4f1a\u4e0d\u652f\u6301\uff0c\u7a0b\u5e8f\u4f1a\u7206\u51fa\u4e0d\u652f\u6301\u70ed\u63d2\u62d4\uff0c\u53ef\u4ee5\u4f7f\u7528domainUpdateDeviceFlags\u8fdb\u884c\u6362\u76d8\u64cd\u4f5c\u3002 \u66f4\u65b0\u6301\u4e45\u914d\u7f6e\u6587\u4ef6\u540e\uff0c\u9700\u8981\u5173\u673a\u91cd\u65b0\u542f\u52a8\u4ee5\u4f7f\u65b0\u914d\u7f6e\u751f\u6548\u3002domain.getXMLDesc()\u65b9\u6cd5\u83b7\u53d6\u7684\u662f\u865a\u673a\u7684\u8fd0\u884c\u65f6\u914d\u7f6e\uff0c\u800c\u4e0d\u662f\u6301\u4e45\u5316\u914d\u7f6e\uff0c\u6240\u4ee5\u4f1a\u770b\u5230\u88ab\u5220\u9664\u7684\u8bbe\u5907\u4ecd\u7136\u8fd8\u5728\u3002<\/p>\n
* \u4f7f\u7528DomainUpdateDeviceFlags()\u65b9\u6cd5\u66f4\u65b0\u865a\u673a\u914d\u7f6e\u65f6\uff0c\u4f7f\u7528updateFlags 0\u62161\u90fd\u4f1a\u66f4\u65b0\u5904\u4e8eActive\u72b6\u6001\u7684\u865a\u673a\u8fd0\u884c\u65f6\u914d\u7f6e\uff0c\u5728\u865a\u673a\u91cd\u542f\u540e\u4f1a\u4fdd\u6301\u8fd9\u79cd\u66f4\u65b0\uff0c\u56e0\u4e3a\u91cd\u542f\u865a\u673a\u4e0d\u4f1a\u91cd\u65b0\u52a0\u8f7d\u6301\u4e45\u5316\u914d\u7f6e\uff0c\u5173\u673a\u4e4b\u540e\u91cd\u65b0\u5f00\u673a\uff0c\u914d\u7f6e\u4f1a\u8fd8\u539f\u4e3a\u539f\u5148\u914d\u7f6e\u3002 \u5f53\u4f7f\u7528updateFlags\u4e3a2\u65f6\uff0c\u4f1a\u51fa\u73b0\u65e0\u6cd5\u66f4\u65b0\u7684\u60c5\u51b5\uff0c\u867d\u7136\u65b9\u6cd5\u4f1a\u6267\u884c\u6210\u529f\uff0c\u4f46\u65e0\u6cd5\u66f4\u65b0\u6301\u4e45\u914d\u7f6e\u6587\u4ef6\u3002\u5728\u5173\u673a\u72b6\u6001\u4e0b\uff0c\u4f7f\u7528updateFlags=1\u65f6\uff0c\u4f1a\u62a5\u9519\uff0c\u56e0\u4e3a\u66f4\u65b0Live\u72b6\u6001\u53ea\u80fd\u5728domain\u7684active\u72b6\u6001\u4e0b\u6267\u884c\u3002<\/p>\n
* \u9700\u8981\u6ce8\u610f\u7684\u662fLibvirt\u4e0d\u652f\u6301cdrom\u3001floppydisk\u9a71\u52a8\u5668\u7684\u70ed\u63d2\u62d4\uff0c\u4f7f\u7528attachDevice()\u65b9\u6cd5\u65f6\uff0c\u5236\u5b9aflags\u4e3a0\u62161\u65f6\uff0c\u67d0\u4e9b\u8bbe\u5907\u7c7b\u578b\u5982CDROM\u5bf9\u8fd0\u884c\u65f6\u4fee\u6539\u53ef\u80fd\u4f1a\u8fd4\u56de\u5931\u8d25\uff0c\u539f\u56e0\u662fhypervisor\u5e95\u5c42\u9a71\u52a8\u4e0d\u652f\u6301\u3002\u5982\u679c\u5bf9\u6b63\u5728\u8fdb\u884c\u5757\u590d\u5236\u7684\u8bbe\u5907\u8fdb\u884cdetach()\u65b9\u6cd5\u64cd\u4f5c\uff0chypervisor\u53ef\u80fd\u4f1a\u963b\u6b62detach()\u7684\u64cd\u4f5c\uff0c\u5728\u8fd9\u79cd\u60c5\u51b5\u4e0b\uff0c\u9700\u8981\u5148\u4f7f\u7528domainBlockJobAbort()\u65b9\u6cd5\u5148\u505c\u6b62\u8be5\u590d\u5236\u64cd\u4f5c\u5373\u53ef\u3002<\/p>\n
* \u6839\u636ehypervisor\u548c\u8bbe\u5907\u7c7b\u578b\u7684\u4e0d\u540c\uff0c\u5728\u4e00\u4e2a\u5904\u4e8eactive\u72b6\u6001\u7684domain\u4e2d\u53bb\u9664\u4e00\u4e2a\u8bbe\u5907\u7684\u64cd\u4f5c\u53ef\u80fd\u662f\u5f02\u6b65\u6267\u884c\u7684\uff0c\u4e5f\u5c31\u662f\u8bf4\uff0c\u5f53\u4f60\u6267\u884cdetach()\u65b9\u6cd5\u65f6\uff0c\u4ec5\u4ec5\u662f\u8bf7\u6c42\u53bb\u9664\u4e00\u4e2a\u8bbe\u5907\uff0c\u5b9e\u9645\u53bb\u6389\u6b64\u8bbe\u5907\u7684\u65f6\u95f4\u53ef\u80fd\u662f\u4e4b\u540e\u7684\u4e00\u6bb5\u65f6\u95f4\uff0c\u8fd9\u662f\u6839\u636e\u865a\u62df\u5c42\u4e0e\u5ba2\u6237os\u914d\u5408\u5b8c\u6210\u7684\u3002\u8fd9\u5f80\u5f80\u5bb9\u6613\u88ab\u5ffd\u7565\uff0c\u56e0\u4e3a\u6709\u65f6\u4f1a\u770b\u5230\u5728\u914d\u7f6e\u6587\u4ef6\u4e2d\u6b64\u8bbe\u5907\u5df2\u7ecf\u88ab\u5220\u9664\u4e86\uff0c\u4f46hypervisor\u53ef\u80fd\u8fd8\u6ca1\u6709\u771f\u6b63\u5220\u9664\u8fd9\u4e2a\u8bbe\u5907\uff0c\u8fd9\u53ef\u80fd\u4f1a\u5bfc\u81f4\u67d0\u4e9b\u540e\u7eed\u64cd\u4f5c\u7684\u5931\u8d25\u3002\u60f3\u8981\u68c0\u67e5\u8bbe\u5907\u662f\u5426\u771f\u7684\u88ab\u6210\u529f\u5220\u9664\u4e86\uff0c\u8981\u4e48\u91cd\u65b0\u4f7f\u7528domainGetXMLDesc()\u65b9\u6cd5\uff0c\u8981\u4e48\u4e3aDOMAIN_EVENT_ID_DEVICE_REMOVED\u589e\u52a0\u4e00\u4e2a\u4e8b\u4ef6\u5904\u7406\u5668\uff0c\u5982\u679c\u5f53detachDeviceFlags()\u65b9\u6cd5\u8fd4\u56de\u65f6\uff0c\u8bbe\u5907\u5df2\u7ecf\u88ab\u5220\u9664\uff0c\u4e8b\u4ef6\u4f1a\u5728API CALL\u7ed3\u675f\u4e4b\u524d\u89e6\u53d1\u3002\u4e3a\u4e86\u5e2e\u52a9\u73b0\u6709\u7684\u5ba2\u6237\u7aef\u5728\u5927\u591a\u6570\u60c5\u51b5\u4e0b\u66f4\u597d\u7684\u5de5\u4f5c\uff0c\u8fd9\u4e2aAPI\u4f1a\u5c1d\u8bd5\u628a\u5728\u8bf7\u6c42\u4e4b\u540e\u8fc7\u4e86\u4e00\u6bb5\u65f6\u95f4\u624d\u5b8c\u6210\u7684\u5f02\u6b65\u5220\u9664\u64cd\u4f5c\u8f6c\u53d8\u4e3a\u540c\u6b65\u5220\u9664\u64cd\u4f5c\uff0c\u6362\u53e5\u8bdd\u8bf4\uff0cAPI\u5728\u5f02\u6b65\u64cd\u4f5c\u7684\u60c5\u51b5\u4e0b\u4f1a\u7b49\u5f85\u4e00\u4f1a\u513f\u6765\u8ba9\u5220\u9664\u64cd\u4f5c\u5f97\u4ee5\u5b8c\u6210\u3002 \u6ce8\u610f\uff0c\u70ed\u63d2\u62d4\u8bbe\u5907\u4e0d\u4f1a\u4fdd\u6301\uff0c\u4e00\u65e6domain\u8fdb\u5165S4\u72b6\u6001\u5373hibernation\u72b6\u6001\uff0c\u9664\u975e\u540c\u6837\u4fee\u6539\u4e86domain\u7684\u6301\u4e45\u914d\u7f6e\u6587\u4ef6\u3002<\/p>\n
* \u4f7f\u7528setMaxMemory()\u65b9\u6cd5\u8bbe\u7f6e\u865a\u673a\u6700\u5927\u5185\u5b58\u65f6\uff0c\u9ed8\u8ba4\u4f7f\u7528\u7684\u662fAFFECT_CURRENT\uff0c\u4e5f\u5c31\u662f\u8bf4\u5f53domain\u5173\u95ed\u65f6\uff0c\u4fee\u6539\u6301\u4e45\u5316\u914d\u7f6e\u6587\u4ef6\uff0c\u5f53domain\u5904\u4e8eactive\u72b6\u6001\u65f6\uff0c\u4fee\u6539\u8fd0\u884c\u65f6\u914d\u7f6e\u6216\u8fd0\u884c\u65f6\u6301\u4e45\u5316\u914d\u7f6e\u90fd\u4fee\u6539\uff0c\u8fd9\u4e2a\u8981\u770bhypervisor\u7684\u884c\u4e3a\u800c\u5b9a\u3002\u4f8b\u5982\uff0c\u5728libvirt\u4e2d\u5f53domain\u5904\u4e8eactive\u72b6\u6001\u65f6\uff0c\u4fee\u6539\u6700\u5927\u5185\u5b58\u65f6\u4f1a\u62a5\u9519\uff0c\u5fc5\u987b\u5173\u95eddomain\u518d\u4fee\u6539\u6301\u4e45\u5316\u914d\u7f6e\u3002<\/p>\n
\u5728\u4f7f\u7528API\u5f00\u53d1\u865a\u673a\u5feb\u7167\u529f\u80fd\u65f6\uff0c\u9700\u8981\u6ce8\u610f\u5982\u4e0b\u51e0\u70b9\uff1a<\/strong><\/div>\n\u5982\u679c\u67d0\u865a\u673a\u521b\u5efa\u5feb\u7167\u65f6\u4f7f\u7528\u7684\u662f\u5185\u90e8\u5feb\u7167\u6216\u7cfb\u7edf\u68c0\u67e5\u70b9\uff0c\u5219\u8be5\u865a\u673a\u6240\u6709\u786c\u76d8\u90fd\u5fc5\u987b\u521b\u5efa\u5185\u90e8\u5feb\u7167\uff0cqemu\u4e0d\u652f\u6301\u521b\u5efa\u6df7\u5408\u5feb\u7167\uff0c\u5373\u4e00\u90e8\u5206\u786c\u76d8\u521b\u5efa\u5185\u90e8\u5feb\u7167\uff0c\u4e00\u90e8\u5206\u521b\u5efa\u5916\u90e8\u5feb\u7167\uff0c\u5f53\u7136\u53ea\u8bfb\u76d8\u5982\u5149\u9a71\u9ed8\u8ba4\u662f\u4e0d\u521b\u5efa\u5feb\u7167\u7684\u3002
\n\u7cfb\u7edf\u68c0\u67e5\u70b9\u9ed8\u8ba4\u6240\u6709\u53ef\u8bfb\u5199\u786c\u76d8\u4f7f\u7528\u5185\u90e8\u5feb\u7167\uff08\u5173\u673a\u72b6\u6001\u4e0b\uff0c\u4f1a\u5ffd\u7565disks\u6807\u7b7e\u5185\u5bb9\uff09\u3002<\/p>\n
\u5982\u679c\u5728\u521b\u5efa\u5feb\u7167\u65b9\u6cd5\u4e2d\u6307\u5b9a\u4e86flags\u4e3a16\uff08disk-only\uff09\uff0c\u5219\u6ca1\u6709\u660e\u786e\u6307\u5b9a\u5feb\u7167\u65b9\u5f0f\u7684\u786c\u76d8\u9ed8\u8ba4\u4f7f\u7528\u5916\u90e8\u5feb\u7167\uff0cqemu\u76ee\u524d\u4e0d\u652f\u6301\u5185\u5916\u90e8\u6df7\u5408\u5feb\u7167\u3002
\n\u4f7f\u7528\u7cfb\u7edf\u68c0\u67e5\u70b9\u5feb\u7167\u65f6\uff0c\u5bf9cpu\u7279\u6027\u96c6\u6709\u8981\u6c42\uff0c\u5f53domain\u914d\u7f6e\u4e2dcpu\u7279\u6027\u96c6\u6709invtsc\u7279\u6027\u65f6\uff0c\u5728domain\u8fd0\u884c\u65f6\u6267\u884c\u7cfb\u7edf\u68c0\u67e5\u70b9\u5feb\u7167\u4f1a\u62a5\u9519\uff0c\u89e3\u51b3\u529e\u6cd5\uff0c\u53bb\u6389invtsc\u7279\u6027\u6216\u5c06cpu model\u6539\u4e3acustom\u3002
\n\u5f53\u6267\u884c\u7cfb\u7edf\u7ea7\u5feb\u7167\u65f6\uff08\u5f00\u673a\u72b6\u6001\u4e0b\uff09\uff0c\u5982\u679c\u914d\u7f6e\u6587\u4ef6\u6807\u7b7e\u5236\u5b9asnapshot=internal\u5219\u786c\u76d8\u5feb\u7167\u9ed8\u8ba4\u4e5f\u4f1a\u4f7f\u7528internal\u65b9\u5f0f\u6267\u884c\uff0c\u53cd\u4e4b\u5982\u679c\u6807\u7b7e\u5236\u5b9a\u4e3aexternal\u5219\u786c\u76d8\u9ed8\u8ba4\u4e5f\u4f1a\u4f7f\u7528external\u65b9\u5f0f\u6267\u884c\u3002\u8fd9\u662f\u56e0\u4e3aqemu\u5feb\u7167\u673a\u5236\u76ee\u524d\u4e0d\u652f\u6301\u5185\u5916\u90e8\u5feb\u7167\u6df7\u5408\u6a21\u5f0f\uff0clibvirt\u5185\u90e8\u673a\u5236\u4f1a\u81ea\u52a8\u628a\u786c\u76d8\u5feb\u7167\u65b9\u5f0f\u8c03\u6574\u4e3a\u4e0e\u5185\u5b58\u76f8\u540c\u65b9\u5f0f\u3002
\n\u4f7f\u7528\u5916\u90e8\u5feb\u7167\u8981\u6ce8\u610f\uff0c\u6267\u884c\u5916\u90e8\u5feb\u7167\u6587\u4ef6\u662f\u6307\u5411\u539f\u786c\u76d8\u5feb\u7167\uff08base \u76d8\uff09\u7684\u4ece\u955c\u50cf\uff0c\u6267\u884c\u5b8c\u5916\u90e8\u5feb\u7167\u540e\uff0clibvirt\u4f1a\u5c06domain\u914d\u7f6e\u6587\u4ef6\u4e2d\u7684\u786c\u76d8\u955c\u50cf\u6539\u4e3a\u65b0\u521b\u5efa\u7684\u5916\u90e8\u5feb\u7167\u6587\u4ef6\uff0c\u8fd9\u6837\u6b64\u6587\u4ef6\u53ef\u4ee5\u7528\u6765\u5b58\u50a8\u6267\u884c\u5feb\u7167\u540e\u6240\u6709\u5dee\u5f02\u5316\u5185\u5bb9\uff0c\u6240\u4ee5\uff0clibvirt\u4e0d\u5141\u8bb8\u76f4\u63a5\u5220\u9664\u5916\u90e8\u5feb\u7167\u3002 \u5916\u90e8\u5feb\u7167\u4f1a\u4e0e\u4e4b\u524d\u521b\u5efa\u7684\u5916\u90e8\u5feb\u7167\u5f62\u6210\u4e00\u4e2a\u5dee\u5f02\u5b58\u50a8\u94fe\uff0c\u5185\u90e8\u5feb\u7167\u4e0d\u4f1a\u4e0e\u5916\u90e8\u5feb\u7167\u5f62\u6210\u4e00\u4e2a\u5dee\u5f02\u5b58\u50a8\u8fde\u3002\u521b\u5efa\u5feb\u7167\u4e4b\u540e\uff0c\u5feb\u7167\u914d\u7f6e\u6587\u4ef6\u4f1a\u5305\u542b\u865a\u673a\u914d\u7f6e\u6587\u4ef6\u7684\u5168\u90e8\u5185\u5bb9\u7528\u4e8e\u8fd8\u539f\u3002<\/p>\n
\u5916\u90e8\u5feb\u7167 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u5185\u90e8\u5feb\u7167<\/p>\n
win7------------------------->win7_snap-------------------->win7_snap2(\u5305\u542b\u5728win7_snap\u6587\u4ef6\u5185\u90e8)<\/p>\n
vm \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u5916\u90e8 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0vm<\/p>\n
\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0|--------------------->win7_snap3 <\/span><\/p>\n\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0vm <\/span><\/p>\nwin7\u662fwin7_snap\u7684backingstore\uff0cwin7_snap2\u5feb\u7167\u5b58\u5728\u4e8ewin7_snap\u6587\u4ef6\u4e2d\uff0cwin7_snap\u662fwin7_snap3\u7684backingstore\uff0c\u5185\u5b58\u5916\u90e8\u5feb\u7167\u53ef\u91cd\u590d\u8986\u76d6\u3002 * \u5728\u5173\u673a\u72b6\u6001\u4e0b\uff0c\u6267\u884c\u4efb\u4f55\u5feb\u7167\uff0c\u4e0d\u80fd\u5305\u542b\u6709\u5185\u5b58\u72b6\u6001\uff0c\u9700\u8981\u628a\u5185\u5b58snapshot\u8bbe\u7f6e\u4e3ano\uff0c\u56e0\u4e3a\u5173\u673a\u72b6\u6001\u4e0b\u6ca1\u6709\u5185\u5b58\u8fd0\u884c\u72b6\u6001\uff0c\u5185\u5b58\u90fd\u6e05\u7a7a\u4e86\u3002 *\u521b\u5efa\u7cfb\u7edf\u68c0\u67e5\u70b9\u65f6\uff0c\u5728\u5173\u673a\u72b6\u6001\u4e0b\uff0c\u9ed8\u8ba4\u521b\u5efa\u5185\u90e8\u5feb\u7167\uff0c\u800c\u4e14\u5fc5\u987b\u4f7f\u7528\u5185\u90e8\u5feb\u7167\uff0c\u521b\u5efa\u5916\u90e8\u5feb\u7167\u4f1a\u62a5\u9519\uff0c\u4f46\u662f\u4f7f\u7528disk-only\u6a21\u5f0f\u5feb\u7167\uff0c\u5219\u5728\u5173\u673a\u72b6\u6001\u4e0b\u5141\u8bb8\u521b\u5efa\u5916\u90e8\u5feb\u7167\u540c\u65f6\u4e5f\u5141\u8bb8\u521b\u5efa\u5185\u90e8\u5feb\u7167\u3002\u5916\u90e8\u5feb\u7167\u58f0\u79f0\u7684\u9ed8\u8ba4\u6587\u4ef6\u540d\u79f0\u4e3a\u539f\u59cb\u786c\u76d8\u955c\u50cf.\u5feb\u7167\u540d\u79f0 * \u4f7f\u7528disk-only\u65b9\u5f0f\u9488\u5bf9\u6b63\u5728\u8fd0\u884c\u7684\u865a\u673a\u521b\u5efa\u5feb\u7167\uff0c\u5fc5\u987b\u4f7f\u7528external\u65b9\u5f0f\uff0c\u5e76\u4e14\u6807\u7b7e\u7684snapshot\u5fc5\u987b\u4e3ano\uff0c\u4f7f\u7528\u5185\u90e8\u5feb\u7167\u4f1a\u62a5\u9519\uff0c\u5185\u90e8\u5feb\u7167\u548c\u7cfb\u7edf\u68c0\u67e5\u70b9\u5feb\u7167\u8981\u6c42\u6240\u6709\u786c\u76d8\u90fd\u5fc5\u987b\u53c2\u4e0e\u6267\u884c\u5feb\u7167\uff0c\u4f7f\u7528disk-only\u548cexternal\u65b9\u5f0f\u5e76\u7528\u6267\u884c\u5feb\u7167\u624d\u80fd\u9488\u5bf9\u4e0d\u540c\u786c\u76d8\u5355\u72ec\u6267\u884c\u5feb\u7167\u7b56\u7565\u3002 * \u4f7f\u7528\u7cfb\u7edf\u68c0\u67e5\u70b9\u5feb\u7167\u65b9\u5f0f\u5bf9\u5904\u4e8eactive\u72b6\u6001\u7684\u865a\u673a\u6267\u884c\u5feb\u7167\uff0c\u5feb\u7167\u751f\u6210\u7684\u662f\u5185\u90e8\u8fd8\u662f\u5916\u90e8\u53d6\u51b3\u4e8ememory\u6807\u7b7e\u7684snapshot\u503c\u3002 * \u4f7f\u7528diskonly\u6a21\u5f0f\u6216\u5173\u673a\u72b6\u6001\u4e0b\u521b\u5efa\u5feb\u7167\uff0c\u6807\u7b7esnapshot\u5fc5\u987b\u4e3ano\uff0c\u56e0\u4e3a\u4ee5\u4e0a\u4e24\u79cd\u5feb\u7167\u90fd\u65e0\u6cd5\u4fdd\u5b58\u5185\u5b58\u72b6\u6001\u3002<\/span><\/p>\n\u5404\u79cd\u5feb\u7167\u6a21\u5f0f\u53ca\u865a\u673a\u72b6\u6001\u7684\u5339\u914d\u60c5\u51b5\uff1a<\/strong><\/div>\n1.\u865a\u673a\u5173\u673a\u72b6\u6001\uff0cdiskonly\u6a21\u5f0f\uff1amemory=no(\u5fc5\u987b)\uff0cdisk\u53ef\u4ee5\u4f7f\u7528\u5185\u90e8\u6216\u5916\u90e8\u5feb\u7167\uff0c\u5e76\u4e14\u5916\u90e8\u5feb\u7167\u53ef\u4ee5\u5bf9\u6bcf\u4e2a\u76d8\u5206\u522b\u5b9a\u5236\u521b\u5efa\u7b56\u7565\uff0c\u9ed8\u8ba4\u521b\u5efaexternal\u5feb\u7167\u3002\r\n\r\n2.\u865a\u673a\u8fd0\u884c\u72b6\u6001\uff0cdiskonly\u6a21\u5f0f\uff1amemory=no(\u5fc5\u987b)\uff0cdisk\u5feb\u7167\u53ea\u80fd\u4f7f\u7528external\u6a21\u5f0f\u521b\u5efa\uff0c\u4e0d\u652f\u6301\u521b\u5efa\u5185\u90e8\u5feb\u7167\u3002\r\n\r\n3.\u7cfb\u7edf\u68c0\u67e5\u70b9\uff0c\u865a\u673a\u5173\u95ed\u72b6\u6001\uff1amemory=no(\u5fc5\u987b)\uff0cdisk\u5feb\u7167\u53ea\u80fd\u4f7f\u7528\u5185\u90e8\u5feb\u7167\uff0c\u800c\u4e14\u662f\u771f\u5bf9\u6240\u6709\u786c\u76d8\uff0c\u65e0\u6cd5\u9488\u5bf9\u6bcf\u4e2a\u76d8\u5b9a\u5236\u5feb\u7167\u521b\u5efa\u7b56\u7565\u3002\r\n\r\n4.\u7cfb\u7edf\u68c0\u67e5\u70b9\uff0c\u865a\u673a\u8fd0\u884c\u72b6\u6001\uff1amemory=internal\u6216external\uff0cdisk\u5feb\u7167\u7684\u521b\u5efa\u6a21\u5f0f\u6839\u636e\u5185\u5b58\u5feb\u7167\u521b\u5efa\u65b9\u5f0f\u800c\u5b9a\uff0c\u4e0d\u7ba1\u5185\u90e8\u8fd8\u662f\u5916\u90e8\u5feb\u7167\u90fd\u53ea\u80fd\u5bf9\u6240\u6709\u786c\u76d8\u521b\u5efa\u5feb\u7167\uff0c\u4e0d\u652f\u6301\u5bf9\u6bcf\u4e2a\u786c\u76d8\u5b9a\u5236\u521b\u5efa\u7b56\u7565\u3002\r\n\r\n\u4e3a\u4ec0\u4e48\u5feb\u7167\u673a\u5236\u8fd9\u4e48\u6df7\u4e71\uff0c\u56e0\u4e3alibvirt\u548cqemu\u5bf9\u5feb\u7167\u673a\u5236\u6301\u6709\u4e0d\u540c\u89c2\u70b9\uff0c\u4f46\u662f\u90a3\u79cd\u89c2\u70b9\u66f4\u597d\uff0c\u8fd9\u662f\u89c1\u4ec1\u89c1\u667a\u7684\uff0c\u6211\u4eec\u53ef\u4ee5\u6839\u636e\u60c5\u51b5\u9009\u62e9\u4f7f\u7528\u3002\r\n\r\nps\uff1a\u5185\u90e8\u5feb\u7167\u4f18\u70b9\uff1a\u4e0d\u5355\u72ec\u58f0\u79f0\u989d\u5916\u6587\u4ef6\uff0c\u6ca1\u6709\u5b58\u50a8\u8fde\uff08\u5176\u5b9e\u662f\u5185\u90e8\u5143\u6570\u636e\uff0c\u673a\u5236\u7c7b\u4f3c\uff09\uff0c\u964d\u4f4e\u4e86\u6587\u4ef6\u7ba1\u7406\u590d\u6742\u5ea6\uff0clibvirt\u5bf9\u5185\u90e8\u5feb\u7167\u6709\u826f\u597d\u652f\u6301\u3002\r\n\r\nps\uff1a\u5185\u90e8\u5feb\u7167\u7f3a\u70b9\uff1a\u521b\u5efa\u901f\u5ea6\u8f83\u6162\uff0cqemu\u4e0a\u6e38\u8f83\u5c11\u7ef4\u62a4\uff0c\u5fc5\u987b\u4f7f\u7528qcow2\u4e4b\u7c7b\u652f\u6301\u7ea7\u8054\u5feb\u7167\u529f\u80fd\u7684\u6587\u4ef6\u683c\u5f0f\u3002\u8fd0\u884c\u65f6\u521b\u5efa\u5feb\u7167\u865a\u673a\u6709\u660e\u663e\u505c\u987f\u611f\u3002\r\n\r\nps\uff1a\u5916\u90e8\u5feb\u7167\u4f18\u70b9\uff1a\u521b\u5efa\u901f\u5ea6\u8f83\u5feb\uff0c\u652f\u6301\u5404\u79cd\u6e90\u6587\u4ef6\u683c\u5f0f\uff08\u540e\u7eed\u5feb\u7167\u9700\u4f7f\u7528qcow2\u4e4b\u7c7b\uff09\uff0c\u5728\u8fd0\u884c\u65f6\u521b\u5efa\u5ba2\u6237\u673a\u51e0\u4e4e\u6ca1\u6709\u505c\u987f\u65f6\u95f4\uff0c\u4e0a\u6e38qemu\u5728\u5916\u90e8\u5feb\u7167\u5f00\u53d1\u65b9\u9762\u8f83\u79ef\u6781\r\n\r\nps\uff1a\u5916\u90e8\u5feb\u7167\u7f3a\u70b9\uff1a\u5feb\u7167\u591a\u4e86\u540e\u4f1a\u5f62\u6210\u5927\u91cf\u5b58\u50a8\u6587\u4ef6\u53ca\u5b58\u50a8\u8fde\uff0c\u6bcf\u4e00\u5c42\u7ea7\u90fd\u4f7f\u7528cow\u65b9\u5f0f\u8bfb\u5199\uff0c\u4e25\u91cd\u5f71\u54cd\u6027\u80fd\uff0c\u6587\u4ef6\u7ba1\u7406\u590d\u6742\uff0clibvirt\u5bf9\u5916\u90e8\u5feb\u7167\u652f\u6301\u4e0d\u592a\u79ef\u6781\u3002<\/pre>\n\u95ee\u7b54<\/strong><\/div>\n\u5185\u5b58\u5feb\u7167\uff0c\u4e92\u65a5\u7279\u6027\u5f88\u591a\uff0c\u600e\u4e48\u5728\u5404\u9636\u6bb5\u8fdb\u884c\u7279\u6027\u95f4\u7684\u4e92\u65a5\uff1f\u5feb\u7167\u5931\u8d25\u4f1a\u56de\u9000\u5417\uff1f\u5185\u5b58\u590d\u7528\u573a\u666f\u53ef\u4ee5\u505a\u5feb\u7167\u5417\uff1f\u5927\u89c4\u683c\u5185\u5b58\u5feb\u7167\u65f6\u95f4\u89c4\u683c\u5927\u7ea6\u591a\u4e45\uff1f<\/strong><\/span><\/div>\n\u7b54\uff1a\u5feb\u7167\u5efa\u8bae\u6839\u636e\u6211\u5217\u51fa\u7684\u7279\u6027\u8fdb\u884c\u9009\u62e9\uff0c\u4e0d\u5efa\u8bae\u628a\u5feb\u7167\u529f\u80fd\u505a\u5f97\u592a\u591a\u592a\u590d\u6742\uff0c\u5feb\u7167\u591a\u4e86\u4f1a\u5f71\u54cd\u6027\u80fd\uff0c\u5982\u679c\u5fc5\u987b\u8981\u505a\u5916\u90e8\u5feb\u7167\uff0c\u56e0\u4e3a\u6587\u4ef6\u4f7f\u7528backingstore\u65b9\u5f0f\u5b58\u50a8\uff0c\u6700\u597d\u5bf9\u4e0d\u7528\u7684\u5feb\u7167\u8fdb\u884ccommit,\u5185\u5b58\u590d\u7528\u53ef\u4ee5\u505a\u5feb\u7167\uff0c\u5927\u89c4\u683c\u5185\u5b58\u505a\u5feb\u7167\u9700\u8981\u5b9a\u5236\u6e90\u7801\u505a\u4f18\u5316\uff0c\u5176\u5b9ekvm\u865a\u62df\u5316\u53ea\u662f\u7ed9\u6211\u4eec\u4e00\u4e2a\u57fa\u672c\u529f\u80fd\uff0c\u5f88\u591a\u529f\u80fd\u5982\u679c\u8981\u6ee1\u8db3\u5ba2\u6237\u9700\u6c42\u9700\u8981\u5bf9qemu\u548ckvm\u6e90\u7801\u8fdb\u884c\u5b9a\u5236\u5f00\u53d1\u3002<\/p>\n
SPICE\u6709\u63a2\u6d4b\u8bc6\u522bUSB\u8bbe\u5907\u7684\u529f\u80fd\u5417\uff1f\u5c31\u662f\u5728\u5bbf\u4e3b\u673a\u7684USB\u63a5\u53e3\u4e0a\u63d2\u4e0aUSB\u8bbe\u5907\u4e4b\u540e\uff0cKVM\u865a\u62df\u673a\u80fd\u591f\u63a2\u6d4b\u5230\u5417\uff1f<\/strong><\/span><\/div>\n\u7b54\uff1aspice\u7684usb\u8bbe\u5907\u8bc6\u522b\u6307\u7684\u662f\u5c06\u7ec8\u7aef\u673a\u4e0a\u8fde\u63a5\u7684\u8bbe\u5907\u8bc6\u522b\u4e3a\u865a\u673a\u4e0a\u8bbe\u5907\u7684\u529f\u80fd\uff0c\u8fd9\u662f\u6709spice\u7684\u4e00\u4e2a\u5b50\u529f\u80fdusb redirect\u5b9e\u73b0\uff0c\u81f3\u4e8e\u5bbf\u4e3b\u673a\u5916\u8bbe\uff0c\u8fd9\u662f\u5bf9qemu\u914d\u7f6e\u7684\u95ee\u9898\u3002<\/p>\n
\n\u539f\u6587\u6765\u81ea\uff1a\u5fae\u4fe1-KVM\u5b9e\u6218<\/a><\/p>\n\u672c\u6587\u5730\u5740\uff1ahttp:\/\/lrxjmw.cn\/kvmlibvirt-tittle-tattle.html<\/a>\u7f16\u8f91\uff1a\u9676\u6b66\u6770\uff0c\u5ba1\u6838\u5458\uff1a\u9004\u589e\u5b9d<\/span><\/p>\n<\/blockquote>\n","protected":false},"excerpt":{"rendered":"\u5bfc\u8bfb \u5927\u5bb6\u597d\uff0c\u672c\u6b21\u8096\u529b\u5206\u4eab\u7684\u4e3b\u9898\u662fKVM&Libvirt\u57fa\u672c\u6982\u5ff5\u53ca\u5f00\u53d1\u6742\u8c08\uff0c\u5185\u5bb9\u6709\u4e9b\u51cc\u4e71\u677e\u6563\uff0c\u4e3b\u8981\u57fa\u4e8e […]<\/p>\n","protected":false},"author":63,"featured_media":10461,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[55],"tags":[],"class_list":["post-10455","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-thread"],"acf":[],"_links":{"self":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/10455","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/users\/63"}],"replies":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/comments?post=10455"}],"version-history":[{"count":21,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/10455\/revisions"}],"predecessor-version":[{"id":250893,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/10455\/revisions\/250893"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media\/10461"}],"wp:attachment":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media?parent=10455"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/categories?post=10455"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/tags?post=10455"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}