add option to quietly query qemu-fwcfg
This commit is contained in:
parent
5eddf74c68
commit
50ce403c0e
@ -71,14 +71,18 @@ int main(int argc, char * argv[]) {
|
||||
int opt = 0;
|
||||
int list = 0;
|
||||
int no_newline = 0;
|
||||
int query_quietly = 0;
|
||||
|
||||
while ((opt = getopt(argc, argv, "?ln")) != -1) {
|
||||
while ((opt = getopt(argc, argv, "?lnq")) != -1) {
|
||||
switch (opt) {
|
||||
case '?':
|
||||
return usage(argv);
|
||||
case 'n':
|
||||
no_newline = 1;
|
||||
break;
|
||||
case 'q':
|
||||
query_quietly = 1;
|
||||
break;
|
||||
case 'l':
|
||||
list = 1;
|
||||
break;
|
||||
@ -129,6 +133,10 @@ int main(int argc, char * argv[]) {
|
||||
}
|
||||
}
|
||||
|
||||
if (query_quietly) {
|
||||
return !found;
|
||||
}
|
||||
|
||||
if (found) {
|
||||
/* if we found the requested file, read it from the port */
|
||||
outports(FW_CFG_PORT_OUT, file.select);
|
||||
|
Loading…
Reference in New Issue
Block a user