<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=big5">
<meta name="Generator" content="Microsoft Word 12 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:新細明體;
        panose-1:2 2 5 0 0 0 0 0 0 0;}
@font-face
        {font-family:細明體;
        panose-1:2 2 5 9 0 0 0 0 0 0;}
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:"\@新細明體";
        panose-1:2 2 5 0 0 0 0 0 0 0;}
@font-face
        {font-family:"\@細明體";
        panose-1:2 2 5 9 0 0 0 0 0 0;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri","sans-serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
span.EmailStyle17
        {mso-style-type:personal-compose;
        font-family:"Calibri","sans-serif";
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.25in 1.0in 1.25in;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="EN-US" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal">We implemented an virt IO port for printing channel.  It works without any problem if Qemu command options specify our printing device.<o:p></o:p></p>
<p class="MsoNormal">However, we found a bug in virtio serial driver when a VM is launched without specifying the “printing device” from the qemu command line.<o:p></o:p></p>
<p class="MsoNormal">In this case, mouse click does not work and no any key can be typed from keyboard.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">In application(vdservice), it simply calls the following API to open the underline device.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.0pt;font-family:細明體">   _handle = CreateFile(DeviceName, GENERIC_READ | GENERIC_WRITE , 0, NULL,<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.0pt;font-family:細明體">                         OPEN_EXISTING, FILE_FLAG_OVERLAPPED, NULL);<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.0pt;font-family:細明體">   
<span style="color:blue">if</span> (_handle == INVALID_HANDLE_VALUE) {<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.0pt;font-family:細明體">        vd_printf(<span style="color:#A31515">"CreateFile() %ls failed: %lu"</span>, DeviceName, GetLastError());<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.0pt;font-family:細明體">       
<span style="color:blue">return</span> <span style="color:blue">false</span>;<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:9.0pt;font-family:細明體">    }<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:9.0pt;font-family:細明體"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:9.0pt;font-family:細明體">For working case, virioserial driver shows that both
</span><span style="font-size:9.0pt;font-family:"Times New Roman","serif"">“</span>com.redhat.spice.0” and “com.redhat.print.0” are opened.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">00000001             0.00000000          ==>VIOSerialPortCreate Port id = 1         
<o:p></o:p></p>
<p class="MsoNormal">00000002             0.00001717          Port Name =com.redhat.spice.0              
<o:p></o:p></p>
<p class="MsoNormal">………………………………….<o:p></o:p></p>
<p class="MsoNormal">00000107             0.00481843          ==>VIOSerialPortCreate Port id = 2         
<o:p></o:p></p>
<p class="MsoNormal">00000108             0.00483288          Port Name =com.redhat.print.0               
<o:p></o:p></p>
<p class="MsoNormal">00000109             0.00484705          No more buffers in queue: last_used_idx 0 vring.used->idx 0<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">For the failure case, “<span style="font-size:9.0pt;font-family:細明體">CreateFile</span><span style="font-size:9.0pt;font-family:"Times New Roman","serif"">”</span><span style="font-size:9.0pt;font-family:細明體"> fails because it cannot open
</span><span style="font-size:9.0pt;font-family:"Times New Roman","serif"">“</span>com.redhat.print.0” device. But trace message of
<span style="font-size:9.0pt;font-family:細明體">virioserial driver only shows that </span>
<span style="font-size:9.0pt;font-family:"Times New Roman","serif"">“</span>com.redhat.spice.0” is opened.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">If <span style="font-size:9.0pt;font-family:細明體">virioserial is not touched for
</span>“com.redhat.print.0” device, why it affects the “com.redhat.spice.0” device?<o:p></o:p></p>
</div>
</body>
</html>