<html><body>
<p>Chip,<br>
<br>
  Can you open new bugs to fix "sdl"  support  and "password" issues ?<br>
  <br>
Regards,<br>
Sharad Mishra<br>
Open Virtualization<br>
Linux Technology Center<br>
IBM<br>
<br>
<tt>libvirt-cim-bounces@redhat.com wrote on 04/06/2011 05:46:23 PM:<br>
<br>
> Chip Vincent <cvincent@linux.vnet.ibm.com> </tt><br>
<tt>> Sent by: libvirt-cim-bounces@redhat.com<br>
> </tt><br>
<tt>> 04/06/2011 05:46 PM</tt><br>
<tt>> <br>
> Please respond to<br>
> cvincent@linux.vnet.ibm.com; Please respond to<br>
> List for discussion and development of libvirt CIM <libvirt-cim@redhat.com></tt><br>
<tt>> <br>
> To</tt><br>
<tt>> <br>
> libvirt-cim@redhat.com</tt><br>
<tt>> <br>
> cc</tt><br>
<tt>> <br>
> Subject</tt><br>
<tt>> <br>
> Re: [Libvirt-cim] [PATCH] Add support for console/serial grahpics devices</tt><br>
<tt>> <br>
> Thanks for the comments. My responses below.<br>
> <br>
> On 04/06/2011 03:19 PM, Sharad Mishra wrote:<br>
> > Chip,<br>
> ><br>
> > My comments are inline below at 2 places.<br>
> > There are few lines in this patch that are longer than 80 characters,<br>
> > please correct them.<br>
> ><br>
> > Thanks,<br>
> > Sharad Mishra<br>
> > Open Virtualization<br>
> > Linux Technology Center<br>
> > IBM<br>
> ><br>
> > libvirt-cim-bounces@redhat.com wrote on 04/05/2011 07:35:51 AM:<br>
> ><br>
> >  > Chip Vincent <cvincent@linux.vnet.ibm.com><br>
> >  > Sent by: libvirt-cim-bounces@redhat.com<br>
> >  ><br>
> >  > + infostore = infostore_open(dom);<br>
> >  > + if (infostore != NULL)<br>
> >  > + has_passwd = infostore_get_bool(infostore,<br>
> >  > + "has_vnc_passwd");<br>
> >  > +<br>
> >  > + if (has_passwd) {<br>
> >  > + CU_DEBUG("has password");<br>
> ><br>
> > Password is being set to "*****". According to libvirt.org, password<br>
> > should appear in clear text.<br>
> > I am not seeing password attribute in libvirt xml even when password is<br>
> > being passed to libvirt-cim. Here is the libvirt xml generated -<br>
> ><br>
> > <graphics type='vnc' port='5910' autoport='no' listen='127.0.0.1'<br>
> > keymap='en-us'/><br>
> ><br>
> > I was expecting something like this -<br>
> ><br>
> > <graphics type="vnc" port="5910" autoport="no" listen="127.0.0.1"<br>
> > passwd="test0all" keymap="en-us"/><br>
> ><br>
> > Libvirt-cim log indicates that code knew about password but lost it<br>
> > somewhere -<br>
> ><br>
> > device_parsing.c(517): graphics device type = vnc<br>
> > Virt_RASD.c(433): graphics Address = 127.0.0.1:5910<br>
> > misc_util.c(75): Connecting to libvirt with uri `qemu:///system'<br>
> > infostore.c(89): Path is /etc/libvirt/cim/QEMU_test_kvmredsap_dom<br>
> > Virt_RASD.c(464): has password<br>
> ><br>
> <br>
> The password is only clear text when the CIM instance is created and <br>
> passed to libvirt. Once the password is set, it cannot be fetched <br>
> (except by a secure libvirt connection, I think). The only was to change <br>
> the password today is delete the instance (or XML) and recreate with a <br>
> new password. That is why the existence of a password is determine via <br>
> an attribute in the libvirt-cim data store.<br>
> <br>
> NOTE: This is the original logic and was not changed in this patch, just <br>
> re-factored to be contained within the "vnc" code path.<br>
> <br>
> <br>
> >  > @@ -1068,9 +1098,8 @@<br>
> >  > static const char *graphics_rasd_to_vdev(CMPIInstance *inst,<br>
> >  > struct virt_device *dev)<br>
> >  > {<br>
> >  > - const char *val;<br>
> >  > + const char *val = NULL;<br>
> >  > const char *msg = NULL;<br>
> >  > - const char *keymap;<br>
> >  > bool ipv6 = false;<br>
> >  > int ret;<br>
> >  ><br>
> >  > @@ -1080,36 +1109,67 @@<br>
> >  > }<br>
> >  > dev->dev.graphics.type = strdup(val);<br>
> >  ><br>
> >  > + CU_DEBUG("graphics type = %s", dev->dev.graphics.type);<br>
> >  > +<br>
> ><br>
> > If graphics type is "sdl", then the logic below leads to error message<br>
> > that "sdl" is unsupported<br>
> <br>
> The original code only handled vnc connections and would incorrectly <br>
> create other ResourceSubTypes, such as 'sdl'. For example, the original <br>
> code would create sdl objects with a internet address in the XML and <br>
> pass to libvirt, which would then reject the device. Since sdl did not <br>
> appear to be full supported, I added it to the explicitly not supported <br>
> list. We have other code that "tolerates" sdl, but more work is needed <br>
> to ensure complete support. I'll defer this work to another bug/patch.<br>
> <br>
> ><br>
> >  > /* FIXME: Add logic to prevent address:port collisions */<br>
> >  > - if (cu_get_str_prop(inst, "Address", &val) != CMPI_RC_OK) {<br>
> >  > - CU_DEBUG("no graphics port defined, giving default");<br>
> >  > - if (cu_get_bool_prop(inst, "IsIPv6Only", &ipv6) !=<br>
> >  > CMPI_RC_OK)<br>
> >  > - ipv6 = false;<br>
> >  > - if (ipv6)<br>
> >  > - dev->dev.graphics.host = strdup("[::1]");<br>
> >  > - else<br>
> >  > - dev->dev.graphics.host = strdup("127.0.0.1");<br>
> >  > - dev->dev.graphics.port = strdup("-1");<br>
> >  > - } else {<br>
> >  > - ret = parse_vnc_address(val,<br>
> >  > - &dev->dev.graphics.host,<br>
> >  > - &dev->dev.graphics.port);<br>
> >  > + if (STREQC(dev->dev.graphics.type, "vnc")) {<br>
> >  > + if (cu_get_str_prop(inst, "Address", &val) != CMPI_RC_OK) {<br>
> >  > + CU_DEBUG("graphics Address empty, using default");<br>
> >  > +<br>
> >  > + if (cu_get_bool_prop(inst, "IsIPV6Only",<br>
> >  > &ipv6) != CMPI_RC_OK)<br>
> >  > + ipv6 = false;<br>
> >  > +<br>
> >  > + if(ipv6)<br>
> >  > + val = "[::1]:-1";<br>
> >  > + else<br>
> >  > + val = "127.0.0.1:-1";<br>
> >  > + }<br>
> >  > +<br>
> >  > + ret = parse_vnc_address(val,<br>
> >  > + &dev->dev.graphics.host,<br>
> >  > + &dev->dev.graphics.port);<br>
> >  > if (ret != 1) {<br>
> >  > msg = "GraphicsRASD field Address not valid";<br>
> >  > goto out;<br>
> >  > }<br>
> >  > +<br>
> >  > + if (cu_get_str_prop(inst, "KeyMap", &val) != CMPI_RC_OK)<br>
> >  > + dev->dev.graphics.keymap = strdup("en-us");<br>
> >  > + else<br>
> >  > + dev->dev.graphics.keymap = strdup(val);<br>
> >  > +<br>
> >  > + if (cu_get_str_prop(inst, "Password", &val) != CMPI_RC_OK) {<br>
> >  > + CU_DEBUG("vnc password is not set");<br>
> >  > + dev->dev.graphics.passwd = NULL;<br>
> >  > + } else {<br>
> >  > + CU_DEBUG("vnc password is set");<br>
> >  > + dev->dev.graphics.passwd = strdup(val);<br>
> >  > + }<br>
> >  > }<br>
> >  > -<br>
> >  > - if (cu_get_str_prop(inst, "KeyMap", &keymap) != CMPI_RC_OK)<br>
> >  > - keymap = "en-us";<br>
> >  > -<br>
> >  > - dev->dev.graphics.keymap = strdup(keymap);<br>
> >  > -<br>
> >  > - if (cu_get_str_prop(inst, "Password", &val) != CMPI_RC_OK) {<br>
> >  > - dev->dev.graphics.passwd = NULL;<br>
> >  > - } else {<br>
> >  > - dev->dev.graphics.passwd = strdup(val);<br>
> >  > - }<br>
> >  > + else if (STREQC(dev->dev.graphics.type, "console") ||<br>
> >  > + STREQC(dev->dev.graphics.type, "serial")) {<br>
> >  > + if (cu_get_str_prop(inst, "Address", &val) != CMPI_RC_OK) {<br>
> >  > + CU_DEBUG("graphics Address empty, using default");<br>
> >  > + val = "/dev/pts/0:0";<br>
> >  > + }<br>
> >  > +<br>
> ><br>
> > _______________________________________________<br>
> > Libvirt-cim mailing list<br>
> > Libvirt-cim@redhat.com<br>
> > <a href="https://www.redhat.com/mailman/listinfo/libvirt-cim">https://www.redhat.com/mailman/listinfo/libvirt-cim</a><br>
> <br>
> If there are no other issues, I'll resolve the line-length issues before <br>
> pushing. Agreed?<br>
> <br>
> -- <br>
> Chip Vincent<br>
> Open Virtualization<br>
> IBM Linux Technology Center<br>
> cvincent@linux.vnet.ibm.com<br>
> <br>
> _______________________________________________<br>
> Libvirt-cim mailing list<br>
> Libvirt-cim@redhat.com<br>
> <a href="https://www.redhat.com/mailman/listinfo/libvirt-cim">https://www.redhat.com/mailman/listinfo/libvirt-cim</a><br>
</tt></body></html>