TWI790615B - Device pass-through method for virtual machine and server using the same - Google Patents

Device pass-through method for virtual machine and server using the same Download PDF

Info

Publication number
TWI790615B
TWI790615B TW110117542A TW110117542A TWI790615B TW I790615 B TWI790615 B TW I790615B TW 110117542 A TW110117542 A TW 110117542A TW 110117542 A TW110117542 A TW 110117542A TW I790615 B TWI790615 B TW I790615B
Authority
TW
Taiwan
Prior art keywords
packet
operating system
virtual machine
hardware device
socket node
Prior art date
Application number
TW110117542A
Other languages
Chinese (zh)
Other versions
TW202244731A (en
Inventor
陳冠儒
Original Assignee
宏碁股份有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 宏碁股份有限公司 filed Critical 宏碁股份有限公司
Priority to TW110117542A priority Critical patent/TWI790615B/en
Priority to US17/724,484 priority patent/US20220365805A1/en
Publication of TW202244731A publication Critical patent/TW202244731A/en
Application granted granted Critical
Publication of TWI790615B publication Critical patent/TWI790615B/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45545Guest-host, i.e. hypervisor is an application program itself, e.g. VirtualBox
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/4401Bootstrapping
    • G06F9/4411Configuring for operating with peripheral devices; Loading of device drivers
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • G06F2009/45579I/O management, e.g. providing access to device drivers or storage

Abstract

A device pass-through method for a virtual machine (VM) and a server using the same method are provided. The method includes: establishing a host operating system (OS) kernel including a device driver and a socket node corresponding to a hardware device and a VM including a guest OS and a guest kernel, wherein the guest OS includes an application and an analyzer; receiving an I/O request command from the application and transmitting an I/O request packet corresponding to the O request command to the analyzer by the guest kernel; transmitting, by the analyzer, an access packet corresponding to the I/O request command to the socket node corresponding to a virtual function (VF) name according to the VF name in the I/O request packet; accessing, by the socket node, the device driver according to the access packet to drive the hardware device.

Description

虛擬機的裝置直通方法及其伺服器Device direct connection method of virtual machine and server thereof

本發明是有關於一種虛擬機的裝置直通方法及其伺服器。The invention relates to a device-through method of a virtual machine and a server thereof.

運算裝置可通過虛擬機(virtual machine,VM)技術來模擬電腦系統。虛擬機可通過裝置直通(device pass-through)技術存取硬體裝置以通過主機(host)操作系統(operating system,OS)核心(kernel)控制硬體裝置。目前,虛擬機可通過多種方式來執行裝置直通。舉例來說,由獨立硬體製造商(independent hardware vendor,IHV)開發的VirtIO裝置可被安裝於虛擬機的客戶端核心(guest kernel)中。當虛擬機的客戶端操作系統欲將存取指令傳送給主機操作系統時,客戶端操作系統(guest OS)可通過VirtIO裝置傳送存取指令給主機操作系統以通過主機操作系統存取硬體裝置。此外,虛擬機可使用單一輸入輸出虛擬化(single root I/O virtualization,SR-IOV)技術以通過虛擬功能(virtual function,VF)存取硬體裝置。再者,虛擬機也可以使用veth技術以在虛擬機與主機操作系統之間建立通道,並通過通道傳送存取指令給主機操作系統。然而,採用上述的方法的使用者都需委請獨立硬體製造商或獨立軟體製造商(independent software vendor,ISV)進行軟體開發,故使用者都需支付一筆費用。The computing device can simulate a computer system through a virtual machine (virtual machine, VM) technology. The virtual machine can access the hardware device through a device pass-through technology to control the hardware device through a host (host) operating system (OS) kernel. Currently, virtual machines can perform device passthrough in various ways. For example, a VirtIO device developed by an independent hardware vendor (IHV) can be installed in a guest kernel of a virtual machine. When the guest operating system of the virtual machine wants to send access instructions to the host operating system, the guest operating system (guest OS) can send access instructions to the host operating system through the VirtIO device to access the hardware device through the host operating system . In addition, the virtual machine can use single root I/O virtualization (SR-IOV) technology to access the hardware device through a virtual function (virtual function, VF). Furthermore, the virtual machine can also use the veth technology to establish a channel between the virtual machine and the host operating system, and transmit access instructions to the host operating system through the channel. However, users who adopt the above methods need to entrust independent hardware manufacturers or independent software vendors (ISVs) to develop software, so users need to pay a fee.

另一方面,主機操作系統核心也可使用軟體(例如:QEMU或CrosVM)產生虛擬裝置(virtual device)以供虛擬機存取。然而,上述的方法會顯著地降低運算裝置的效能。On the other hand, the host operating system kernel can also use software (for example: QEMU or CrosVM) to generate a virtual device (virtual device) for the virtual machine to access. However, the above method will significantly reduce the performance of the computing device.

本發明提供一種虛擬機的裝置直通方法及其伺服器,可優化虛擬機的效能。The invention provides a device direct connection method of a virtual machine and a server thereof, which can optimize the performance of the virtual machine.

本發明的一種虛擬機的伺服器,包含處理器、儲存媒體以及收發器。儲存媒體儲存多個模組。處理器耦接儲存媒體以及收發器,並且存取和執行多個模組,其中多個模組包含主機操作系統核心以及虛擬機。主機操作系統核心通過收發器通訊連接至硬體裝置,並且包含對應於硬體裝置的裝置驅動程式以及插座節點。虛擬機包含客戶端操作系統以及客戶端核心,其中客戶端操作系統包含應用程式以及分析器,其中客戶端核心自應用程式接收輸入輸出請求指令,並且傳送對應於輸入輸出請求指令的輸入輸出請求封包至分析器,其中分析器根據輸入輸出請求封包中的虛擬功能名稱將對應於輸入輸出請求指令的存取封包傳送至對應於虛擬功能名稱的插座節點,其中插座節點根據存取封包存取裝置驅動程式以驅動硬體裝置。A virtual machine server of the present invention includes a processor, a storage medium and a transceiver. The storage medium stores multiple modules. The processor is coupled to the storage medium and the transceiver, and accesses and executes multiple modules, wherein the multiple modules include a host operating system kernel and a virtual machine. The host operating system core is communicatively connected to the hardware device through the transceiver, and includes a device driver corresponding to the hardware device and a socket node. The virtual machine includes a client operating system and a client core, wherein the client operating system includes an application program and an analyzer, wherein the client core receives an I/O request command from the application program, and transmits an I/O request packet corresponding to the I/O request command To the analyzer, wherein the analyzer transmits the access packet corresponding to the I/O request command to the socket node corresponding to the virtual function name according to the virtual function name in the I/O request packet, wherein the socket node accesses the device driver according to the access packet program to drive the hardware device.

在本發明的一實施例中,上述的客戶端核心包含VirtIO裝置,其中輸入輸出請求封包包含虛擬功能名稱和硬體識別碼的其中之一,其中分析器響應於輸入輸出請求封包包含硬體識別碼而通過對應於硬體識別碼的VirtIO裝置傳送存取封包至主機操作系統核心,其中主機操作系統核心根據存取封包存取裝置驅動程式以驅動硬體裝置。In an embodiment of the present invention, the above-mentioned client core includes a VirtIO device, wherein the I/O request packet includes one of a virtual function name and a hardware identification code, and wherein the analyzer responds to the I/O request packet including a hardware identification code and transmits the access packet to the host operating system core through the VirtIO device corresponding to the hardware identification code, wherein the host operating system core accesses the device driver according to the access packet to drive the hardware device.

在本發明的一實施例中,上述的主機操作系統核心響應於插座節點接收存取封包而將對應於插座節點的計數值加一,其中主機操作系統核心通過收發器輸出計數值。In an embodiment of the present invention, the above-mentioned host operating system core increases the count value corresponding to the socket node by one in response to the socket node receiving the access packet, wherein the host operating system core outputs the count value through the transceiver.

在本發明的一實施例中,上述的分析器根據輸入輸出請求封包產生存取封包,其中存取封包包含存取指令以及對應於插座節點的插座節點名稱。In an embodiment of the present invention, the above analyzer generates an access packet according to the I/O request packet, wherein the access packet includes an access instruction and a socket node name corresponding to the socket node.

在本發明的一實施例中,上述的存取封包更包含對應於虛擬機的虛擬機位址,其中插座節點響應於驅動硬體裝置而根據虛擬機位址傳送硬體裝置的輸出至虛擬機。In an embodiment of the present invention, the above-mentioned access packet further includes a virtual machine address corresponding to the virtual machine, wherein the socket node transmits the output of the hardware device to the virtual machine according to the address of the virtual machine in response to driving the hardware device .

在本發明的一實施例中,上述的存取封包包含對應於VirtIO裝置的VirtIO裝置位址,其中主機操作系統核心響應於驅動硬體裝置而根據VirtIO裝置位址傳送硬體裝置的輸出至VirtIO裝置。In an embodiment of the present invention, the above-mentioned access packet includes a VirtIO device address corresponding to the VirtIO device, wherein the host operating system kernel transmits the output of the hardware device to the VirtIO according to the VirtIO device address in response to driving the hardware device device.

在本發明的一實施例中,上述的主機操作系統核心通過收發器偵測硬體裝置,並且響應於偵測硬體裝置而建立裝置驅動程式以及插座節點。In an embodiment of the present invention, the above-mentioned host operating system kernel detects a hardware device through a transceiver, and creates a device driver and a socket node in response to the detected hardware device.

在本發明的一實施例中,上述的主機操作系統核心響應於偵測硬體裝置而傳送配置封包至分析器,其中配置封包包含對應於硬體裝置的硬體識別碼、對應於插座節點的插座節點位址以及對應於插座節點的插座節點名稱。In an embodiment of the present invention, the above-mentioned host operating system kernel sends a configuration packet to the analyzer in response to detecting the hardware device, wherein the configuration packet includes a hardware identification code corresponding to the hardware device, a socket node corresponding to A socket node address and a socket node name corresponding to the socket node.

在本發明的一實施例中,上述的分析器根據配置封包產生虛擬功能名稱以及插座節點名稱的映射表。In an embodiment of the present invention, the above analyzer generates a mapping table of virtual function names and socket node names according to the configuration packet.

在本發明的一實施例中,上述的分析器根據映射表而將存取封包傳送至對應於虛擬功能名稱的插座節點。In an embodiment of the present invention, the above analyzer transmits the access packet to the socket node corresponding to the virtual function name according to the mapping table.

在本發明的一實施例中,上述的分析器與插座節點通過虛擬機插座(vsock)協定與彼此進行通訊。In an embodiment of the present invention, the above analyzer and the socket node communicate with each other through a virtual machine socket (vsock) protocol.

本發明的一種虛擬機的裝置直通方法,包含:建立主機操作系統核心以及虛擬機,其中主機操作系統核心包含對應於硬體裝置的裝置驅動程式以及插座節點,其中虛擬機包含客戶端操作系統以及客戶端核心,其中客戶端操作系統包含應用程式以及分析器;由客戶端核心自應用程式接收輸入輸出請求指令,並且傳送對應於輸入輸出請求指令的輸入輸出請求封包至分析器;由分析器根據輸入輸出請求封包中的虛擬功能名稱將對應於輸入輸出請求指令的存取封包傳送至對應於虛擬功能名稱的插座節點;以及由插座節點根據存取封包存取裝置驅動程式以驅動硬體裝置。A device-through method for a virtual machine of the present invention includes: establishing a host operating system core and a virtual machine, wherein the host operating system core includes a device driver corresponding to a hardware device and a socket node, wherein the virtual machine includes a client operating system and a virtual machine. The client core, wherein the client operating system includes an application program and an analyzer; the client core receives the I/O request command from the application program, and sends an I/O request packet corresponding to the I/O request command to the analyzer; the analyzer according to The virtual function name in the I/O request packet transmits the access packet corresponding to the I/O request command to the socket node corresponding to the virtual function name; and the socket node accesses the device driver according to the access packet to drive the hardware device.

基於上述,本發明的虛擬機可通過與硬體裝置專屬的插座節點通訊以存取硬體裝置。相較於傳統的虛擬機通過虛擬裝置存取硬體裝置,通過插座節點存取硬體裝置可避免二進位翻譯(binary translation)程序的發生,從而減少運算資源的浪費。Based on the above, the virtual machine of the present invention can access the hardware device by communicating with the socket node dedicated to the hardware device. Compared with the traditional virtual machine accessing the hardware device through the virtual device, accessing the hardware device through the socket node can avoid the binary translation (binary translation) program, thereby reducing the waste of computing resources.

為了使本發明之內容可以被更容易明瞭,以下特舉實施例作為本發明確實能夠據以實施的範例。另外,凡可能之處,在圖式及實施方式中使用相同標號的元件/構件/步驟,係代表相同或類似部件。In order to make the content of the present invention more comprehensible, the following specific embodiments are taken as examples in which the present invention can actually be implemented. In addition, wherever possible, elements/components/steps using the same reference numerals in the drawings and embodiments represent the same or similar parts.

圖1根據本發明的一實施例繪示一種虛擬機的伺服器100的示意圖。伺服器100可包含處理器110、儲存媒體120以及收發器130。FIG. 1 shows a schematic diagram of a virtual machine server 100 according to an embodiment of the present invention. The server 100 may include a processor 110 , a storage medium 120 and a transceiver 130 .

處理器110例如是中央處理單元(central processing unit,CPU),或是其他可程式化之一般用途或特殊用途的微控制單元(micro control unit,MCU)、微處理器(microprocessor)、數位信號處理器(digital signal processor,DSP)、可程式化控制器、特殊應用積體電路(application specific integrated circuit,ASIC)、圖形處理器(graphics processing unit,GPU)、影像訊號處理器(image signal processor,ISP)、影像處理單元(image processing unit,IPU)、算數邏輯單元(arithmetic logic unit,ALU)、複雜可程式邏輯裝置(complex programmable logic device,CPLD)、現場可程式化邏輯閘陣列(field programmable gate array,FPGA)或其他類似元件或上述元件的組合。處理器110可耦接至儲存媒體120以及收發器130,並且存取和執行儲存於儲存媒體120中的多個模組和各種應用程式。The processor 110 is, for example, a central processing unit (central processing unit, CPU), or other programmable general purpose or special purpose micro control unit (micro control unit, MCU), microprocessor (microprocessor), digital signal processing Digital signal processor (DSP), programmable controller, application specific integrated circuit (ASIC), graphics processing unit (graphics processing unit, GPU), image signal processor (image signal processor, ISP) ), image processing unit (image processing unit, IPU), arithmetic logic unit (arithmetic logic unit, ALU), complex programmable logic device (complex programmable logic device, CPLD), field programmable logic gate array (field programmable gate array , FPGA) or other similar components or combinations of the above components. The processor 110 can be coupled to the storage medium 120 and the transceiver 130 , and access and execute multiple modules and various application programs stored in the storage medium 120 .

