</element>
</define>
+ <define name="createMode">
+ <data type="unsignedInt">
+ <param name="pattern">0[0-7]{3}|[0-7]{1,3}</param>
+ </data>
+ </define>
+
<!--
We handle only document defining a domain
-->
</choice>
</attribute>
</optional>
+ <optional>
+ <attribute name="fmode">
+ <ref name="createMode"/>
+ </attribute>
+ </optional>
+ <optional>
+ <attribute name="dmode">
+ <ref name="createMode"/>
+ </attribute>
+ </optional>
<optional>
<element name="readonly">
<empty/>
g_autofree char *units = NULL;
g_autofree char *model = NULL;
g_autofree char *multidevs = NULL;
+ g_autofree char *fmode = NULL;
+ g_autofree char *dmode = NULL;
ctxt->node = node;
def->accessmode = VIR_DOMAIN_FS_ACCESSMODE_PASSTHROUGH;
}
+ fmode = virXMLPropString(node, "fmode");
+ if (fmode) {
+ if ((virStrToLong_uip(fmode, NULL, 8, &def->fmode) < 0) ||
+ (def->fmode > 0777)) {
+ virReportError(VIR_ERR_XML_ERROR,
+ _("invalid fmode: '%s'"), fmode);
+ goto error;
+ }
+ }
+
+ dmode = virXMLPropString(node, "dmode");
+ if (dmode) {
+ if ((virStrToLong_uip(dmode, NULL, 8, &def->dmode) < 0) ||
+ (def->dmode > 0777)) {
+ virReportError(VIR_ERR_XML_ERROR,
+ _("invalid dmode: '%s'"), dmode);
+ goto error;
+ }
+ }
+
model = virXMLPropString(node, "model");
if (model) {
if ((def->model = virDomainFSModelTypeFromString(model)) < 0 ||
}
if (def->multidevs)
virBufferAsprintf(buf, " multidevs='%s'", multidevs);
+
+ if (def->fmode)
+ virBufferAsprintf(buf, " fmode='%04o'", def->fmode);
+
+ if (def->dmode)
+ virBufferAsprintf(buf, " dmode='%04o'", def->dmode);
+
virBufferAddLit(buf, ">\n");
virBufferAdjustIndent(buf, 2);
int wrpolicy; /* enum virDomainFSWrpolicy */
int format; /* virStorageFileFormat */
int model; /* virDomainFSModel */
+ unsigned int fmode;
+ unsigned int dmode;
int multidevs; /* virDomainFSMultidevs */
unsigned long long usage; /* in bytes */
virStorageSourcePtr src;
--- /dev/null
+<domain type='qemu'>
+ <name>QEMUGuest1</name>
+ <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid>
+ <memory unit='KiB'>219136</memory>
+ <currentMemory unit='KiB'>219136</currentMemory>
+ <vcpu placement='static'>1</vcpu>
+ <os>
+ <type arch='x86_64' machine='pc'>hvm</type>
+ <boot dev='hd'/>
+ </os>
+ <clock offset='utc'/>
+ <on_poweroff>destroy</on_poweroff>
+ <on_reboot>restart</on_reboot>
+ <on_crash>destroy</on_crash>
+ <devices>
+ <emulator>/usr/bin/qemu-system-x86_64</emulator>
+ <controller type='usb' index='0'>
+ <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x2'/>
+ </controller>
+ <controller type='ide' index='0'>
+ <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x1'/>
+ </controller>
+ <controller type='pci' index='0' model='pci-root'/>
+ <filesystem type='mount' accessmode='mapped' fmode='644'>
+ <source dir='/export/fs0'/>
+ <target dir='fs0'/>
+ <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/>
+ </filesystem>
+ <filesystem type='mount' accessmode='mapped' dmode='755'>
+ <source dir='/export/fs1'/>
+ <target dir='fs1'/>
+ <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
+ </filesystem>
+ <filesystem type='mount' accessmode='mapped' fmode='0640' dmode='0750'>
+ <source dir='/export/fs2'/>
+ <target dir='fs2'/>
+ <address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/>
+ </filesystem>
+ <filesystem type='mount' accessmode='mapped'>
+ <source dir='/export/fs3'/>
+ <target dir='fs3'/>
+ <address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x0'/>
+ </filesystem>
+ <serial type='pty'>
+ <target type='isa-serial' port='0'>
+ <model name='isa-serial'/>
+ </target>
+ </serial>
+ <console type='pty'>
+ <target type='serial' port='0'/>
+ </console>
+ <input type='mouse' bus='ps2'/>
+ <input type='keyboard' bus='ps2'/>
+ <memballoon model='virtio'>
+ <address type='pci' domain='0x0000' bus='0x00' slot='0x0c' function='0x0'/>
+ </memballoon>
+ </devices>
+</domain>
--- /dev/null
+<domain type='qemu'>
+ <name>QEMUGuest1</name>
+ <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid>
+ <memory unit='KiB'>219136</memory>
+ <currentMemory unit='KiB'>219136</currentMemory>
+ <vcpu placement='static'>1</vcpu>
+ <os>
+ <type arch='x86_64' machine='pc'>hvm</type>
+ <boot dev='hd'/>
+ </os>
+ <cpu mode='custom' match='exact' check='none'>
+ <model fallback='forbid'>qemu64</model>
+ </cpu>
+ <clock offset='utc'/>
+ <on_poweroff>destroy</on_poweroff>
+ <on_reboot>restart</on_reboot>
+ <on_crash>destroy</on_crash>
+ <devices>
+ <emulator>/usr/bin/qemu-system-x86_64</emulator>
+ <controller type='usb' index='0' model='piix3-uhci'>
+ <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x2'/>
+ </controller>
+ <controller type='ide' index='0'>
+ <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x1'/>
+ </controller>
+ <controller type='pci' index='0' model='pci-root'/>
+ <filesystem type='mount' accessmode='mapped' fmode='0644'>
+ <source dir='/export/fs0'/>
+ <target dir='fs0'/>
+ <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/>
+ </filesystem>
+ <filesystem type='mount' accessmode='mapped' dmode='0755'>
+ <source dir='/export/fs1'/>
+ <target dir='fs1'/>
+ <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
+ </filesystem>
+ <filesystem type='mount' accessmode='mapped' fmode='0640' dmode='0750'>
+ <source dir='/export/fs2'/>
+ <target dir='fs2'/>
+ <address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/>
+ </filesystem>
+ <filesystem type='mount' accessmode='mapped'>
+ <source dir='/export/fs3'/>
+ <target dir='fs3'/>
+ <address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x0'/>
+ </filesystem>
+ <serial type='pty'>
+ <target type='isa-serial' port='0'>
+ <model name='isa-serial'/>
+ </target>
+ </serial>
+ <console type='pty'>
+ <target type='serial' port='0'/>
+ </console>
+ <input type='mouse' bus='ps2'/>
+ <input type='keyboard' bus='ps2'/>
+ <memballoon model='virtio'>
+ <address type='pci' domain='0x0000' bus='0x00' slot='0x0c' function='0x0'/>
+ </memballoon>
+ </devices>
+</domain>
DO_TEST_CAPS_ARCH_LATEST("x86_64-default-cpu-tcg-q35-4.2", "x86_64");
DO_TEST_CAPS_LATEST("virtio-9p-multidevs");
+ DO_TEST_CAPS_LATEST("virtio-9p-createmode");
DO_TEST("downscript", NONE);
cleanup: