[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: [libvirt] [PATCH 1/2 v3] Fix virDomainChrDefParseTargetXML() to parse the target port if available

On 02/21/2011 05:01 PM, Eric Blake wrote:
On 02/21/2011 02:38 AM, Michal Novotny wrote:
We've got other code in domain_conf.c that assigns ports
to the first available slot; for example, look near line 5628 at how
virtio-serial ports are assigned using maxport and traversal of all
previously assigned ports.

Is the code correct there?

The code is:

         if (chr->info.type ==
             chr->info.addr.vioserial.port == 0) {
             int maxport = 0;
virtio-serial has to start at port 1 (not 0, which is reserved), so
maxport starts at 0...

             chr->info.addr.vioserial.port = maxport + 1;
and the assignment guarantees 1 or greater.  But serial and parallel
support port 0, so start maxport at -1  instead of 0, to reuse the same

Oh, ok, I was thinking whether it's a bug in virtio driver or not. Thanks for clarification it has to start at 1 :)


Michal Novotny<minovotn redhat com>, RHCE
Virtualization Team (xen userspace), Red Hat

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]