儲存媒體120例如是任何型態的固定式或可移動式的隨機存取記憶體(random access memory,RAM)、唯讀記憶體(read-only memory,ROM)、快閃記憶體(flash memory)、硬碟(hard disk drive,HDD)、固態硬碟(solid state drive,SSD)或類似元件或上述元件的組合,而用於儲存可由處理器110執行的多個模組或各種應用程式。The storage medium 120 is, for example, any type of fixed or removable random access memory (random access memory, RAM), read-only memory (read-only memory, ROM), flash memory (flash memory) , hard disk drive (hard disk drive, HDD), solid state drive (solid state drive, SSD) or similar components or a combination of the above components, and are used to store multiple modules or various application programs executable by the processor 110 .

收發器130以無線或有線的方式傳送及接收訊號。收發器130還可以執行例如低噪聲放大、阻抗匹配、混頻、向上或向下頻率轉換、濾波、放大以及類似的操作。The transceiver 130 transmits and receives signals in a wireless or wired manner. The transceiver 130 may also perform operations such as low noise amplification, impedance matching, frequency mixing, up or down frequency conversion, filtering, amplification, and the like.

圖2根據本發明的一實施例繪示儲存媒體120中的多個模組的示意圖。儲存媒體120中的多個模組可包含主機操作系統核心200以及虛擬機300。主機操作系統核心200可通過收發器130通訊連接至硬體裝置400。虛擬機300可通過主機操作系統核心200存取硬體裝置400。雖然圖2的實施例通過單一裝置(即:伺服器100)實施主機操作系統核心200以及虛擬機300,但本發明不限於此。舉例來說,主機操作系統核心200以及虛擬機300可分別由彼此通訊連接的不同運算裝置實施。FIG. 2 shows a schematic diagram of multiple modules in the storage medium 120 according to an embodiment of the present invention. The multiple modules in the storage medium 120 may include a host operating system kernel 200 and a virtual machine 300 . The host operating system core 200 can be communicatively connected to the hardware device 400 through the transceiver 130 . The virtual machine 300 can access the hardware device 400 through the host operating system kernel 200 . Although the embodiment of FIG. 2 implements the host operating system kernel 200 and the virtual machine 300 through a single device (ie, the server 100 ), the present invention is not limited thereto. For example, the host operating system kernel 200 and the virtual machine 300 can be respectively implemented by different computing devices that are communicatively connected to each other.

