[Libvirt-cim] [PATCH 1 of 2] Add Password attribute to GraphicsRASD

Kaitlin Rupert kaitlin at linux.vnet.ibm.com
Fri Jul 10 21:53:17 UTC 2009


Richard Maciel wrote:
> I think you should at least print the Password property as an empty 
> property (or even with asterisks) in the set_graphics_rasd_parameters().
> 
> It's kinda weird to print it on the template rasd, but not on the real 
> rasd instance.
> 

Yeah, I agree it's weird.  The problem is that when you call 
virDomainGetXMLDesc(), libvirt doesn't return any kind of information 
that a password has been set for the given guest.

What we could do is persist a flag that indicates whether a password 
have been set and then set the Password attribute accordingly.

> Kaitlin Rupert wrote:
>> # HG changeset patch
>> # User Kaitlin Rupert <karupert at us.ibm.com>
>> # Date 1247095850 25200
>> # Node ID f609e31b0c17ea550f27426dd8e329c362f4db3e
>> # Parent  0fb4613252c19abb6bf5496a8b7031793ba7f298
>> Add Password attribute to GraphicsRASD
>>
>> Also add necessary changes to the graphics struct and generating XML 
>> with the
>> passwd attribute.
>>
>> The passwd won't show up in the XML we get back from libvirt, so 
>> pulling the
>> passwd from the guest XML isn't included in parse_graphics_device().
>>
>> Signed-off-by: Kaitlin Rupert <karupert at us.ibm.com>
>>
>> diff -r 0fb4613252c1 -r f609e31b0c17 libxkutil/device_parsing.c
>> --- a/libxkutil/device_parsing.c    Tue Jun 30 14:33:31 2009 -0700
>> +++ b/libxkutil/device_parsing.c    Wed Jul 08 16:30:50 2009 -0700
>> @@ -81,6 +81,7 @@
>>          free(dev->port);
>>          free(dev->host);
>>          free(dev->keymap);
>> +        free(dev->passwd);
>>  }
>>
>>  static void cleanup_input_device(struct input_device *dev)
>> diff -r 0fb4613252c1 -r f609e31b0c17 libxkutil/device_parsing.h
>> --- a/libxkutil/device_parsing.h    Tue Jun 30 14:33:31 2009 -0700
>> +++ b/libxkutil/device_parsing.h    Wed Jul 08 16:30:50 2009 -0700
>> @@ -70,6 +70,7 @@
>>          char *port;
>>          char *host;
>>          char *keymap;
>> +        char *passwd;
>>  };
>>
>>  struct input_device {
>> diff -r 0fb4613252c1 -r f609e31b0c17 libxkutil/xmlgen.c
>> --- a/libxkutil/xmlgen.c    Tue Jun 30 14:33:31 2009 -0700
>> +++ b/libxkutil/xmlgen.c    Wed Jul 08 16:30:50 2009 -0700
>> @@ -338,11 +338,21 @@
>>                          return XML_ERROR;
>>
>>                  xmlNewProp(tmp, BAD_CAST "type", BAD_CAST dev->type);
>> +
>> +                if (STREQC(dev->type, "sdl"))
>> +                        goto out;
>> +
>>                  xmlNewProp(tmp, BAD_CAST "port", BAD_CAST dev->port);
>>                  xmlNewProp(tmp, BAD_CAST "listen", BAD_CAST dev->host);
>>                  xmlNewProp(tmp, BAD_CAST "keymap", BAD_CAST 
>> dev->keymap);
>> +
>> +                if (dev->passwd != NULL)
>> +                        xmlNewProp(tmp, 
>> +                                   BAD_CAST "passwd", 
>> +                                   BAD_CAST dev->passwd);
>>          }
>>
>> + out:
>>          return NULL;
>>  }
>>
>> diff -r 0fb4613252c1 -r f609e31b0c17 
>> schema/ResourceAllocationSettingData.mof
>> --- a/schema/ResourceAllocationSettingData.mof    Tue Jun 30 14:33:31 
>> 2009 -0700
>> +++ b/schema/ResourceAllocationSettingData.mof    Wed Jul 08 16:30:50 
>> 2009 -0700
>> @@ -132,6 +132,9 @@
>>  {
>>        [Description ("Keyboard keymapping")]
>>        string KeyMap;
>> +
>> +      [Description ("VNC password")]
>> +      string Password;
>>  };
>>
>>  [Description ("KVM virtual graphics device"),
>> @@ -141,6 +144,9 @@
>>  {
>>        [Description ("Keyboard keymapping")]
>>        string KeyMap;
>> +
>> +      [Description ("VNC password")]
>> +      string Password;
>>  };
>>
>>  [Description ("LXC virtual graphics device"),
>> @@ -150,6 +156,9 @@
>>  {
>>        [Description ("Keyboard keymapping")]
>>        string KeyMap;
>> +
>> +      [Description ("VNC password")]
>> +      string Password;
>>  };
>>
>>  [Description ("Xen virtual input device"),
>>
>> _______________________________________________
>> Libvirt-cim mailing list
>> Libvirt-cim at redhat.com
>> https://www.redhat.com/mailman/listinfo/libvirt-cim
> 
> 


-- 
Kaitlin Rupert
IBM Linux Technology Center
kaitlin at linux.vnet.ibm.com




More information about the Libvirt-cim mailing list