[pve-devel] [PATCH 2/2] rest : handle application/x-spice-configuration response format
Alexandre DERUMIER
aderumier at odiso.com
Mon Jun 24 10:54:24 CEST 2013
>>What do you think?
Yes, sure.
This could help as we can add some other spice options later (usb redirect,...).
----- Mail original -----
De: "Dietmar Maurer" <dietmar at proxmox.com>
À: "Alexandre Derumier" <aderumier at odiso.com>, pve-devel at pve.proxmox.com
Envoyé: Lundi 24 Juin 2013 10:41:34
Objet: RE: [pve-devel] [PATCH 2/2] rest : handle application/x-spice-configuration response format
> + } elsif ($format eq 'spiceconfig') {
> + $ct = 'application/x-spice-configuration;charset=UTF-8';
> + if ($data && ref($data) && ref($data->{data})) {
> + $raw = "[virt-viewer]\n";
> + $raw .= "title=$data->{data}->{title}\n" if $data->{data}->{title};
> + $raw .= "type=$data->{data}->{type}\n" if $data->{data}->{type};
> + $raw .= "host=$data->{data}->{host}\n" if $data->{data}->{host};
> + $raw .= "port=$data->{data}->{port}\n" if $data->{data}->{port};
> + $raw .= "password=$data->{data}->{password}\n" if $data->{data}-
> >{password};
> + $raw .= "proxy=$data->{data}->{proxy}\n" if $data->{data}->{proxy};
Maybe we can use a simply loop here? something like:
foreach my $key (keys %{$data->{data}}) {
$raw .= "$key=$data->{data}->{$key}\n";
}
What do you think?
More information about the pve-devel
mailing list