主機操作系統核心200可包含對應於硬體裝置400的插座節點(socket node)210以及裝置驅動程式230。插座節點210可通過裝置驅動程式230存取硬體裝置400。虛擬機300例如是一種基於內核的虛擬機(kernel-based virtual machine,KVM)。虛擬機300可包含客戶端操作系統(guest OS)310以及客戶端核心(guest kernel)330。客戶端操作系統310可包含應用程式311以及分析器313,其中分析器313可包含對應於硬體裝置400的插座(socket)315。客戶端核心330可包含VirtIO裝置331。The host operating system kernel 200 may include a socket node 210 corresponding to the hardware device 400 and a device driver 230 . The socket node 210 can access the hardware device 400 through the device driver 230 . The virtual machine 300 is, for example, a kernel-based virtual machine (kernel-based virtual machine, KVM). The virtual machine 300 may include a guest operating system (guest OS) 310 and a guest kernel (guest kernel) 330 . The client operating system 310 may include an application program 311 and an analyzer 313 , wherein the analyzer 313 may include a socket 315 corresponding to the hardware device 400 . The client core 330 may include a VirtIO device 331 .

圖3根據本發明的一實施例繪示一種虛擬機的裝置直通方法的流程圖,其中所述裝置直通方法可由如圖1所示伺服器100實施。在本實施例中,假設應用程式311欲存取硬體裝置400,虛擬機300可根據裝置直通方法判斷通過virtIO裝置331或插座315以存取硬體裝置400。FIG. 3 shows a flowchart of a device-through method for a virtual machine according to an embodiment of the present invention, wherein the device-through method can be implemented by the server 100 shown in FIG. 1 . In this embodiment, assuming that the application program 311 wants to access the hardware device 400 , the virtual machine 300 can determine to access the hardware device 400 through the virtIO device 331 or the socket 315 according to the device direct method.

