mirror of
https://github.com/utmapp/UTM.git
synced 2026-10-12 02:24:01 +00:00
process: log the QEMU launch arguments
This commit is contained in:
@@ -27,6 +27,7 @@ typedef int (*UTMProcessThreadEntry)(UTMProcess *self, int argc, const char * _N
|
||||
@property (nonatomic, readonly) BOOL hasRemoteProcess;
|
||||
@property (nonatomic, readonly) NSURL *libraryURL;
|
||||
@property (nonatomic) NSArray<NSString *> *argv;
|
||||
@property (nonatomic, readonly) NSString *arguments;
|
||||
@property (nonatomic, nullable) NSDictionary<NSString *, NSString *> *environment;
|
||||
@property (nonatomic) NSInteger status;
|
||||
@property (nonatomic) NSInteger fatal;
|
||||
|
||||
+13
-9
@@ -95,6 +95,18 @@ static int defaultEntry(UTMProcess *self, int argc, const char *argv[], const ch
|
||||
return _connection != nil;
|
||||
}
|
||||
|
||||
- (NSString *)arguments {
|
||||
NSString *args = @"";
|
||||
for (NSString *arg in _argv) {
|
||||
if ([arg containsString:@" "]) {
|
||||
args = [args stringByAppendingFormat:@" \"%@\"", arg];
|
||||
} else {
|
||||
args = [args stringByAppendingFormat:@" %@", arg];
|
||||
}
|
||||
}
|
||||
return args;
|
||||
}
|
||||
|
||||
#pragma mark - Construction
|
||||
|
||||
- (instancetype)init {
|
||||
@@ -149,15 +161,7 @@ static int defaultEntry(UTMProcess *self, int argc, const char *argv[], const ch
|
||||
}
|
||||
|
||||
- (void)printArgv {
|
||||
NSString *args = @"";
|
||||
for (NSString *arg in _argv) {
|
||||
if ([arg containsString:@" "]) {
|
||||
args = [args stringByAppendingFormat:@" \"%@\"", arg];
|
||||
} else {
|
||||
args = [args stringByAppendingFormat:@" %@", arg];
|
||||
}
|
||||
}
|
||||
UTMLog(@"Running: %@", args);
|
||||
UTMLog(@"Running: %@", self.arguments);
|
||||
}
|
||||
|
||||
- (BOOL)didLoadDylib:(void *)handle {
|
||||
|
||||
@@ -70,6 +70,11 @@ static int startQemu(UTMProcess *process, int argc, const char *argv[], const ch
|
||||
[self doesNotRecognizeSelector:_cmd];
|
||||
}
|
||||
|
||||
- (void)setLogging:(QEMULogging *)logging {
|
||||
_logging = logging;
|
||||
[logging writeLine:[NSString stringWithFormat:@"Launching: qemu-system-%@%@\n", self.architecture, self.arguments]];
|
||||
}
|
||||
|
||||
- (instancetype)initWithArguments:(NSArray<NSString *> *)arguments architecture:(nonnull NSString *)architecture {
|
||||
self = [super initWithArguments:arguments];
|
||||
if (self) {
|
||||
|
||||
Reference in New Issue
Block a user