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

[Libvir] [PATCH] Fix capabilities xml for topology info



The patch below fixes the capabilities xml generated for the hosts
topology info. This was causing virt-install to barf when using
the test driver (see attached capabilities xml from before this patch).

Thanks,
Cole

diff --git a/src/capabilities.c b/src/capabilities.c
index bedd445..01bb308 100644
--- a/src/capabilities.c
+++ b/src/capabilities.c
@@ -583,7 +583,7 @@ virCapabilitiesFormatXML(virCapsPtr caps)
                                   caps->host.numaCell[i]->ncpus) < 0)
                 goto no_memory;
             for (j = 0 ; j < caps->host.numaCell[i]->ncpus ; j++)
-                if (virBufferVSprintf(&xml, "            <cpu id='%d'>\n",
+                if (virBufferVSprintf(&xml, "            <cpu id='%d'/>\n",
                                       caps->host.numaCell[i]->cpus[j]) < 0)
                     goto no_memory;
             if (virBufferAddLit(&xml, "          </cpus>\n") < 0)
<capabilities>

  <host>
    <cpu>
      <arch>i686</arch>
      <features>
        <pae/>
        <nonpae/>
      </features>
    </cpu>
    <topology>
      <cells num='2'>
        <cell id='0'>
          <cpus num='8'>
            <cpu id='0'>
            <cpu id='2'>
            <cpu id='4'>
            <cpu id='6'>
            <cpu id='8'>
            <cpu id='10'>
            <cpu id='12'>
            <cpu id='14'>
          </cpus>
        </cell>
        <cell id='1'>
          <cpus num='8'>
            <cpu id='1'>
            <cpu id='3'>
            <cpu id='5'>
            <cpu id='7'>
            <cpu id='9'>
            <cpu id='11'>
            <cpu id='13'>
            <cpu id='15'>
          </cpus>
        </cell>
      </cells>
    </topology>
  </host>

  <guest>
    <os_type>linux</os_type>
    <arch name='i686'>
      <wordsize>32</wordsize>
      <domain type='test'>
      </domain>
    </arch>
    <features>
      <pae/>
      <nonpae/>
    </features>
  </guest>

</capabilities>



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