參照圖2和圖3,在步驟S301中,客戶端核心330可將輸入輸出(I/O)請求封包(即:IRP封包)S2傳送至分析器313,其中所述I/O請求封包S2對應於硬體裝置400。分析器313可自客戶端核心330取得I/O請求封包S2。具體來說,應用程式311可通過收發器130接收資料,並且根據接收的資料產生I/O請求指令(或稱為「I/O中斷指令」)S1,其中所述I/O請求指令S1可對應於硬體裝置400。應用程式311可傳送I/O請求指令S1至客戶端核心330,並且客戶端核心330可傳送對應於I/O請求指令S1的I/O請求封包S2至分析器313。I/O請求封包S2可包含虛擬功能名稱(VF name)或硬體識別碼(hardware ID,HW ID)。Referring to FIG. 2 and FIG. 3, in step S301, the client core 330 may transmit the input/output (I/O) request packet (ie: IRP packet) S2 to the analyzer 313, wherein the I/O request packet S2 corresponds to in the hardware device 400 . The analyzer 313 can obtain the I/O request packet S2 from the client core 330 . Specifically, the application program 311 can receive data through the transceiver 130, and generate an I/O request command (or called "I/O interrupt command") S1 according to the received data, wherein the I/O request command S1 can be Corresponds to the hardware device 400 . The application program 311 can send the I/O request command S1 to the client core 330 , and the client core 330 can send the I/O request packet S2 corresponding to the I/O request command S1 to the analyzer 313 . The I/O request packet S2 may include a virtual function name (VF name) or a hardware identification code (hardware ID, HW ID).

舉例來說,伺服器100可通過收發器130連接至外部輸入裝置(例如:鍵盤)。使用者可通過外部輸入裝置操作應用程式311以傳送I/O請求指令S1至客戶端核心330。舉另一例來說,伺服器100可通過收發器130連接至外部電子裝置(例如:終端裝置或伺服器)。應用程式311可通過收發器130以自外部電子裝置接收指令,並且根據所述指令傳送I/O請求指令S1至客戶端核心330。For example, the server 100 can be connected to an external input device (such as a keyboard) through the transceiver 130 . The user can operate the application program 311 through an external input device to send the I/O request command S1 to the client core 330 . For another example, the server 100 can be connected to an external electronic device (eg, a terminal device or a server) through the transceiver 130 . The application program 311 can receive commands from the external electronic device through the transceiver 130 , and transmit the I/O request command S1 to the client core 330 according to the commands.

在步驟S302中,分析器313可判斷I/O請求封包S2是否包含硬體識別碼。若I/O請求封包S2包含硬體識別碼,則進入步驟S303。若I/O請求封包S2不包含硬體識別碼,則進入步驟S308。In step S302, the analyzer 313 can determine whether the I/O request packet S2 contains a hardware identification code. If the I/O request packet S2 includes the hardware identification code, go to step S303. If the I/O request packet S2 does not include the hardware identification code, go to step S308.

I/O請求封包S2包含硬體識別碼代表客戶端核心330中存在硬體裝置400專屬的virtIO裝置331。因此,若客戶端核心330判斷I/O請求指令S1是用於存取硬體裝置400的,則客戶端核心330可將對應於硬體裝置400以及virtIO裝置331的硬體識別碼封裝於I/O請求封包S2中。客戶端核心330可通過I/O請求封包S2指示分析器313使用virtIO裝置331來存取硬體裝置400。另一方面,若客戶端核心330中不存在專屬於硬體裝置400的virtIO裝置(即:virtIO裝置331不屬於硬體裝置400),則客戶端核心330將無法指示分析器313使用virtIO裝置331來存取硬體裝置400。The I/O request packet S2 includes a hardware identification code indicating that the virtIO device 331 dedicated to the hardware device 400 exists in the client core 330 . Therefore, if the client core 330 judges that the I/O request command S1 is for accessing the hardware device 400, the client core 330 can encapsulate the hardware identification codes corresponding to the hardware device 400 and the virtIO device 331 in the I /O request packet S2. The client core 330 can instruct the analyzer 313 to use the virtIO device 331 to access the hardware device 400 through the I/O request packet S2. On the other hand, if there is no virtIO device dedicated to the hardware device 400 in the client core 330 (ie: the virtIO device 331 does not belong to the hardware device 400), the client core 330 will not be able to instruct the analyzer 313 to use the virtIO device 331 to access the hardware device 400 .

在步驟S303中,分析器313可根據過I/O請求封包S2產生對應於硬體裝置400的存取封包S3,其中存取封包S3可包含用於存取硬體裝置400的存取指令。在步驟S304中,分析器313可將存取封包S3傳送至對應於硬體識別碼的virtIO裝置331。In step S303 , the analyzer 313 can generate an access packet S3 corresponding to the hardware device 400 according to the I/O request packet S2 , wherein the access packet S3 can include an access command for accessing the hardware device 400 . In step S304, the analyzer 313 may transmit the access packet S3 to the virtIO device 331 corresponding to the hardware identification code.

在一實施例中,若虛擬機300欲在存取硬體裝置400後取得硬體裝置400的輸出,則存取封包S3可進一步包含virtIO裝置331的virtIO裝置位址33,其中virtIO裝置位址33為儲存媒體120的記憶體位址。據此,分析器313可通過存取封包S3指示主機操作系統核心200通過virtIO裝置位址33來回饋硬體裝置400的輸出給虛擬機300。In one embodiment, if the virtual machine 300 wants to obtain the output of the hardware device 400 after accessing the hardware device 400, the access packet S3 may further include the virtIO device address 33 of the virtIO device 331, wherein the virtIO device address 33 is the memory address of the storage medium 120 . Accordingly, the analyzer 313 can instruct the host operating system kernel 200 to feed back the output of the hardware device 400 to the virtual machine 300 through the virtIO device address 33 by accessing the packet S3 .

在步驟S305中,virtIO裝置331可傳送存取封包S3至主機操作系統核心200。主機操作系統核心200可根據存取封包S3來存取裝置驅動程式230以驅動硬體裝置400。具體來說,virtIO裝置331可將存取封包S3傳送至硬體裝置400的硬體裝置位址34,其中硬體裝置位址34為儲存媒體120的記憶體位址。裝置驅動程式230可自硬體裝置位址34取得存取封包S3,並且根據存取封包S3驅動硬體裝置400。In step S305 , the virtIO device 331 can send the access packet S3 to the host operating system kernel 200 . The host operating system core 200 can access the device driver 230 according to the access packet S3 to drive the hardware device 400 . Specifically, the virtIO device 331 can send the access packet S3 to the hardware device address 34 of the hardware device 400 , wherein the hardware device address 34 is the memory address of the storage medium 120 . The device driver 230 can obtain the access packet S3 from the hardware device address 34, and drive the hardware device 400 according to the access packet S3.

在步驟S306中,主機操作系統核心200可判斷存取封包S3是否包含virtIO裝置331的virtIO裝置位址33。若存取封包S3包含virtIO裝置位址33,則進入步驟S307。若存取封包S3不包含virtIO裝置位址33,則結束流程。In step S306 , the host operating system kernel 200 can determine whether the access packet S3 includes the virtIO device address 33 of the virtIO device 331 . If the access packet S3 includes the virtIO device address 33, go to step S307. If the access packet S3 does not include the virtIO device address 33, the process ends.

