[libvirt] [PATCH] Add support for multiple serial ports into the Xen driver

Michal Novotny minovotn at redhat.com
Thu Feb 17 09:37:52 UTC 2011


Eric, thanks for reply but I'm having some issues now...

I've pulled libvirt sources from upstream and I'm unable to compile it 
since it keeps saying following:

   CCLD   libvirt_parthelper
./.libs/libvirt_util.a(libvirt_util_la-util.o): In function 
`virFileOperationNoFork':
/home/mig/Work/virt-related/libvirt/src/util/util.c:1363: undefined 
reference to `rpl_open'
./.libs/libvirt_util.a(libvirt_util_la-util.o): In function 
`virFileReadAll':
/home/mig/Work/virt-related/libvirt/src/util/util.c:1159: undefined 
reference to `rpl_open'
./.libs/libvirt_util.a(libvirt_util_la-util.o): In function 
`virFileWriteStr':
/home/mig/Work/virt-related/libvirt/src/util/util.c:1184: undefined 
reference to `rpl_open'
/home/mig/Work/virt-related/libvirt/src/util/util.c:1186: undefined 
reference to `rpl_open'
./.libs/libvirt_util.a(libvirt_util_la-util.o): In function 
`virFileOperation':
/home/mig/Work/virt-related/libvirt/src/util/util.c:1519: undefined 
reference to `rpl_open'
./.libs/libvirt_util.a(libvirt_util_la-util.o):/home/mig/Work/virt-related/libvirt/src/util/util.c:1795: 
more undefined references to `rpl_open' follow
collect2: ld returned 1 exit status

Unfortunately I was unable to find definition of 'rpl_open' function 
using git grep so I don't really know what to do there. Some bug or do I 
miss something?
>>> +++ b/src/xen/xend_internal.c
>>> @@ -1218,6 +1218,9 @@ xenDaemonParseSxprChar(const char *value,
>>>
>>>        if (value[0] == '/') {
>>>            def->source.type = VIR_DOMAIN_CHR_TYPE_DEV;
>>> +        def->data.file.path = strdup(value);
>>> +        if (!def->data.file.path)
>>> +            goto error;
> This should be goto no_memory.
>

To my knowledge this is not the only one issue there since this has been 
changed from def->data.file.path to def->source.data.file.path to 
compile successfully but that's fine. It seems like codebase changed so 
it took some time to rewrite the code for the current upstream codebase.
>>> @@ -5958,10 +6011,22 @@ xenDaemonFormatSxpr(virConnectPtr conn,
>>>                    virBufferAddLit(&buf, "(parallel none)");
>>>                }
>>>                if (def->serials) {
>>> -                virBufferAddLit(&buf, "(serial ");
>>> -                if (xenDaemonFormatSxprChr(def->serials[0],&buf)<   0)
>>> -                    goto error;
>>> -                virBufferAddLit(&buf, ")");
>>> +                if (def->nserials>   1) {
>>> +                    virBufferAddLit(&buf, "(serial (");
>>> +                    for (i = 0; i<   def->nserials; i++) {
>>> +                        if
>>> (xenDaemonFormatSxprChr(def->serials[i],&buf)<   0)
>>> +                            goto error;
>>> +                        if (i<   def->nserials - 1)
>>> +                            virBufferAddLit(&buf, " ");
>>> +                    }
>>> +                    virBufferAddLit(&buf, "))");
>>> +                }
> You skipped "none" as a placeholder when parsing; but I'm not sure if
> this generates "none" on output to match.

Basically I don't know what you mean by this. Also, when I was defining 
XMLs I saw that the console node copies the first serial node however 
how to define it if first serial node is just none?

I mean the XML is like:

<serial type='dev'>
<source path='/dev/ttyS0'/>
<target port='0'/>
</serial>
<serial type='dev'>
<source path='/dev/ttyS1'/>
<target port='1'/>
</serial>
<console type='dev'>
<source path='/dev/ttyS0'/>
<target port='0'/>
</console>

But what should the XML part be for case of first serial device to be none ?

Michal

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




More information about the libvir-list mailing list