Lines Matching refs:str
64 #define DSET(dpc,member,enumname,str,valname) do{ \ argument
67 xlu__disk_err(dpc, str, TOSTRING(member) " respecified"); \
98 static void setaccess(DiskParseContext *dpc, const char *str) { in setaccess() argument
99 if (!strcmp(str, "r") || !strcmp(str, "ro")) { in setaccess()
101 } else if (!strcmp(str, "rw") || !strcmp(str, "w") || !strcmp(str,"")) { in setaccess()
104 xlu__disk_err(dpc,str,"unknown value for access"); in setaccess()
109 static void setformat(DiskParseContext *dpc, const char *str) { in setformat() argument
110 if (!strcmp(str,"")) DSET(dpc,format,FORMAT,str,RAW); in setformat()
111 else if (!strcmp(str,"raw")) DSET(dpc,format,FORMAT,str,RAW); in setformat()
112 else if (!strcmp(str,"qcow")) DSET(dpc,format,FORMAT,str,QCOW); in setformat()
113 else if (!strcmp(str,"qcow2")) DSET(dpc,format,FORMAT,str,QCOW2); in setformat()
114 else if (!strcmp(str,"vhd")) DSET(dpc,format,FORMAT,str,VHD); in setformat()
115 else if (!strcmp(str,"empty")) DSET(dpc,format,FORMAT,str,EMPTY); in setformat()
116 else if (!strcmp(str,"qed")) DSET(dpc,format,FORMAT,str,QED); in setformat()
117 else xlu__disk_err(dpc,str,"unknown value for format"); in setformat()
121 static void setbackendtype(DiskParseContext *dpc, const char *str) { in setbackendtype() argument
122 if ( !strcmp(str,"phy")) DSET(dpc,backend,BACKEND,str,PHY); in setbackendtype()
123 else if (!strcmp(str,"tap")) DSET(dpc,backend,BACKEND,str,TAP); in setbackendtype()
124 else if (!strcmp(str,"qdisk")) DSET(dpc,backend,BACKEND,str,QDISK); in setbackendtype()
125 else xlu__disk_err(dpc,str,"unknown value for backendtype"); in setbackendtype()
129 static void setcoloport(DiskParseContext *dpc, const char *str) { in setcoloport() argument
130 int port = atoi(str); in setcoloport()
134 xlu__disk_err(dpc,str,"unknown value for colo_port"); in setcoloport()
141 static int vdev_and_devtype(DiskParseContext *dpc, char *str) { in vdev_and_devtype() argument
143 char *colon = strrchr(str, ':'); in vdev_and_devtype()
149 SAVESTRING("vdev", vdev, str); in vdev_and_devtype()