在步驟S307中,主機操作系統核心200可根據virtIO裝置331的virtIO裝置位址33傳送硬體裝置400的輸出S4至VirtIO裝置331。VirtIO裝置331可進一步將硬體裝置400的輸出S4傳送至應用程式311。In step S307 , the host operating system core 200 can transmit the output S4 of the hardware device 400 to the VirtIO device 331 according to the virtIO device address 33 of the virtIO device 331 . The VirtIO device 331 can further transmit the output S4 of the hardware device 400 to the application program 311 .

在步驟S308中,分析器313可根據過I/O請求封包S2產生對應於硬體裝置400的存取封包S5,其中存取封包S5可包含用於存取硬體裝置400的存取指令以及對應於插座節點210的插座節點名稱。In step S308, the analyzer 313 can generate an access packet S5 corresponding to the hardware device 400 according to the I/O request packet S2, wherein the access packet S5 can include an access command for accessing the hardware device 400 and Socket node name corresponding to socket node 210 .

在步驟S309中,分析器313可將存取封包S5傳送至對應於虛擬功能名稱的插座節點210,其中分析器313與插座節點210可通過虛擬機插座(VM socket,vsock)協定來與彼此進行通訊。因此,虛擬機300不須執行二進位翻譯也可將存取封包S5傳送給主機操作系統核心200。具體來說,分析器313可儲存虛擬功能名稱與插座節點名稱的映射表。在從I/O請求封包S2取得虛擬功能名稱後,分析器313可根據映射表判斷虛擬功能名稱與插座節點210的插座節點名稱相對應。據此,分析器313可通過插座315將存取封包S5傳送至插座節點210的插座節點位址32,其中插座節點位址32為儲存媒體120的記憶體位址。換句話說,分析器313可根據映射表傳送存取封包S5至對應於虛擬功能名稱的插座節點210。映射表的建立方法記載於圖4的實施例中。In step S309, the analyzer 313 can transmit the access packet S5 to the socket node 210 corresponding to the name of the virtual function, wherein the analyzer 313 and the socket node 210 can communicate with each other through the VM socket (vsock) protocol communication. Therefore, the virtual machine 300 can transmit the access packet S5 to the host operating system kernel 200 without performing binary translation. Specifically, the analyzer 313 may store a mapping table of virtual function names and socket node names. After obtaining the virtual function name from the I/O request packet S2 , the analyzer 313 can determine that the virtual function name corresponds to the socket node name of the socket node 210 according to the mapping table. Accordingly, the analyzer 313 can transmit the access packet S5 to the socket node address 32 of the socket node 210 through the socket 315 , wherein the socket node address 32 is the memory address of the storage medium 120 . In other words, the analyzer 313 can transmit the access packet S5 to the socket node 210 corresponding to the name of the virtual function according to the mapping table. The method for establishing the mapping table is described in the embodiment of FIG. 4 .

在一實施例中,若虛擬機300欲在存取硬體裝置400後取得硬體裝置400的輸出,則存取封包S5可進一步包含虛擬機300的虛擬機位址31,其中虛擬機位址31為儲存媒體120的記憶體位址。據此,分析器313可通過存取封包S5指示主機操作系統核心200通過虛擬機位址31來回饋硬體裝置400的輸出給虛擬機300。In one embodiment, if the virtual machine 300 wants to obtain the output of the hardware device 400 after accessing the hardware device 400, the access packet S5 may further include the virtual machine address 31 of the virtual machine 300, wherein the virtual machine address 31 is the memory address of the storage medium 120 . Accordingly, the analyzer 313 can instruct the host operating system kernel 200 to feed back the output of the hardware device 400 to the virtual machine 300 through the virtual machine address 31 through the access packet S5 .

在一實施例中,主機操作系統核心200可響應於插座節點210接收存取封包S5而將對應於插座節點210的計數值加一。主機操作系統核心200可通過收發器130輸出插座節點210的計數值以供使用者參考。舉例來說,若在一特定時段內,插座節點210的計數值超過閾值,則使用者可判斷虛擬機300經常需要存取對應於插座節點210的硬體裝置400。據此,使用者可考慮為硬體裝置400建立專屬的VirtIO裝置。硬體裝置400專屬的VirtIO裝置可提升存取硬體裝置400的效率。In one embodiment, the host operating system kernel 200 may increase the count value corresponding to the socket node 210 by one in response to the socket node 210 receiving the access packet S5. The host operating system core 200 can output the count value of the socket node 210 through the transceiver 130 for user's reference. For example, if the count value of the socket node 210 exceeds the threshold within a certain period of time, the user can determine that the virtual machine 300 often needs to access the hardware device 400 corresponding to the socket node 210 . Accordingly, the user may consider creating a dedicated VirtIO device for the hardware device 400 . The VirtIO device dedicated to the hardware device 400 can improve the efficiency of accessing the hardware device 400 .

在步驟S310中,插座節點210可根據存取封包S5來存取驅動程式230以驅動硬體裝置400。In step S310 , the socket node 210 can access the driver program 230 according to the access packet S5 to drive the hardware device 400 .

在步驟S311中,主機操作系統核心200可判斷存取封包S5是否包含虛擬機300的虛擬機位址31。若存取封包S5包含虛擬機位址31,則進入步驟S312。若存取封包S5不包含虛擬機位址31,則結束流程。In step S311 , the host operating system kernel 200 can determine whether the access packet S5 includes the virtual machine address 31 of the virtual machine 300 . If the access packet S5 includes the virtual machine address 31, go to step S312. If the access packet S5 does not contain the virtual machine address 31, the process ends.

在步驟S312中,主機操作系統核心200可根據虛擬機300的虛擬機位址31傳送硬體裝置400的輸出S6至虛擬機300。虛擬機300中的應用程式311可取得硬體裝置400的輸出S6。In step S312 , the host operating system kernel 200 can transmit the output S6 of the hardware device 400 to the virtual machine 300 according to the virtual machine address 31 of the virtual machine 300 . The application program 311 in the virtual machine 300 can obtain the output S6 of the hardware device 400 .

圖4根據本發明的一實施例繪示為硬體裝置400建立裝置直通通道的方法的流程圖,其中所述方法可由如圖1所示的伺服器100實施。在完成硬體裝置400的裝置直通通道的建立後,伺服器100便可執行如圖3所示的方法。FIG. 4 is a flowchart of a method for establishing a D2D channel for a hardware device 400 according to an embodiment of the present invention, wherein the method can be implemented by the server 100 shown in FIG. 1 . After the establishment of the D2D channel of the hardware device 400 is completed, the server 100 can execute the method shown in FIG. 3 .

在步驟S401中,主機操作系統核心200可通過收發器130偵測硬體裝置400。In step S401 , the host operating system core 200 can detect the hardware device 400 through the transceiver 130 .

在步驟S402中,主機操作系統核心200可建立(或啟動(launch))對應於硬體裝置400的裝置驅動程式230。In step S402 , the host operating system kernel 200 may create (or launch) the device driver 230 corresponding to the hardware device 400 .

在步驟S403中,主機操作系統核心200可建立對應於硬體裝置400的插座節點210。In step S403 , the host operating system kernel 200 may establish the socket node 210 corresponding to the hardware device 400 .

在步驟S404中,主機操作系統核心200可傳送配置封包至分析器313。配置封包可包含對應於硬體裝置400的硬體識別碼,並可包含對應於插座節點210的插座節點名稱以及插座節點位址。In step S404 , the host operating system core 200 may send the configuration packet to the analyzer 313 . The configuration packet may include a hardware identification code corresponding to the hardware device 400 , and may include a socket node name and a socket node address corresponding to the socket node 210 .

在步驟S405中,分析器313可根據配置封包產生虛擬功能名稱以及插座節點名稱的映射表。具體來說,在接收配置封包後,分析器313可建立與配置封包中的硬體識別碼(或硬體裝置400)相對應的虛擬功能,並可產生對應於所述虛擬功能的虛擬功能名稱。根據配置封包產生的虛擬功能名稱與配置封包中的插座節點名稱是相對應的。換句話說,虛擬功能名稱與插座節點名稱之間具有映射關係。據此,分析器313可根據所述映射關係建立虛擬功能名稱與插座節點名稱的映射表。此外,分析器313可根據配置封包建立對應於插座節點210的插座315。In step S405, the analyzer 313 can generate a mapping table of virtual function names and socket node names according to the configuration packet. Specifically, after receiving the configuration packet, the analyzer 313 can establish a virtual function corresponding to the hardware identification code (or hardware device 400) in the configuration packet, and can generate a virtual function name corresponding to the virtual function . The name of the virtual function generated according to the configuration packet corresponds to the name of the socket node in the configuration packet. In other words, there is a mapping between virtual function names and socket node names. Accordingly, the analyzer 313 may establish a mapping table of virtual function names and socket node names according to the mapping relationship. In addition, the analyzer 313 can establish the socket 315 corresponding to the socket node 210 according to the configuration packet.

圖5根據本發明的一實施例繪示另一種虛擬機的裝置直通方法的流程圖,其中所述裝置直通方法可由如圖1所示的伺服器100實施。在步驟S501中,建立主機操作系統核心以及虛擬機,其中主機操作系統核心包含對應於硬體裝置的裝置驅動程式以及插座節點,其中虛擬機包含客戶端操作系統以及客戶端核心,其中客戶端操作系統包含應用程式以及分析器。在步驟S502中,由客戶端核心自應用程式接收輸入輸出請求指令,並且傳送對應於輸入輸出請求指令的輸入輸出請求封包至分析器。在步驟S503中,由分析器根據輸入輸出請求封包中的虛擬功能名稱將對應於輸入輸出請求指令的存取封包傳送至對應於虛擬功能名稱的插座節點。在步驟S504中,由插座節點根據存取封包存取裝置驅動程式以驅動硬體裝置。FIG. 5 shows a flow chart of another D2D method for a virtual machine according to an embodiment of the present invention, wherein the D2D method can be implemented by the server 100 shown in FIG. 1 . In step S501, a host operating system core and a virtual machine are established, wherein the host operating system core includes a device driver corresponding to a hardware device and a socket node, wherein the virtual machine includes a client operating system and a client core, wherein the client operates The system consists of applications and analyzers. In step S502, the client core receives the I/O request command from the application program, and sends the I/O request packet corresponding to the I/O request command to the analyzer. In step S503, the analyzer transmits the access packet corresponding to the I/O request command to the socket node corresponding to the virtual function name according to the virtual function name in the I/O request packet. In step S504, the socket node accesses the device driver according to the access packet to drive the hardware device.

綜上所述,本發明的分析器可在接收到I/O請求封包時判斷是否採用VirtIO裝置來存取主機操作系統核心。當分析器判斷不採用VirtIO裝置時,分析器可通過與硬體裝置專屬的插座節點通訊以存取硬體裝置。相較於傳統的虛擬機通過虛擬裝置存取硬體裝置,通過插座節點存取硬體裝置可避免二進位翻譯程序的發生,從而減少運算資源的浪費。此外,本發明的主機操作系統核心可統計插座節點被存取的次數,以供使用者參考。使用者可根據插座節點被存取的次數來決定是否為對應的硬體裝置開發專屬的VirtIO裝置。若存取封包包含虛擬機位址,則主機操作系統核心可根據虛擬機位址將硬體裝置的輸出回傳給虛擬機。另一方面,當主機操作系統核心偵測到新硬體裝置時,主機操作系統核心可將新硬體裝置的相關資訊傳送給分析器。分析器可根據所述相關資訊來存取所述硬體裝置。To sum up, the analyzer of the present invention can determine whether to use the VirtIO device to access the host operating system kernel when receiving the I/O request packet. When the analyzer determines that the VirtIO device is not used, the analyzer can access the hardware device by communicating with a socket node dedicated to the hardware device. Compared with the traditional virtual machine accessing the hardware device through the virtual device, accessing the hardware device through the socket node can avoid the occurrence of the binary translation program, thereby reducing the waste of computing resources. In addition, the host operating system kernel of the present invention can count the number of times the socket node is accessed for user reference. Users can decide whether to develop a dedicated VirtIO device for the corresponding hardware device according to the number of times the socket node is accessed. If the access packet includes the address of the virtual machine, the host operating system kernel can return the output of the hardware device to the virtual machine according to the address of the virtual machine. On the other hand, when the host operating system core detects a new hardware device, the host operating system core can transmit the relevant information of the new hardware device to the analyzer. The analyzer can access the hardware device according to the relevant information.

100:伺服器 110:處理器 120:儲存媒體 130:收發器 200:主機操作系統核心 210:插座節點 230:裝置驅動程式 300:虛擬機 310:客戶端操作系統 31:虛擬機位址 311:應用程式 313:分析器 315:插座 32:插座節點位址 33:virtIO裝置位址 330:客戶端核心 34:硬體裝置位址 400:硬體裝置 S1: 輸入輸出請求指令 S2: 輸入輸出請求封包 S3、S5:存取封包 S4、S6:輸出 S301、S302、S303、S304、S305、S306、S307、S308、S309、S310、S311、S312、S401、S402、S403、S404、S405、S501、S502、S503、S504:步驟 100: server 110: Processor 120: storage media 130: Transceiver 200: host operating system core 210: socket node 230:Device Driver 300: virtual machine 310: client operating system 31: virtual machine address 311: Application 313: Analyzer 315: socket 32: socket node address 33: virtIO device address 330: client core 34: Hardware device address 400: hardware device S1: Input and output request command S2: Input and output request packets S3, S5: access packets S4, S6: output S301, S302, S303, S304, S305, S306, S307, S308, S309, S310, S311, S312, S401, S402, S403, S404, S405, S501, S502, S503, S504: steps

圖1根據本發明的一實施例繪示一種虛擬機的伺服器的示意圖。 圖2根據本發明的一實施例繪示儲存媒體中的多個模組的示意圖。 圖3根據本發明的一實施例繪示一種虛擬機的裝置直通方法的流程圖。 圖4根據本發明的一實施例繪示為硬體裝置建立裝置直通通道的方法的流程圖。 圖5根據本發明的一實施例繪示另一種虛擬機的裝置直通方法的流程圖。 FIG. 1 is a schematic diagram of a virtual machine server according to an embodiment of the present invention. FIG. 2 is a schematic diagram illustrating a plurality of modules in a storage medium according to an embodiment of the present invention. FIG. 3 is a flow chart of a device-through method for a virtual machine according to an embodiment of the present invention. FIG. 4 is a flowchart illustrating a method for establishing a D2D channel for a hardware device according to an embodiment of the present invention. FIG. 5 is a flow chart illustrating another device-through method for a virtual machine according to an embodiment of the present invention.

S501、S502、S503、S504:步驟S501, S502, S503, S504: steps

Claims (12)

一種虛擬機的伺服器,包括:收發器;儲存媒體,儲存多個模組;以及處理器,耦接所述儲存媒體以及所述收發器,並且存取和執行所述多個模組,其中所述多個模組包括:主機操作系統核心,通過所述收發器通訊連接至硬體裝置,並且包含對應於所述硬體裝置的裝置驅動程式以及插座節點;以及虛擬機,包括客戶端操作系統以及客戶端核心,其中所述客戶端操作系統包括應用程式以及分析器,其中所述客戶端核心自所述應用程式接收輸入輸出請求指令,並且傳送對應於所述輸入輸出請求指令的輸入輸出請求封包至所述分析器,其中所述分析器響應於所述輸入輸出請求封包包含虛擬功能名稱將對應於所述輸入輸出請求指令的存取封包傳送至對應於所述虛擬功能名稱的所述插座節點,其中所述插座節點根據所述存取封包存取所述裝置驅動程式以驅動所述硬體裝置。 A server for a virtual machine, including: a transceiver; a storage medium, storing multiple modules; and a processor, coupled to the storage medium and the transceiver, and accessing and executing the multiple modules, wherein The plurality of modules include: a host operating system core, communicatively connected to a hardware device through the transceiver, and including a device driver corresponding to the hardware device and a socket node; and a virtual machine, including a client operating A system and a client core, wherein the client operating system includes an application program and an analyzer, wherein the client core receives input and output request commands from the application program, and transmits input and output corresponding to the input and output request commands request packets to the parser, wherein the parser transmits an access packet corresponding to the I/O request instruction to the virtual function name corresponding to the I/O request packet in response to the I/O request packet containing a virtual function name A socket node, wherein the socket node accesses the device driver according to the access packet to drive the hardware device. 如請求項1所述的伺服器,其中所述客戶端核心包括VirtIO裝置,其中所述輸入輸出請求封包包括所述虛擬功能名稱和硬體識別碼的其中之一,其中所述分析器響應於所述輸入輸出請 求封包包括所述硬體識別碼而通過對應於所述硬體識別碼的所述VirtIO裝置傳送所述存取封包至所述主機操作系統核心,其中所述主機操作系統核心根據所述存取封包存取所述裝置驅動程式以驅動所述硬體裝置。 The server as described in claim 1, wherein the client core includes a VirtIO device, wherein the input/output request packet includes one of the virtual function name and a hardware identification code, wherein the analyzer responds to The input and output please The request packet includes the hardware identification code and the access packet is sent to the host operating system kernel through the VirtIO device corresponding to the hardware identification code, wherein the host operating system kernel is based on the access The packet accesses the device driver to drive the hardware device. 如請求項1所述的伺服器,其中所述主機操作系統核心響應於所述插座節點接收所述存取封包而將對應於所述插座節點的計數值加一,其中所述主機操作系統核心通過所述收發器輸出所述計數值。 The server of claim 1, wherein the host operating system core increments a count value corresponding to the socket node by one in response to the socket node receiving the access packet, wherein the host operating system core The count value is output by the transceiver. 如請求項1所述的伺服器,其中所述分析器根據所述輸入輸出請求封包產生所述存取封包,其中所述存取封包包括存取指令以及對應於所述插座節點的插座節點名稱。 The server according to claim 1, wherein the analyzer generates the access packet according to the input/output request packet, wherein the access packet includes an access instruction and a socket node name corresponding to the socket node . 如請求項4所述的伺服器,其中所述存取封包更包括對應於所述虛擬機的虛擬機位址,其中所述插座節點響應於驅動所述硬體裝置而根據所述虛擬機位址傳送所述硬體裝置的輸出至所述虛擬機。 The server according to claim 4, wherein the access packet further includes a virtual machine address corresponding to the virtual machine, wherein the socket node responds to driving the hardware device according to the virtual machine address The address transfers the output of the hardware device to the virtual machine. 如請求項2所述的伺服器,其中所述存取封包包括對應於所述VirtIO裝置的VirtIO裝置位址,其中所述主機操作系統核心響應於驅動所述硬體裝置而根據所述VirtIO裝置位址傳送所述硬體裝置的輸出至所述VirtIO裝置。 The server of claim 2, wherein the access packet includes a VirtIO device address corresponding to the VirtIO device, wherein the host operating system kernel responds to driving the hardware device according to the VirtIO device The address transfers the output of the hardware device to the VirtIO device. 如請求項1所述的伺服器,其中所述主機操作系統核心通過所述收發器偵測所述硬體裝置,並且響應於偵測所述硬體裝置而建立所述裝置驅動程式以及所述插座節點。 The server of claim 1, wherein the host operating system core detects the hardware device through the transceiver, and creates the device driver and the device driver in response to detecting the hardware device. socket node. 如請求項7所述的伺服器,其中所述主機操作系統核心響應於偵測所述硬體裝置而傳送配置封包至所述分析器,其中所述配置封包包括對應於所述硬體裝置的硬體識別碼、對應於所述插座節點的插座節點位址以及對應於所述插座節點的插座節點名稱。 The server of claim 7, wherein the host operating system kernel transmits a configuration packet to the analyzer in response to detecting the hardware device, wherein the configuration packet includes a configuration corresponding to the hardware device A hardware identification code, a socket node address corresponding to the socket node, and a socket node name corresponding to the socket node. 如請求項8所述的伺服器,其中所述分析器根據所述配置封包產生所述虛擬功能名稱以及所述插座節點名稱的映射表。 The server according to claim 8, wherein the analyzer generates a mapping table of the virtual function name and the socket node name according to the configuration packet. 如請求項9所述的伺服器,其中所述分析器根據所述映射表而將所述存取封包傳送至對應於所述虛擬功能名稱的所述插座節點。 The server according to claim 9, wherein the analyzer transmits the access packet to the socket node corresponding to the virtual function name according to the mapping table. 如請求項1所述的伺服器,其中所述分析器與所述插座節點通過虛擬機插座(vsock)協定與彼此進行通訊。 The server according to claim 1, wherein the analyzer and the socket node communicate with each other through a virtual machine socket (vsock) protocol. 一種虛擬機的裝置直通方法,包括:建立主機操作系統核心以及虛擬機,其中所述主機操作系統核心包含對應於硬體裝置的裝置驅動程式以及插座節點,其中所述虛擬機包括客戶端操作系統以及客戶端核心,其中所述客戶端操作系統包括應用程式以及分析器;由所述客戶端核心自所述應用程式接收輸入輸出請求指令,並且傳送對應於所述輸入輸出請求指令的輸入輸出請求封包至所述分析器;由所述分析器響應於所述輸入輸出請求封包包含虛擬功能名 稱將對應於所述輸入輸出請求指令的存取封包傳送至對應於所述虛擬功能名稱的所述插座節點;以及由所述插座節點根據所述存取封包存取所述裝置驅動程式以驅動所述硬體裝置。 A device direct method for a virtual machine, comprising: establishing a host operating system core and a virtual machine, wherein the host operating system core includes a device driver corresponding to a hardware device and a socket node, wherein the virtual machine includes a client operating system and a client core, wherein the client operating system includes an application program and an analyzer; the client core receives an input-output request command from the application program, and transmits an input-output request corresponding to the input-output request command packet to said parser; packet containing virtual function name by said parser in response to said I/O request Said that the access packet corresponding to the input and output request command is transmitted to the socket node corresponding to the name of the virtual function; and the device driver is accessed by the socket node according to the access packet to drive The hardware device.
TW110117542A 2021-05-14 2021-05-14 Device pass-through method for virtual machine and server using the same TWI790615B (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
TW110117542A TWI790615B (en) 2021-05-14 2021-05-14 Device pass-through method for virtual machine and server using the same
US17/724,484 US20220365805A1 (en) 2021-05-14 2022-04-19 Device pass-through method for virtual machine and server using the same

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
TW110117542A TWI790615B (en) 2021-05-14 2021-05-14 Device pass-through method for virtual machine and server using the same

Publications (2)

Publication Number Publication Date
TW202244731A TW202244731A (en) 2022-11-16
TWI790615B true TWI790615B (en) 2023-01-21

Family

ID=83999060

Family Applications (1)

Application Number Title Priority Date Filing Date
TW110117542A TWI790615B (en) 2021-05-14 2021-05-14 Device pass-through method for virtual machine and server using the same

Country Status (2)

Country Link
US (1) US20220365805A1 (en)
TW (1) TWI790615B (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8200796B1 (en) * 2005-05-05 2012-06-12 Digital Display Innovations, Llc Graphics display system for multiple remote terminals
TWI477967B (en) * 2011-12-21 2015-03-21 Intel Corp System and method for implementing gpu accelerated address translation and graphics processor
US20200150987A1 (en) * 2013-11-26 2020-05-14 Dynavisor, Inc. Dynamic i/o virtualization
US20200409732A1 (en) * 2019-06-26 2020-12-31 Ati Technologies Ulc Sharing multimedia physical functions in a virtualized environment on a processing unit

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8200796B1 (en) * 2005-05-05 2012-06-12 Digital Display Innovations, Llc Graphics display system for multiple remote terminals
TWI477967B (en) * 2011-12-21 2015-03-21 Intel Corp System and method for implementing gpu accelerated address translation and graphics processor
US20200150987A1 (en) * 2013-11-26 2020-05-14 Dynavisor, Inc. Dynamic i/o virtualization
US20200409732A1 (en) * 2019-06-26 2020-12-31 Ati Technologies Ulc Sharing multimedia physical functions in a virtualized environment on a processing unit

Also Published As

Publication number Publication date
US20220365805A1 (en) 2022-11-17
TW202244731A (en) 2022-11-16

Similar Documents

Publication Publication Date Title
JP3138119U (en) Remote start control device
EP3204862B1 (en) Emulated endpoint configuration
TWI303025B (en) Physical device , i/o device and computer system with virtual machine capable interfaces
WO2019095655A1 (en) Data interaction method and computer device
US7437738B2 (en) Method, system, and program for interfacing with a network adaptor supporting a plurality of devices
US7802022B2 (en) Generic USB drivers
US20070005867A1 (en) Virtual peripheral device interface and protocol for use in peripheral device redirection communication
US10509758B1 (en) Emulated switch with hot-plugging
KR100946395B1 (en) Microcomputer bridge architecture with an embedded microcontroller
JP6004608B2 (en) Method, apparatus, and computer program for virtualizing host USB adapter (virtualization of host USB adapter)
EP2090979B1 (en) Interface driver program for computer and recording medium therefor
JP2003532165A (en) Apparatus and method for dynamically reconfiguring input / output devices
JP2008539484A (en) Universal serial bus function delegation
JP7093979B2 (en) Device proxy device and computer system including it
US20100169069A1 (en) Composite device emulation
TWI790615B (en) Device pass-through method for virtual machine and server using the same
WO2014000299A1 (en) Serial port redirection processing method, device, and system
US20140006645A1 (en) Emulated keyboard controller and embedded controller interface via an interconnect interface
JP5626839B2 (en) Virtual computer system, virtual computer control device, and virtual computer system execution method
CN115469962A (en) Device direct connection method of virtual machine and server thereof
JP6965943B2 (en) Configuration management device, configuration management system, configuration management method, and configuration management program
CN117331720B (en) Method, register set, chip and computer device for communication between multiple cores
EP4361858A1 (en) Securing function as a service cloud computing environments
CN110865960B (en) Emulating a PCIe bus over a network
US20240143740A1 (en) Securing function as a service cloud computing environments